Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resampling flash_duration fails with a ValueError exception #2852

Open
gerritholl opened this issue Jul 5, 2024 · 4 comments
Open

Resampling flash_duration fails with a ValueError exception #2852

gerritholl opened this issue Jul 5, 2024 · 4 comments
Labels

Comments

@gerritholl
Copy link
Collaborator

gerritholl commented Jul 5, 2024

Describe the bug

Resampling flash_duration fails with ValueError immediately upon calling resample. This is probably because flash_duration is a timedelta (dtype m8[ns]), although fundamentally operations that work on ints or floats should also work on timedelta, so resampling should be possible in principle.

To Reproduce

from satpy import Scene
from glob import glob
from satpy.utils import debug_on; debug_on()

pat = "/media/nas/x23352/MTG/LI/L2/2024/07/01/10/*LFL*BODY*_0061*.nc"
filenames = glob(pat)
sc = Scene(filenames, reader="li_l2_nc")
sc.load(["flash_duration"])
ls = sc.resample("eurol")
ls.save_datasets()

Expected behavior

I expect an output with a resampled flash duration.

Actual results

[DEBUG: 2024-07-05 14:06:17 : satpy.readers.yaml_reader] Reading ('/data/gholl/checkouts/satpy/satpy/etc/readers/li_l2_nc.yaml',)
[DEBUG: 2024-07-05 14:06:17 : satpy.readers.yaml_reader] Assigning to li_l2_nc: ['/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100747_L2PF_OPE_20240701100723_20240701100733_N__T_0061_0045.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_
XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100524_L2PF_OPE_20240701100503_20240701100513_N__T_0061_0031.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100425_L2PF_OPE_20240701100403_20240701100413_
N__T_0061_0025.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100026_L2PF_OPE_20240701100003_20240701100013_N__T_0061_0001.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---N
C4E_C_EUMT_20240701101015_L2PF_OPE_20240701100953_20240701101003_N__T_0061_0060.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100035_L2PF_OPE_20240701100013_20240701100023_N__T_0061_0002.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/1
0/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100724_L2PF_OPE_20240701100703_20240701100713_N__T_0061_0043.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100635_L2PF_OPE_20240701100613_20240701100
623_N__T_0061_0038.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100604_L2PF_OPE_20240701100543_20240701100553_N__T_0061_0035.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY
---NC4E_C_EUMT_20240701100735_L2PF_OPE_20240701100713_20240701100723_N__T_0061_0044.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100845_L2PF_OPE_20240701100823_20240701100833_N__T_0061_0051.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/
01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100904_L2PF_OPE_20240701100843_20240701100853_N__T_0061_0053.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100314_L2PF_OPE_20240701100253_2024070
1100303_N__T_0061_0018.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100135_L2PF_OPE_20240701100113_20240701100123_N__T_0061_0008.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-
BODY---NC4E_C_EUMT_20240701100514_L2PF_OPE_20240701100453_20240701100503_N__T_0061_0030.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100946_L2PF_OPE_20240701100923_20240701100933_N__T_0061_0057.nc', '/media/nas/x23352/MTG/LI/L2/2024
/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100814_L2PF_OPE_20240701100753_20240701100803_N__T_0061_0048.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100504_L2PF_OPE_20240701100443_202
40701100453_N__T_0061_0029.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100544_L2PF_OPE_20240701100523_20240701100533_N__T_0061_0033.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--
CHK-BODY---NC4E_C_EUMT_20240701100924_L2PF_OPE_20240701100903_20240701100913_N__T_0061_0055.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100154_L2PF_OPE_20240701100133_20240701100143_N__T_0061_0010.nc', '/media/nas/x23352/MTG/LI/L2/
2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100554_L2PF_OPE_20240701100533_20240701100543_N__T_0061_0034.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100045_L2PF_OPE_20240701100023
_20240701100033_N__T_0061_0003.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100804_L2PF_OPE_20240701100743_20240701100753_N__T_0061_0047.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--
FD--CHK-BODY---NC4E_C_EUMT_20240701100354_L2PF_OPE_20240701100333_20240701100343_N__T_0061_0022.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701101004_L2PF_OPE_20240701100943_20240701100953_N__T_0061_0059.nc', '/media/nas/x23352/MTG/LI
/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100535_L2PF_OPE_20240701100513_20240701100523_N__T_0061_0032.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100644_L2PF_OPE_2024070110
0623_20240701100633_N__T_0061_0039.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100214_L2PF_OPE_20240701100153_20240701100203_N__T_0061_0012.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-L
FL--FD--CHK-BODY---NC4E_C_EUMT_20240701100936_L2PF_OPE_20240701100913_20240701100923_N__T_0061_0056.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100855_L2PF_OPE_20240701100833_20240701100843_N__T_0061_0052.nc', '/media/nas/x23352/MT
G/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100614_L2PF_OPE_20240701100553_20240701100603_N__T_0061_0036.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100206_L2PF_OPE_202407
01100143_20240701100153_N__T_0061_0011.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100955_L2PF_OPE_20240701100933_20240701100943_N__T_0061_0058.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI
-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100334_L2PF_OPE_20240701100313_20240701100323_N__T_0061_0020.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100254_L2PF_OPE_20240701100233_20240701100243_N__T_0061_0016.nc', '/media/nas/x2335
2/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100704_L2PF_OPE_20240701100643_20240701100653_N__T_0061_0041.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100124_L2PF_OPE_20
240701100103_20240701100113_N__T_0061_0007.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100224_L2PF_OPE_20240701100203_20240701100213_N__T_0061_0013.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI
1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100113_L2PF_OPE_20240701100053_20240701100103_N__T_0061_0006.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100714_L2PF_OPE_20240701100653_20240701100703_N__T_0061_0042.nc', '/media/nas/x
23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100404_L2PF_OPE_20240701100343_20240701100353_N__T_0061_0023.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100054_L2PF_OP
E_20240701100033_20240701100043_N__T_0061_0004.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100624_L2PF_OPE_20240701100603_20240701100613_N__T_0061_0037.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT
,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100344_L2PF_OPE_20240701100323_20240701100333_N__T_0061_0021.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100105_L2PF_OPE_20240701100043_20240701100053_N__T_0061_0005.nc', '/media/n
as/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100304_L2PF_OPE_20240701100243_20240701100253_N__T_0061_0017.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100144_L2P
F_OPE_20240701100123_20240701100133_N__T_0061_0009.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100654_L2PF_OPE_20240701100633_20240701100643_N__T_0061_0040.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG
+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100914_L2PF_OPE_20240701100853_20240701100903_N__T_0061_0054.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100444_L2PF_OPE_20240701100423_20240701100433_N__T_0061_0027.nc', '/med
ia/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100824_L2PF_OPE_20240701100803_20240701100813_N__T_0061_0049.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100235
_L2PF_OPE_20240701100213_20240701100223_N__T_0061_0014.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100754_L2PF_OPE_20240701100733_20240701100743_N__T_0061_0046.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt
,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100435_L2PF_OPE_20240701100413_20240701100423_N__T_0061_0026.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100245_L2PF_OPE_20240701100223_20240701100233_N__T_0061_0015.nc', '
/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100324_L2PF_OPE_20240701100303_20240701100313_N__T_0061_0019.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_2024070110
0834_L2PF_OPE_20240701100813_20240701100823_N__T_0061_0050.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100454_L2PF_OPE_20240701100433_20240701100443_N__T_0061_0028.nc', '/media/nas/x23352/MTG/LI/L2/2024/07/01/10/W_XX-EUMETSAT-Darms
tadt,IMG+SAT,MTI1+LI-2-LFL--FD--CHK-BODY---NC4E_C_EUMT_20240701100414_L2PF_OPE_20240701100353_20240701100403_N__T_0061_0024.nc']
[DEBUG: 2024-07-05 14:06:17 : satpy.readers.li_base_nc] Product type is: 2-LFL
[DEBUG: 2024-07-05 14:06:17 : satpy.readers.li_base_nc] Adding 12 datasets for 2-LFL input product.
[DEBUG: 2024-07-05 14:06:17 : satpy.readers.li_l2_nc] The current product 2-LFL is not an accumulated product so it will not be regridded.
[snip]
[DEBUG: 2024-07-05 14:06:18 : satpy.readers.li_l2_nc] The current product 2-LFL is not an accumulated product so it will not be regridded.
[DEBUG: 2024-07-05 14:06:18 : satpy.readers.li_base_nc] Product type is: 2-LFL
[DEBUG: 2024-07-05 14:06:18 : satpy.readers.li_base_nc] Adding 12 datasets for 2-LFL input product.
[DEBUG: 2024-07-05 14:06:18 : satpy.readers.li_l2_nc] The current product 2-LFL is not an accumulated product so it will not be regridded.
[DEBUG: 2024-07-05 14:06:18 : satpy.composites.config_loader] Looking for composites config file li.yaml
[DEBUG: 2024-07-05 14:06:18 : satpy.composites.config_loader] Looking for composites config file visir.yaml
[DEBUG: 2024-07-05 14:06:18 : pyorbital.tlefile] Path to the Pyorbital configuration (where e.g. platforms.txt is found): /data/gholl/mambaforge/envs/py312/lib/python3.12/site-packages/pyorbital/etc
[DEBUG: 2024-07-05 14:06:18 : satpy.readers.yaml_reader] No coordinates found for DataID(name='longitude', modifiers=())
[DEBUG: 2024-07-05 14:06:18 : satpy.readers.yaml_reader] No coordinates found for DataID(name='latitude', modifiers=())
[DEBUG: 2024-07-05 14:06:18 : satpy.scene] Resampling DataID(name='flash_duration', modifiers=())
[INFO: 2024-07-05 14:06:18 : satpy.scene] Not reducing data before resampling.
[INFO: 2024-07-05 14:06:18 : satpy.resample] Using default KDTree resampler
Traceback (most recent call last):
  File "/data/gholl/checkouts/protocode/test-li.py", line 10, in <module>
    ls = sc.resample("eurol")
         ^^^^^^^^^^^^^^^^^^^^
  File "/data/gholl/checkouts/satpy/satpy/scene.py", line 977, in resample
    self._resampled_scene(new_scn, destination, resampler=resampler,
  File "/data/gholl/checkouts/satpy/satpy/scene.py", line 893, in _resampled_scene
    res = resample_dataset(dataset, destination_area, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/gholl/checkouts/satpy/satpy/resample.py", line 1073, in resample_dataset
    new_data = resample(source_area, dataset, destination_area, fill_value=fill_value, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/gholl/checkouts/satpy/satpy/resample.py", line 1036, in resample
    res = resampler_instance.resample(data, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/gholl/mambaforge/envs/py312/lib/python3.12/site-packages/pyresample/resampler.py", line 140, in resample
    kwargs['mask'] = data == data.attrs.get('_FillValue', np.iinfo(data.dtype.type).max)
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/gholl/mambaforge/envs/py312/lib/python3.12/site-packages/numpy/_core/getlimits.py", line 697, in __init__
    raise ValueError("Invalid integer data type %r." % (self.kind,))
ValueError: Invalid integer data type 'm'.

Environment Info:

  • Satpy Version: main (v0.49.0-141-g65d28f385)
  • PyResample Version: main (v1.28.4-2-g632901b)

Additional context

It does not depend on the resampler.

It might be caused by this numpy issue, where np.issubdtype("m8", np.integer) returns True, but at the same time a timedelta is invalid (ValueError) to pass to np.iinfo.

numpy/numpy#26861

@gerritholl gerritholl added the bug label Jul 5, 2024
@gerritholl gerritholl changed the title Resampling flash_duration fails Resampling flash_duration fails with a ValueError exception Jul 5, 2024
@gerritholl
Copy link
Collaborator Author

When I search for it in the readers list , I can't find it
ValueError: No reader named: li_l2_nc

Make sure you have the latest satpy and installed necessary dependencies. You can use satpy.available_readers() to check for warnings on missing dependencies.

@markjinz

This comment was marked as off-topic.

@ameraner
Copy link
Member

ameraner commented Jul 11, 2024

Hi @markjinz , I believe your code and error is coming from the Eumetlab jupyter notebooks, which are not maintained here, but rather by the EUM trainer team. Please report issues specific to those notebooks on the according EUM Gitlab. This issue by Gerrit is related to a fully different problem, so let's try not to confuse things:)

@gerritholl
Copy link
Collaborator Author

gerritholl commented Jul 12, 2024

Hi @ameraner , thank you for the clarification but I believe we can discuss all issues related to SATPY here ?!

If you have a satpy question/bug report/feature request that is not the same as this one, please open a new issue using "New issue" button on the top right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants