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

Use HSD blocklengths rather than assumed size #694

Merged
merged 11 commits into from
Apr 8, 2019
Merged

Use HSD blocklengths rather than assumed size #694

merged 11 commits into from
Apr 8, 2019

Conversation

simonrp84
Copy link
Member

@simonrp84 simonrp84 commented Apr 4, 2019

Previously, the AHI HSD reader navigated through a data file by using assumed-length headers. However, these headers contain descriptors that give the actual length of the header. This PR uses these descriptors to ensure that we always navigate to the correct position in the file (using file.seek) rather than just assuming that each header is always of a certain size.

  • Tests added
  • Tests passed
  • Passes git diff origin/master -- "*py" | flake8 --diff

…he file header, rather than relying on fixed length headers.
@simonrp84
Copy link
Member Author

I also added myself to the Authors list (both in the python file and in AUTHORS.md). Happy to remove that if it's not appropriate.

@codecov
Copy link

codecov bot commented Apr 4, 2019

Codecov Report

Merging #694 into master will increase coverage by 0.5%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #694     +/-   ##
=========================================
+ Coverage   79.05%   79.56%   +0.5%     
=========================================
  Files         140      145      +5     
  Lines       20802    21176    +374     
=========================================
+ Hits        16446    16849    +403     
+ Misses       4356     4327     -29
Impacted Files Coverage Δ
satpy/readers/ahi_hsd.py 96.87% <100%> (+23.57%) ⬆️
satpy/tests/reader_tests/test_ahi_hsd.py 97.54% <100%> (+0.87%) ⬆️
satpy/readers/goes_imager_nc.py 65.73% <0%> (ø) ⬆️
satpy/readers/yaml_reader.py 92.3% <0%> (ø) ⬆️
satpy/readers/hdf5_utils.py 92.3% <0%> (ø) ⬆️
satpy/readers/virr_l1b.py 98.27% <0%> (ø)
satpy/demo/__init__.py 95.45% <0%> (ø)
satpy/demo/google_cloud_platform.py 95% <0%> (ø)
satpy/tests/reader_tests/test_virr_l1b.py 97.19% <0%> (ø)
satpy/tests/test_demo.py 93.84% <0%> (ø)
... and 3 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 4e23523...24cb0aa. Read the comment docs.

@coveralls
Copy link

coveralls commented Apr 4, 2019

Coverage Status

Coverage increased (+0.5%) to 79.562% when pulling 24cb0aa on simonrp84:Him_Blocksize into 4e23523 on pytroll:master.

@mraspaud
Copy link
Member

mraspaud commented Apr 4, 2019

Nice! As extra security, it would be nice if we could issue a warning when the blocklength doesn't match the size of the dtype we are using to read. Could you add that ?

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

@mraspaud mraspaud merged commit bc2e170 into pytroll:master Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants