-
Notifications
You must be signed in to change notification settings - Fork 321
Add support for reading pixel_quality ancillary variables, FCI reader no longer logs warnings #1177
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
Conversation
Add a test to ensure that using the FCI reader does not lead to any log messages at warning level or above. Although I expect this test to fail as I haven't fixed pytroll#1171 yet, it is currently failing for the wrong reason as despite running with pytest, it doesn't seem to understand using the caplog fixture.
6998973 to
1503d3c
Compare
Migrate FCI tests to pytest. This enables the more flexible set of fixtures available there. This will be needed by at least one of the tests to be added in pytroll#1177
Merging branches, resolving merge conflict.
In FCI reader, rewrite pixel_quality in get_dataset, such that context about the channel it belongs to is available within the dataset name.
The branch fci-goes-pytest is needed for fci-pixel-quality. Merge this while resolving the merge conflicts.
The ancillary_variables was missing from the fake data in the FCI test, causing a failure in reading channel ir_38. Add attribute for this one too.
Add pixel quality for channel vis_04 for the fci_l1c_fdhsi reader. Currently this leads to recursion errors.
Add pixel quality fields for FCI reading. This currently relies on a small hack rewriting the ancillary_variables fields, because the data variable pixel_quality has the same name in different groups, and Satpy doesn't currently have a good way of keeping track of what group this belongs to. Fixes 1171.
Add documentation and warning about reading pixel quality from FCI files.
Codecov Report
@@ Coverage Diff @@
## master #1177 +/- ##
==========================================
+ Coverage 89.61% 89.67% +0.05%
==========================================
Files 200 200
Lines 29523 29722 +199
==========================================
+ Hits 26458 26654 +196
- Misses 3065 3068 +3
Continue to review full report at Codecov.
|
Improve test coverage in FCI reader, covering various "bad data" cases that weren't covered before.
mraspaud
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the pixel quality datasets, it'll be crucial for the validation of the data when the satellite launches. I just have a couple of style suggestions, otherwise LGTM.
As per comments from @mraspaud, reformulate some error messages in the FCI L1C FDHSI file handler.
djhoese
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks overall good to me. I had one comment inline about handling the ancillary_variables attribute, but one other point that I think @mraspaud made on slack over somewhere: What do you think about using available_datasets in the file handler to define these new datasets instead of listing them in the YAML?
I am also not a huge fan of sensor: being defined for each dataset. I feel like that should come from the file handler.
Rewrite the ancillare_variables pixel_quality value more flexibly, allowing for multiple variables to be listed here.
|
Sorry, didn't notice until now you'd left comments here. There seem to be many readers defining What is the advantage of |
Yes. You could also see it as the YAML helps us define things that aren't known from reading the file. For example, the wavelengths of a band are normally in the YAML because they aren't defined in the data files. I think defining the datasets you have in YAML is fine since you've already done it, but |
Add support for reading pixel quality, closing #1171
Read pixel quality ancillary variables. This is done with a small hack, because the data variables have the same name in each group, so Satpy doesn't know where to look when simply told to look for
pixel_quality. This may change later when dynamic dataset ids are introduced (see #1088) but so far this is not supported. Therefore, when reading the parent variable, the filehandler rewrites theancillary_variablesvariable attribute to prepend the channel name, such that when the same filehandler is called a little later for the variable name, it knows where to find it. See also the discussion in #1171.flake8 satpy