Skip to content
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 helper-function for reading SEVIRI L1.5 Native header. #2480

Merged
merged 7 commits into from
May 16, 2023

Conversation

sjoro
Copy link
Collaborator

@sjoro sjoro commented May 15, 2023

This PR introduces a helper function read_header in seviri_l1b_native-module. A need for this arises from EUM Helpdesk user inquiries, occurring every now and then, for asking how to read or get the header of the file for checking that their implementations in another software is correct.

The usage of the new feature is very simple:

from satpy.readers.seviri_l1b_native import read_header
hdr = read_header('MSG4-SEVI-MSG15-0100-NA-20210302124244.185000000Z-NA.nat')
print(hdr['15_DATA_HEADER']['SatelliteStatus']['SatelliteDefinition'])
  • Tests added
  • Fully documented

@codecov
Copy link

codecov bot commented May 15, 2023

Codecov Report

Merging #2480 (0ae0b78) into main (bc9c089) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2480   +/-   ##
=======================================
  Coverage   94.82%   94.83%           
=======================================
  Files         337      337           
  Lines       49406    49421   +15     
=======================================
+ Hits        46851    46866   +15     
  Misses       2555     2555           
Flag Coverage Δ
behaviourtests 4.43% <0.00%> (-0.01%) ⬇️
unittests 95.45% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
satpy/enhancements/__init__.py 99.03% <ø> (ø)
satpy/readers/seviri_l1b_native.py 86.50% <100.00%> (+0.10%) ⬆️
satpy/tests/reader_tests/test_seviri_l1b_native.py 100.00% <100.00%> (ø)

@coveralls
Copy link

coveralls commented May 15, 2023

Pull Request Test Coverage Report for Build 4992633853

  • 36 of 36 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 95.399%

Totals Coverage Status
Change from base Build 4960323333: 0.001%
Covered Lines: 46979
Relevant Lines: 49245

💛 - Coveralls

@sjoro sjoro marked this pull request as ready for review May 15, 2023 13:07
@djhoese djhoese added enhancement code enhancements, features, improvements component:readers labels May 15, 2023
@sjoro
Copy link
Collaborator Author

sjoro commented May 16, 2023

any suggestions on what's going on with the docs build? this seems to be an issue which arose when i merged the latest main to my branch.

@djhoese
Copy link
Member

djhoese commented May 16, 2023

/home/docs/checkouts/readthedocs.org/user_builds/satpy/conda/2480/lib/python3.10/site-packages/satpy/enhancements/__init__.py:docstring of satpy.enhancements._jma_true_color_reproduction:6: ERROR: Unexpected indentation.
/home/docs/checkouts/readthedocs.org/user_builds/satpy/conda/2480/lib/python3.10/site-packages/satpy/enhancements/__init__.py:docstring of satpy.enhancements._jma_true_color_reproduction:7: WARNING: Block quote ends without a blank line; unexpected unindent.

I'll see if I can recommend a fix. One sec...

@djhoese
Copy link
Member

djhoese commented May 16, 2023

Docs are fixed now 😉

@djhoese djhoese merged commit a5338d1 into pytroll:main May 16, 2023
16 checks passed
@djhoese
Copy link
Member

djhoese commented May 16, 2023

I probably should have asked you before merging this, but I got impatient because now I need these doc fixes. Hopefully this PR was ready enough.

@sjoro sjoro deleted the read-native-header branch May 17, 2023 06:20
@sjoro
Copy link
Collaborator Author

sjoro commented May 17, 2023

it is/was for me, unless the implementation should have been preferred done in some other way... e.g. using staticmethods in NativeMSGFileHandler and then at the end of the module do something like read_header = NativeMSGFileHandler.read_header

@sfinkens
Copy link
Member

Nice feature, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:readers enhancement code enhancements, features, improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants