-
Notifications
You must be signed in to change notification settings - Fork 301
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
add support of masking olci l1b products by using quality flags #2687
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2687 +/- ##
=======================================
Coverage 95.98% 95.98%
=======================================
Files 368 368
Lines 53798 53852 +54
=======================================
+ Hits 51639 51692 +53
- Misses 2159 2160 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 7212041175Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 - Coveralls |
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.
I won't pretend to understand everything that's going on here, but I had a couple questions and suggestions to start with.
"""Init the file handler.""" | ||
super().__init__(filename, filename_info, filetype_info, engine) | ||
self.cal = cal.nc | ||
if cal is not None: |
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.
In what conditions is cal
None? Should this be required (but keep it as a kwarg for consistency) and raise an error if it is None?
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.
The cal
will be None
when loading mask
into the scene. In that case, that is alright since we only care about the mask_items
.
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.
I don't know enough about this reader to have the final say, I think @mraspaud should do that. This looks good enough to me though.
mocked_dataset.return_value = xr.Dataset({"quality_flags": (["rows", "columns"], | ||
np.array([1 << (x % 32) for x in range(35)]).reshape(5, 7))}, | ||
coords={"rows": np.arange(5), | ||
"columns": np.arange(7)}) | ||
ds_id = make_dataid(name="mask") | ||
filename_info = {"mission_id": "S3A", "dataset_name": "mask", "start_time": 0, "end_time": 0} | ||
test = NCOLCI1B("somedir/somefile.nc", filename_info, "c") |
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.
Depending on how bored you are, you could change this to not using mocking but instead create a real file on disk. I realize you're just copying what was here before which is why I won't push it.
Thanks Dave. |
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.
@yufeizhu600 I made an attempt at merging your changes with main, let's see how the tests go. If they pass I'm happy and I'll merge.
Pull Request Test Coverage Report for Build 10107490696Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
This PR added support of using the quality flags from the qualityFlags.nc file to mask the OCLI L1b products, similar as using wqsf file masking OLCI L2 products.