UMR-CNRM / EPyGrAM

Enhanced Python for Graphics and Analysis of Meteorological fields
Other
14 stars 15 forks source link

Resampling from/to Gauss grids does not work anymore in Python3 #1

Closed AlexandreMary closed 8 months ago

AlexandreMary commented 2 years ago

Example of traceback (f/ P.Brousseau)


  File "/home/gmap/mrpm/broussea/DIVERS/MSG/MSG_clean_lowcloud_ajust_0.9_test.py", line 130, in <module>
    ctaro = ctsev.resample(nebulbas.geometry, weighting='nearest',radius_of_influence=20000)
  File "/home/gmap/mrpm/broussea/.local/lib/python3.7/site-packages/EPyGrAM/epygram/fields/D3Field.py", line 1222, in resample
    segments=segments)
  File "/opt/softs/anaconda3/envs/Py37nomkl/lib/python3.7/site-packages/pyresample/kd_tree.py", line 380, in get_neighbour_info
    nprocs=nprocs)
  File "/opt/softs/anaconda3/envs/Py37nomkl/lib/python3.7/site-packages/pyresample/kd_tree.py", line 542, in _query_resample_kdtree
    radius_of_influence)
  File "/opt/softs/anaconda3/envs/Py37nomkl/lib/python3.7/site-packages/pyresample/kd_tree.py", line 458, in _get_valid_output_index
    radius_of_influence)
  File "/opt/softs/anaconda3/envs/Py37nomkl/lib/python3.7/site-packages/pyresample/data_reduce.py", line 231, in get_valid_index_from_lonlat_boundaries
    lons, lats, radius_of_influence)
  File "/opt/softs/anaconda3/envs/Py37nomkl/lib/python3.7/site-packages/pyresample/data_reduce.py", line 296, in _get_valid_index
    if round(angle_sum) == -360:
TypeError: type MaskedConstant doesn't define __round__ method```
AlexandreMary commented 1 year ago

Maud indicates that replacing round by np.round in pyresample's data_reduce.py may solve the issue. To be confirmed, and if so, ticket/PR in https://github.com/pytroll/pyresample ? Though there may be an actual issue higher up

AlexandreMary commented 8 months ago

Fixed in commit df26f6c76 (v1.4.17)