satpy icon indicating copy to clipboard operation
satpy copied to clipboard

RuntimeError: NetCDF: Not a valid ID ONLY for FCI data

Open akasom89 opened this issue 1 year ago • 6 comments

Hi,

I have several scripts that have been working well with various geostationary satellites. However, after adding FCI data (which became operational and accessible to all users 10 days ago), I encountered a RuntimeError: NetCDF: Not a valid ID.

Does FCI data need to be read or processed in a way that is different from other satellites? Are there any special considerations for its usage?

I could not find any specific/different instruction for FCI in documentation.

akasom89 avatar Dec 14 '24 07:12 akasom89

Hi @akasom89, are you resampling the data? In that case you cannot overwrite the Scene object and need to do either scn_r = scn.resample() or

scn_org = scn
scn = scn.resample()

where the latter lets you preserve the variable name.

You can find more details in #1861

strandgren avatar Dec 14 '24 09:12 strandgren

Thanks @strandgren

Yes. I am using a new variable name.

My function ends in a similar way to below :

scn2 = scn.resample()
scn2['product'] = product_dataarray
return scn2

akasom89 avatar Dec 14 '24 10:12 akasom89

Based on https://github.com/pytroll/satpy/issues/1861#issuecomment-949695451 : 1-file handlers are in scn and when the function ends, this is garbage cleaned? 2-this is the case only with FCI? I mean non of other even still netcdf formatted images (like goes and gk2a) does not have the same mechanism?

akasom89 avatar Dec 14 '24 10:12 akasom89

@akasom89 So even if you use a different variable name, you get this error?

As mentioned in https://github.com/pytroll/satpy/issues/1861#issuecomment-950739628 it's not an issue directly related to FCI, but rather the NetCDF4FileHandler which is used to read the FCI data.

strandgren avatar Dec 16 '24 09:12 strandgren

Yes @strandgren. I get this error even when i am using a different variable name.

I thought based on what @gerritholl mentioned, I should find a way to return both scn and scn2 simultaneously, but i have not find any idea since now.

akasom89 avatar Dec 16 '24 12:12 akasom89

@akasom89 Did you find a solution to this?

One thing that comes to my mind is that the FCI data that comes via Eumetcast is compressed wtih som special compression.

To make satpy able to handle these files directy, you need to import hdf5plugin before you import the satpy Scene.

Like

import hdf5plugin
from satpy.scene import Scene

of cource you need to install the hdf5plugin from eg conda-forge first.

TAlonglong avatar May 15 '25 12:05 TAlonglong