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 on-the-fly decompression to the AHI HSD reader #984

Merged
merged 20 commits into from
Dec 10, 2019
Merged

Add on-the-fly decompression to the AHI HSD reader #984

merged 20 commits into from
Dec 10, 2019

Conversation

simonrp84
Copy link
Member

@simonrp84 simonrp84 commented Nov 28, 2019

The HSD format data from Himawari/AHI typically comes in individual files compressed with bzip2.
At present, satpy requires these files to be decompressed before passing them to the Scene function. This PR enables on-the-fly decompression (using the same method as for the PPS files).

I also replaced one unit test function (assertDictContainsSubset) that is deprecated.

  • Tests added and test suite added to parent suite
  • Tests passed
  • Passes flake8 satpy

Copy link
Member

@mraspaud mraspaud left a 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 quick fix. I just have one small suggestion.

satpy/tests/reader_tests/test_ahi_hsd.py Outdated Show resolved Hide resolved
@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 86.872% when pulling 4d8baff on simonrp84:add-hsd-bz2 into 177d150 on pytroll:master.

@coveralls
Copy link

coveralls commented Nov 28, 2019

Coverage Status

Coverage increased (+0.2%) to 87.029% when pulling 3ee27b5 on simonrp84:add-hsd-bz2 into 177d150 on pytroll:master.

@codecov
Copy link

codecov bot commented Nov 28, 2019

Codecov Report

Merging #984 into master will increase coverage by 0.16%.
The diff coverage is 86.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #984      +/-   ##
==========================================
+ Coverage   86.86%   87.02%   +0.16%     
==========================================
  Files         181      181              
  Lines       27461    27607     +146     
==========================================
+ Hits        23854    24026     +172     
+ Misses       3607     3581      -26
Impacted Files Coverage Δ
satpy/tests/reader_tests/test_ahi_hsd.py 97.93% <100%> (+0.1%) ⬆️
satpy/readers/utils.py 79.56% <69.69%> (+4.32%) ⬆️
satpy/readers/ahi_hsd.py 96.58% <90%> (-0.31%) ⬇️
satpy/tests/reader_tests/test_utils.py 97.84% <97.22%> (+18.14%) ⬆️
satpy/readers/avhrr_l1b_gaclac.py 94.59% <0%> (-0.26%) ⬇️
satpy/readers/goes_imager_hrit.py 84.86% <0%> (ø) ⬆️
satpy/readers/_geos_area.py 100% <0%> (ø) ⬆️
satpy/readers/nwcsaf_msg2013_hdf5.py 96.1% <0%> (ø) ⬆️
satpy/readers/nucaps.py 93.71% <0%> (ø) ⬆️
satpy/readers/electrol_hrit.py 91.6% <0%> (ø) ⬆️
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 177d150...3ee27b5. Read the comment docs.

@simonrp84
Copy link
Member Author

Note: This is NOT ready yet. Have discovered that the temp files are not being deleted. Will add + test a fix today.

@mraspaud mraspaud added component:readers enhancement code enhancements, features, improvements labels Dec 2, 2019
…2 if it is available on the system (much faster than bz2 for decompression).
… which(). Also simplify the code a little bit.
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two print statements should be changed to logging, otherwise it looks good! Thanks for making the effort to keep python2 compatibility.

satpy/readers/utils.py Outdated Show resolved Hide resolved
satpy/readers/utils.py Outdated Show resolved Hide resolved
@mraspaud
Copy link
Member

mraspaud commented Dec 6, 2019

This is still not ready to merge. @simonrp84 will add a test for the unzipping tool.

@pnuu pnuu merged commit a0844ed into pytroll:master Dec 10, 2019
@simonrp84 simonrp84 deleted the add-hsd-bz2 branch December 10, 2019 15:59
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.

5 participants