up42 / DSen2

Super-Resolution of Sentinel-2 Images: Learning a Globally Applicable Deep Neural Network
GNU General Public License v3.0
9 stars 5 forks source link

Unable to CLIP AOI #15

Open purijs opened 3 years ago

purijs commented 3 years ago

It gives NotGeoreferenced warning

(tensorflow2_p37) ubuntu@ip-172-31-7-137:~/Sentinel_2A_PS/DSen2/testing$ python ./s2_tiles_supres.py ../../S2A_MSIL1C_20200514T052651_N0209_R105_T43RGM_20200514T083730.SAFE/MTD_MSIL1C.xml
2021-10-25 04:49:27,080 - utils.data_utils - INFO - Data path is ../../S2A_MSIL1C_20200514T052651_N0209_R105_T43RGM_20200514T083730.SAFE/MTD_MSIL1C.xml
/home/ubuntu/anaconda3/envs/tensorflow2_p37/lib/python3.7/site-packages/rasterio/__init__.py:220: NotGeoreferencedWarning: Dataset has no geotransform, gcps, or rpcs. The identity matrix be returned.
  s = DatasetReader(path, driver=driver, sharing=sharing, **kwargs)
2021-10-25 04:49:27,214 - __main__ - INFO - Selected pixel region:
2021-10-25 04:49:27,214 - __main__ - INFO - xmin = 0
2021-10-25 04:49:27,214 - __main__ - INFO - ymin = 0
2021-10-25 04:49:27,214 - __main__ - INFO - xmax = 10979
2021-10-25 04:49:27,214 - __main__ - INFO - ymax = 10979
2021-10-25 04:49:27,214 - __main__ - INFO - The area of selected region = 120560400
2021-10-25 04:49:27,214 - __main__ - INFO - Selected 10m bands:
2021-10-25 04:49:27,217 - utils.data_utils - INFO - [0, 1, 2, 3]
2021-10-25 04:49:42,346 - __main__ - INFO - Selected 20m bands:
2021-10-25 04:49:42,348 - utils.data_utils - INFO - [0, 1, 2, 3, 4, 5]
2021-10-25 04:49:49,726 - __main__ - INFO - Selected 60m bands:
2021-10-25 04:49:49,729 - utils.data_utils - INFO - [0, 1]
2021-10-25 04:49:50,192 - __main__ - INFO - Super-resolving the 60m data into 10m bands
purijs commented 3 years ago

On passing --clip_to_aoi

2021-10-25 04:58:26,134 - utils.data_utils - INFO - Data path is ../../S2A_MSIL1C_20200514T052651_N0209_R105_T43RGM_20200514T083730.SAFE/MTD_MSIL1C.xml
/home/ubuntu/anaconda3/envs/tensorflow2_p37/lib/python3.7/site-packages/rasterio/__init__.py:220: NotGeoreferencedWarning: Dataset has no geotransform, gcps, or rpcs. The identity matrix be returned.
  s = DatasetReader(path, driver=driver, sharing=sharing, **kwargs)
/home/ubuntu/anaconda3/envs/tensorflow2_p37/lib/python3.7/site-packages/pyproj/crs/crs.py:131: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
  in_crs_string = _prepare_from_proj_string(in_crs_string)
/home/ubuntu/anaconda3/envs/tensorflow2_p37/lib/python3.7/site-packages/pyproj/crs/crs.py:131: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
  in_crs_string = _prepare_from_proj_string(in_crs_string)
Traceback (most recent call last):
  File "./s2_tiles_supres.py", line 213, in <module>
    args.data_file_path, args.clip_to_aoi, args.copy_original_bands, args.output_dir
  File "./s2_tiles_supres.py", line 178, in process
    data10, data20, data60, coord, pr_10m = self.start()
  File "./s2_tiles_supres.py", line 79, in start
    dsdesc, self.clip_to_aoi
  File "../utils/data_utils.py", line 152, in area_of_interest
    x_1, y_1 = self.to_xy(roi_lon1, roi_lat1, data)
  File "../utils/data_utils.py", line 129, in to_xy
    return int(x_n), int(y_n)
ValueError: cannot convert float NaN to integer