-
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
Adapt the SEVIRI native format reader in Satpy to support remote reading #2863
Adapt the SEVIRI native format reader in Satpy to support remote reading #2863
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2863 +/- ##
==========================================
+ Coverage 95.99% 96.03% +0.04%
==========================================
Files 368 368
Lines 53985 54057 +72
==========================================
+ Hits 51821 51914 +93
+ Misses 2164 2143 -21
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 10382915666Details
💛 - 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.
Very nice so far, it's really good to have an actual file to test the reader on now.
ea8524e
to
455d4a8
Compare
Nice work, thanks a lot! Can you please update the |
Thanks. Yes, I just did that! |
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, just a question on the lazyness when switching from memmap to frombuffer.
2b9eca8
to
9fc2a05
Compare
This function uses `readers.utils.generic_open()` and `np.frombuffer()` to achieve this.
In particular, the following functions/methods have been modified: - `has_archive_header()` now uses `readers.utils.generic_open()` instead of `open()`. - `read_header()` now uses `readers.utils.fromfile()` instead of `np.formfile()`. - `NativeMSGFileHandler._read_trailer()` now uses `readers.utils.fromfile()` instead of `np.formfile()`. - `NativeMSGFileHandler._get_memmap()` has been renamed to `NativeMSGFileHandler._get_array()` and now uses `readers.utils.fromfile()` instead of `np.memmap()`.
Reason: since `NativeMSGFileHandler._get_memmap()` has been renamed to `NativeMSGFileHandler._get_array()`.
…n `seviri_l1b_native`
This includes generating an actual file on disk and attempt to read it.
… well as plain files
This concerns `test_read_physical_seviri_nat_file()`.
This is to ensure that the remote reading tests can also run on Windows. Note: `fsspec` expects a POSIX path.
…unknown marks We do not need these marks anymore, as we decreased the size of the generated seviri native file. As a result, the tests now run fast enough.
This warning is totally benign. It is caused as a result of the seviri native file that we create which is essentially filled with zeros.
The issue was an unexpected indentation on the last line of the docstring!
This includes: - Extracting the `_get_array()` method so that it is now a function in the module and not a class method. - Introduction of `NativeMSGFileHandler_make_dask_array_with_map_blocks()` method to utilize the dask `map_blocks()`. - Introduction of a new method, namely `NativeMSGFileHandler._number_of_visir_channels` to facilitate testing and mock patching. - Adapting the mock patches in tests accordingly.
9fc2a05
to
80f3925
Compare
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, thanks for the updates!
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.
As much as I understand of this, it looks good enough to me. Thanks for putting all this work into it.
Oh CodeScene doesn't like how long the test module is. Any chance things can be refactored? |
Yes, we talked about this, and decided it was a job for another PR, as what would make the module smaller it so redo the mocking tests into tests using the actual file. |
This PR adds a feature to Satpy to allow for reading SEVIRI native format files remotely. It relies on the fsspec package.
AUTHORS.md
if not there already