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

Unexpected floats when reading LI L2 LFL data #2854

Open
gerritholl opened this issue Jul 10, 2024 · 1 comment
Open

Unexpected floats when reading LI L2 LFL data #2854

gerritholl opened this issue Jul 10, 2024 · 1 comment

Comments

@gerritholl
Copy link
Collaborator

Describe the bug

When reading LI L2 LFL data, several datasets are returned as floats when they should be integers.

To Reproduce

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

fn = "/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_20240701105944_L2PF_OPE_20240701105923_20240701105933_N__T_0066_0057.nc"
sc = Scene(filenames=[fn], reader="li_l2_nc")
sc.load(["flash_id"])
print(sc["flash_id"].dtype)

Expected behavior

I expect an integer dtype.

Actual results

I get float64.

[DEBUG: 2024-07-10 16:42:30 : satpy.readers.yaml_reader] Reading ('/data/gholl/checkouts/satpy/satpy/etc/readers/li_l2_nc.yaml',)
[DEBUG: 2024-07-10 16:42:30 : 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_20240701105944_L2PF_OPE_20240701105923_20240701105933_N__T_0066_0057.nc']
[DEBUG: 2024-07-10 16:42:30 : satpy.readers.li_base_nc] Product type is: 2-LFL
[DEBUG: 2024-07-10 16:42:30 : satpy.readers.li_base_nc] Adding 12 datasets for 2-LFL input product.
[DEBUG: 2024-07-10 16:42:30 : satpy.readers.li_l2_nc] The current product 2-LFL is not an accumulated product so it will not be regridded.
[DEBUG: 2024-07-10 16:42:30 : satpy.composites.config_loader] Looking for composites config file li.yaml
[DEBUG: 2024-07-10 16:42:30 : satpy.composites.config_loader] Looking for composites config file visir.yaml
[DEBUG: 2024-07-10 16:42:30 : 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-10 16:42:31 : satpy.readers.yaml_reader] No coordinates found for DataID(name='longitude', modifiers=())
[DEBUG: 2024-07-10 16:42:31 : satpy.readers.yaml_reader] No coordinates found for DataID(name='latitude', modifiers=())
float64

Environment Info:

  • OS: [e.g. OSX, Windows, Linux]
  • Satpy Version: main (v0.49.0-156-g3a742c297)

Additional context

The same for other integer variables in the dataset.

Sometimes this happens when a fill value is defined in the variable attributes, but that is not the case here:

	uint flash_id(flashes) ;
		flash_id:_Unsigned = "true" ;
		flash_id:long_name = "LI L2 Flash IDs" ;
@mraspaud
Copy link
Member

@ameraner ^

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

No branches or pull requests

2 participants