Closed frandorr closed 2 months ago
Thanks for filing a bug. This error surprises me. I believe the default DataID
configuration is to include the calibration even if non-existent in the definition and is (I think) supposed to be set to None
. @mraspaud That's what this means, right:
Maybe a possible fix is changing key["calibration"] == "reflectance"
to key.get("calibration") == "reflectance"
in abi_l2_nc.py
to avoid having problems if "calibration" key doesn't exist?
The other question on my mind is why the tests aren't failing. The tests (if done correctly) should be doing the same kind of operations and shouldn't be patching/mocking any DataID stuff...hopefully.
Ah the tests may not be testing this completely. Also I don't see this issue with other file types that I normally use like when I get the HT and TEMP variables since their units are not "1"
and therefore don't go to the second half of the if
statement.
I was able to reproduce this with an ACM file and loading the BCM variable (which has units of 1). @frandorr Your fix makes sense to me. Do you think you could make a pull request and update the unit tests to make sure it works?
Sure, I'll try to make it next week.
@frandorr Any updates on your available time to make a PR for this?
I created #2794 for this.
Sorry, I didn't find the time to work on it
No problem. It happens. And I just knew I didn't have time at that moment so was glad someone else might get to it. At least you found it. That's a major step.
Describe the bug When attempting to load the "Mask" dataset from an L2 FDCF product using Satpy, the process fails with a KeyError related to the 'calibration' key during the dataset reading phase. This issue occurs despite following the typical procedure for loading datasets with Satpy. The expected behavior is for the mask dataset to be loaded without errors, but instead, an error is thrown indicating that the 'calibration' key is missing, which suggests there might be a missing or incorrect configuration in the Satpy reader or the dataset itself does not contain the expected information.
Current workaround to load the Mask Modify abi_l2_nc.yaml file. Add a dummy calibration to the Mask part:
To Reproduce
Expected behavior Load mask dataset from the l2 FDCF product.
Actual results
Environment Info: