-
Notifications
You must be signed in to change notification settings - Fork 283
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
Composite snow_age fails (no 'area') after composite cloud_phase #2724
Comments
So is the unsaid part of this issue that if you don't first request What if you do: wanted = 'cloud_phase'
scn.load(["cloud_phase", "snow_age"])
lcn = scn.resample('antarctica')
print(lcn["snow_age"].attrs["area"]) |
That's right, snow_age by itself loads fine, and other composites before snow_age don't provoke the error, but cloud_phase then snow_age fails. Your suggestion does work, and a couple of other rearrangements also work, so it's the example in the original report which is provoking the problem. |
Ok so I'm looking at this on my own machine and you can actually narrow it down to: scn.load(["cloud_phase"])
scn.load(["snow_age"])
print(scn["snow_age"].attrs["area"]) If I add More debugging... |
Whoa...not good: In [9]: scn = Scene(reader="viirs_sdr", filenames=glob("/data/satellite/viirs/conus_day/*t1801*.h5"))
In [10]: scn.load(["M07"])
In [11]: scn.load(["M11"])
In [12]: scn["M11"].attrs["area"]
Out[12]: <pyresample.geometry.SwathDefinition at 0x7f69bd583fe0>
In [13]: scn["M07"].attrs["area"]
Out[13]: <pyresample.geometry.SwathDefinition at 0x7f6a2553ecf0> The swaths are different. |
Ok, the quick workaround is to make sure you load everything at the same time. @pytroll/satpy-core this is a major limitation and unexpected behavior of Satpy. This effects at least h5py-based readers using the HDF5 utils file handler. When it loads data it gets to here: satpy/satpy/readers/hdf5_utils.py Lines 98 to 111 in d3fe3fe
This What happens is that dask's As far as I can tell one solution would be to try to add a |
Awesome deductive powers @djhoese - thanks for the amazingly fast investigation and workaround :-) |
How about putting an lru_cache around that function maybe? so when the same data is requested multiple time, the (same) cached version is returned. |
@mraspaud That may be an option if we're careful. I was initially worried because of the hdf5 objects involved, but it looks like a string |
Describe the bug
Producing the
snow_age
composite after thecloud_phase
composite fails.I am testing with some VIIRS data in .h5 format.
To Reproduce
Expected behavior
Both composites created
Actual results
Environment Info:
The text was updated successfully, but these errors were encountered: