Page 1 of 1

ValueError: A value in x_new is below the interpolation range

Posted: Sun Jan 23, 2022 4:13 am
by jz.ocrs
Hi there,

I ran polymer v4.14 to process MODIS/Aqua data. L1C file was generated from SeaDAS 8.1. But got the following error:

Starting processing at 2022-01-23 11:58:15.153299
Initializing output file "/tmp/A2020091092000_polymer.nc"
Processing block: size (500, 400), offset (0, 0)
Traceback (most recent call last):
File "./polymer_modis_nasa.py", line 35, in <module>
example_modis()
File "./polymer_modis_nasa.py", line 24, in example_modis
run_atm_corr(Level1_NASA('/tmp/A2020091092000.L1C',sensor='MODIS',
File "/opt/polymer-v4.14/polymer/main.py", line 517, in run_atm_corr
for block in block_iter:
File "/opt/polymer-v4.14/polymer/main.py", line 407, in process_block
c.cloudmask(block)
File "/opt/polymer-v4.14/polymer/main.py", line 283, in cloudmask
block.Rnir[ok] = block.Rtoa_gc[:,:,inir_block][ok] - self.mlut['Rmol'][
File "/opt/polymer-v4.14/polymer/luts.py", line 399, in __getitem__
keys = k.index(self.axes)
File "/opt/polymer-v4.14/polymer/luts.py", line 1110, in index
res = interp1d(axis, np.arange(len(axis)),
File "/opt/anaconda3/lib/python3.8/site-packages/scipy/interpolate/polyint.py", line 74, in __call__
y = self._evaluate(x)
File "/opt/anaconda3/lib/python3.8/site-packages/scipy/interpolate/interpolate.py", line 659, in _evaluate
below_bounds, above_bounds = self._check_bounds(x_new)
File "/opt/anaconda3/lib/python3.8/site-packages/scipy/interpolate/interpolate.py", line 688, in _check_bounds
raise ValueError("A value in x_new is below the interpolation "
ValueError: A value in x_new is below the interpolation range.

But the code worked well for other MODIS/Aqua imagery. This is weird.

Please help this out. Thanks in advance.

Jun

Re: ValueError: A value in x_new is below the interpolation range

Posted: Tue Feb 01, 2022 10:17 am
by jz.ocrs
Hi François,

Any solution to the question I posted above?

Thanks.

Jun

Re: ValueError: A value in x_new is below the interpolation range

Posted: Tue Feb 01, 2022 1:19 pm
by fsteinmetz
Hello,

I was able to process this particular file without problem with the following command:

Code: Select all

run_atm_corr(
    Level1_MODIS('A2020091092000.L1C'),
    Level2_NETCDF(),
    multiprocessing=-1,
)
The MSL12 version was : l2gen --version
msl12 9.5.1-V2021.2 (Jun 18 2021 11:22:53)
And Polymer was v4.14.

Did you use any particular option ?
Cheers,
François

Re: ValueError: A value in x_new is below the interpolation range

Posted: Mon Feb 07, 2022 1:11 am
by jz.ocrs
Hi François,

The version of my l2gen is 2022.0. I am not sure if that caused the error. I will give it a try with l2gen of V2021.2

Jun