error in processing sentinel 2

Post Reply
shahi141296
Posts: 3
Joined: Wed Jan 18, 2023 11:53 am
company / institution: Khalifa University, Abu Dhabi
Location: United Arab Emirates

error in processing sentinel 2

Post by shahi141296 »

Hi,
I am running into the following error when I tried to process sentinel 2 dataset.
Please let me know where I am making the mistake.


Initialize MSI projection EPSG:32620
/home/shahirabilaval/anaconda3/envs/polymer/lib/python3.8/site-packages/pyproj/crs/crs.py:141: 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 ... -in-proj-6
in_crs_string = _prepare_from_proj_string(in_crs_string)
Trying to download https://oceandata.sci.gsfc.nasa.gov/cgi ... MI_24h.hdf ...
2023-01-23 13:04:27 URL:https://oceandata.sci.gsfc.nasa.gov/ob/ ... MI_24h.hdf [201417/201417] -> "ANCILLARY/METEO/2019/016/N201901600_O3_AURAOMI_24h.hdf.tmp" [1]
Traceback (most recent call last):
File "polymer_test_check.py", line 9, in <module>
run_atm_corr(Level1_MSI('/home/shahirabilaval/safe_data_tobe/S2A_MSIL1C_20190115T145721_N0207_R039_T20QMF_20190115T164135.SAFE/GRANULE/L1C_T20QMF_A018626_20190115T145721/', resolution='60', ancillary=Ancillary_NASA(), landmask=GSW()), Level2_NETCDF(outdir='/home/shahirabilaval/output_1', datasets=default_datasets+['SPM']))
File "/home/shahirabilaval/polymer/level1_msi.py", line 151, in __init__
self.init_ancillary()
File "/home/shahirabilaval/polymer/level1_msi.py", line 180, in init_ancillary
self.ozone = self.ancillary.get('ozone', self.date)
File "/home/shahirabilaval/polymer/ancillary.py", line 301, in get
return self.read(param, res[0])
File "/home/shahirabilaval/polymer/ancillary.py", line 233, in read
D = LUT_LatLon(ozone)
File "/home/shahirabilaval/polymer/ancillary.py", line 55, in __init__
self.data = LUT(data, names=['latitude', 'longitude'],
File "/home/shahirabilaval/polymer/luts.py", line 187, in __init__
if self.data.dtype in [np.float, np.float32, np.float64]:
File "/home/shahirabilaval/anaconda3/envs/polymer/lib/python3.8/site-packages/numpy/__init__.py", line 284, in __getattr__
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'float'
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: error in processing sentinel 2

Post by fsteinmetz »

Hello,
What is your version of numpy ?
python -c 'import numpy ; print(numpy.__version__)'

Cheers, François
shahi141296
Posts: 3
Joined: Wed Jan 18, 2023 11:53 am
company / institution: Khalifa University, Abu Dhabi
Location: United Arab Emirates

Re: error in processing sentinel 2

Post by shahi141296 »

Hi,
Thanks for the reply.
The version is 1.24.1
Regards,
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: error in processing sentinel 2

Post by fsteinmetz »

Hello,

I see the numpy.float alias has been dropped since numpy 1.24. So, two solutions:
- Downgrade to numpy 1.23
- Or rename np.float to float in polymer/luts.py: line 187. This will have no incidence on the code. I will include this modification in next release v4.15

Cheers, François
shahi141296
Posts: 3
Joined: Wed Jan 18, 2023 11:53 am
company / institution: Khalifa University, Abu Dhabi
Location: United Arab Emirates

Re: error in processing sentinel 2

Post by shahi141296 »

Thanks a lot,
Its working now. I edited the LUT.py file.

Kind Regards,
Post Reply