NasjonaltBakkeSegment / safe_to_netcdf

Python scripts for converting specific Copernicus Sentinel products in Standard Archive Format for Europe (SAFE) to NetCDF/CF
GNU General Public License v3.0
6 stars 5 forks source link

Fix all deprecated warnings #23

Closed ElodieFZ closed 1 year ago

ElodieFZ commented 1 year ago

For Sentinel-2:

/home/elodief/Work/NBS/processing_chain/safe_to_netcdf/s2_reader_and_NetCDF_converter.py:730: DeprecationWarning: This function is deprecated. See: https://pyproj4.github.io/pyproj/stable/gotchas.html#upgrading-to-pyproj-2-from-pyproj-1
  longitude, latitude = pyproj.transform(current_projection, target_projection, xp, yp)

For Sentinel-1:

/home/elodief/Softs/anaconda3/envs/py38/bin/python /home/elodief/Work/NBS/processing_chain/safe_to_netcdf/s1_reader_and_NetCDF_converter.py 
/home/elodief/Work/NBS/processing_chain/safe_to_netcdf/s1_reader_and_NetCDF_converter.py:108: DeprecationWarning: `np.str` is a deprecated alias for the builtin `str`. To silence this warning, use `str` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.str_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  self.xmlGCPs[str(parameter + '_' + polarisation)] = np.array(values, np.str)
/home/elodief/Work/NBS/processing_chain/safe_to_netcdf/s1_reader_and_NetCDF_converter.py:965: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  line = np.array(values[4].split(), np.int)
/home/elodief/Work/NBS/processing_chain/safe_to_netcdf/s1_reader_and_NetCDF_converter.py:966: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  noiseAzimuthLUT = np.array(values[5].split(), np.float)
/home/elodief/Work/NBS/processing_chain/safe_to_netcdf/s1_reader_and_NetCDF_converter.py:1022: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  np.int)  # getNoiseRangeRecordByIndex (
/home/elodief/Work/NBS/processing_chain/safe_to_netcdf/s1_reader_and_NetCDF_converter.py:1024: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  rangeRecLines_ = np.array(noiseRangeVectorList[key][2].split(), np.float)
/home/elodief/Work/NBS/processing_chain/safe_to_netcdf/s1_reader_and_NetCDF_converter.py:1040: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  noiseRangeVectorLine_[index] = np.int(noiseRangeVectorList[key][0]