-
Notifications
You must be signed in to change notification settings - Fork 303
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 LI L2 reader #2271
Add LI L2 reader #2271
Conversation
The tests are failing with
at line https://github.com/pytroll/satpy/pull/2271/files#diff-3b2bff08b4001ec6f72cca67791cc4322b38e0db97e68f2109791093e56e6052R595 It seems a regression of xarray, since the tests are passing e.g. with xarray-2022.3.0, but failing with 2022.11.0 and the current xarray master. |
No this isn't related to my stuff at all. Did this work in the past? Why do you need to provide the indexes from the base DataArray? |
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.
Some preliminary comments. Also, CodeScene makes good points
lon, lat = da.map_blocks(self.inverse_projection, azimuth, elevation, proj_dict, | ||
chunks=(2, azimuth.shape[0]), | ||
meta=np.array((), dtype=azimuth.dtype), | ||
dtype=azimuth.dtype, | ||
) |
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.
don't we already have this implemented somewhere ? In pyresample maybe?
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 code was inspired by this code snippet here https://github.com/pytroll/pyresample/blob/952cec6ee4bce55bb70f2c1237401356645bc3f6/pyresample/geometry.py#L2434-L2441, that is encapsulated in get_lonlats
of AreaDefinition
. As in the end it's only a simple map_blocks
call, I would propose to leave it like this, if you agree.
Codecov Report
@@ Coverage Diff @@
## main #2271 +/- ##
==========================================
+ Coverage 94.32% 94.56% +0.24%
==========================================
Files 308 313 +5
Lines 46168 47425 +1257
==========================================
+ Hits 43546 44849 +1303
+ Misses 2622 2576 -46
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
…r class call in `li_base_nc.py`; Remove `get_area_definition()` and `get_bounding_box()` overriding in `li_base_nc.py`.
Sorry @djhoese, I just noticed that the code formatting in my comment swallowed the first line (edited now), which somehow points to a But the issue seems actually to be in the passing of the More info on the |
…called_on_non_accum_dataset` and `TestLIL2.test_generate_coords_not_called_on_non_coord_dataset`
…or_variable` and `TestLIL2._test_dataset_single_variable`
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.
LGTM
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.
a small request to maybe define a new constant in order to avoid hard coding 5568
in various places in the code.
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.
…te_array_dimensions
… are already provided
…ndling of index_offsets
So we added some new tests to improve coverage (now we're at 100% for both the reader files 🙂). Also most CodeScene comments were addressed, the few remaining ones complain about the tests setup file, that contains the mocked files structures... I don't think it makes sense to improve this further. |
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.
LGTM!
Thank you everyone who contributed, either as a reviewer or helping me to understand Satpy and its coding style :) |
Add LI L2 reader and remove the old code as it's obsolete.
The reader handles both, LI L2 point products (LI-LE, LI-LEF, LI-LGR, LI-LFL) and LI L2 accumulated products (LI-AF, LI-AFR, LI-AFA). For the accumulated products, the reader supports the output as a gridded product. This can be activated by adding the reader kwarg
with_area_definition=True
.li_l2
-reader to read MTG LI L2 test data #2213AUTHORS.md
if not there already