MarcYin / SIAC

A sensor invariant Atmospheric Correction (SIAC)
http://www2.geog.ucl.ac.uk/~ucfafyi/Atmo_Cor/
GNU Affero General Public License v3.0
61 stars 17 forks source link

IndexError #25

Closed nbennasr closed 1 year ago

nbennasr commented 1 year ago

@MarcYin Could you please look at this error when SIAC_S2 to L1C image: id: 176b02f5-8489-457a-a308-fcd200e7a656 name: S2A_MSIL1C_20220719T105041_N0400_R051_T32VLJ_20220719T143242

Traceback (most recent call last): SIAC_S2( File "/opt/s2gm/modules/SIAC/SIAC/SIAC_S2.py", line 48, in SIAC_S2 aero_atmo = do_correction(*ret) File "/opt/s2gm/modules/SIAC/SIAC/SIAC_S2.py", line 208, in do_correction example_file = aero._solving(cloud_mask) File "/opt/s2gm/modules/SIAC/SIAC/the_aerosol.py", line 1269, in _solving self._fill_nan() File "/opt/s2gm/modules/SIAC/SIAC/the_aerosol.py", line 1188, in _fill_nan list(map(fill_nan, [self._saa, self._sza, self._ele, self._aot, self._tcwv, self._tco3])) File "/opt/s2gm/modules/SIAC/SIAC/the_aerosol.py", line 55, in fill_nan array = griddata(valid, value, mesh, method='nearest') File "/usr/local/lib/python3.10/dist-packages/scipy/interpolate/_ndgriddata.py", line 271, in griddata return ip(xi) File "/usr/local/lib/python3.10/dist-packages/scipy/interpolate/_ndgriddata.py", line 117, in call return self.values[i] IndexError: index 0 is out of bounds for axis 0 with size 0"

MarcYin commented 1 year ago

It is caused by the elevation being all zeros over water and it has been fixed with the new commit.

nbennasr commented 1 year ago

@MarcYin Thank you for this quick fix!