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 reader for IASI EPS L2 native format #2457

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

gerritholl
Copy link
Collaborator

@gerritholl gerritholl commented Apr 28, 2023

Add a reader for IASI EPS L2 native format "IASI Combined Sounding Products - Metop". The data are available in the EUMETSAT Data Store. User manuals, product description, and more information are available at https://data.eumetsat.int/product/EO:EUM:DAT:METOP:IASSND02.

The core of the reader is copied from the IASI L2 EPS reader from the EUMETSAT package epct_plugin_gis. I adapted this to make it dask-friendly and to integrate it as a Satpy reader. Specifically, the code was obtained from https://gitlab.eumetsat.int/open-source/data-tailor-plugins/epct_plugin_gis where it is licensed under the Apache License Version 2.0, January 2004. It was developed by B-Open Solutions srl for EUMETSAT under contract EUM/C0/17/4600001943/0PN and is Copyright (c) 2017-2022 EUMETSAT. To the best of my knowledge, the Apache License allows for its integration into GPL code.

Status: Code seems to work with memory maps and dask, but overhead remains large. Tests need to run faster, run independently of downloading large data files, and cover non-nominal cases.

  • Make lazy and dask-friendly
  • Make tests run faster and make them not depend on downloading and processing a large file
  • Improve test coverage
  • Cleanup the code and the PR in general
  • Closes #xxxx
  • Tests added
  • Fully documented

Started refactoring the AVHRR L1b EPS reader in preparation for the
IASI L2 EPS reader.  Replaced the wrong XML format definition by the
correct one.

Source for the EPS IASI L2 format definition is eugene.  After
installing eugene with ``mamba install -c eumetsat eugene``, I found the
definition file at ``envs/py311/share/eugene/formats/eps_iasil2_9.0.xml``.
@codecov
Copy link

codecov bot commented Apr 28, 2023

Codecov Report

Merging #2457 (54c6826) into main (18288df) will increase coverage by 0.05%.
Report is 112 commits behind head on main.
The diff coverage is 98.23%.

@@            Coverage Diff             @@
##             main    #2457      +/-   ##
==========================================
+ Coverage   94.91%   94.96%   +0.05%     
==========================================
  Files         349      353       +4     
  Lines       50969    51836     +867     
==========================================
+ Hits        48375    49225     +850     
- Misses       2594     2611      +17     
Flag Coverage Δ
behaviourtests 4.24% <0.00%> (-0.08%) ⬇️
unittests 95.55% <98.23%> (+0.04%) ⬆️

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

Files Changed Coverage Δ
satpy/readers/iasi_l2_eps.py 97.06% <97.06%> (ø)
satpy/readers/epsnative_reader.py 99.14% <99.14%> (ø)
satpy/tests/reader_tests/conftest.py 100.00% <100.00%> (ø)
satpy/tests/reader_tests/test_epsnative_reader.py 100.00% <100.00%> (ø)
satpy/tests/reader_tests/test_iasisnd02.py 100.00% <100.00%> (ø)

... and 11 files with indirect coverage changes

@gerritholl gerritholl self-assigned this May 23, 2023
@gerritholl
Copy link
Collaborator Author

Putting this on hold as I've decided to use the Data Tailor and then read the output from there. See #2518

For the XML format specification, add missing type configurations to
xmlformat.py.  Also uncomment parameter definitions from the XML
definition, which are needed to interpret the rest of the file.  I don't
know why those were commented out.
Change the distribution of responsibility between EPSBaseFileHandler and
EPSAVHRRFile.  Added a tests for xmlformat.process_array.
In xmlformat, collect a mapping of variable names against dimension names.
Turn xmlformat.parse_format from a module level function to a method on
XMLFormat.  Remove the module level dictionary VARIABLES and make this
an instance attribute on the XMLFormat class.
@gerritholl
Copy link
Collaborator Author

Take the IASI L2 EPS reader from EUMETSAT and integrate into Satpy.
The code was obtained from
https://gitlab.eumetsat.int/open-source/data-tailor-plugins/epct_plugin_gis
where it is licensed under the Apache License Version 2.0, January 2004.
It was developed by B-Open Solutions srl for EUMETSAT under contract
EUM/C0/17/4600001943/0PN and is Copyright (c) 2017-2022 EUMETSAT.
To the best of my knowledge, the Apache License allows for its
integration into GPL code.
@gerritholl gerritholl removed the wontfix label Jul 6, 2023
@gerritholl
Copy link
Collaborator Author

Sadly, when I use the new XML file with the reading routine for EPS AVHRR native, the result is completely wrong (binary garbage with the record lengths not matching).

Prior to speeding up the reading, improve tests to test actual values to
be read.
When reading grh, support interpreting a memmap.
satpy/tests/conftest.py Outdated Show resolved Hide resolved
Remove more dead code and change the sample data used for
test_eps_native_reader.  Change the expected results accordilgny.
In the dynamic available datasets for the iasil2snd reader, don't add
coordinates to variables that don't have corresponding dimensions.
Add safeguards in the IASI native reader to avoid going into infinite
loops
Remove implementation attempts that didn't work, restoring those files.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 5953974235

  • 667 of 679 (98.23%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 95.507%

Changes Missing Coverage Covered Lines Changed/Added Lines %
satpy/readers/epsnative_reader.py 116 117 99.15%
satpy/readers/iasi_l2_eps.py 364 375 97.07%
Totals Coverage Status
Change from base Build 5939673825: 0.04%
Covered Lines: 49338
Relevant Lines: 51659

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants