pytroll / satpy

Python package for earth-observing satellite data processing
http://satpy.readthedocs.org/en/latest/
GNU General Public License v3.0
1.08k stars 298 forks source link

Mcd12q1 draft #2905

Closed pdebuyl closed 2 months ago

pdebuyl commented 2 months ago

Add a reader for MODIS L3 data on the 500 sinusoidal grid. Data supported now is MCD12Q1.

The reader has a test using the create_hdfeos_test_file fixture as other MODIS tests do.

For information, I used this to create a resampled land cover type at a coarser resolution. I can provide an example program if there is interest. The MODIS grid is described here: https://modis-land.gsfc.nasa.gov/MODLAND_grid.html

pdebuyl commented 2 months ago

PS: in principle, I could add it to the MODIS L3 reader but it supported only the CMG grid so far, so I don't know if it is better to extend support in the existing modis_l3.py file or more simply by adding the class MCD12Q1HDFFileHandler that I added as an additional class in the MODIS L3 reader file. The yaml could point to the different classes for the different file types.

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 10940136250

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
satpy/readers/hdfeos_base.py 5 6 83.33%
satpy/readers/mcd12q1.py 43 51 84.31%
<!-- Total: 99 108 91.67% -->
Totals Coverage Status
Change from base Build 10884783684: -0.01%
Covered Lines: 52555
Relevant Lines: 54654

💛 - Coveralls
codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 91.50943% with 9 lines in your changes missing coverage. Please review.

Project coverage is 96.06%. Comparing base (5e27be4) to head (9e3b342). Report is 133 commits behind head on main.

Files with missing lines Patch % Lines
satpy/readers/mcd12q1.py 84.00% 8 Missing :warning:
satpy/readers/hdfeos_base.py 83.33% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2905 +/- ## ======================================== Coverage 96.05% 96.06% ======================================== Files 370 373 +3 Lines 54320 54465 +145 ======================================== + Hits 52177 52321 +144 - Misses 2143 2144 +1 ``` | [Flag](https://app.codecov.io/gh/pytroll/satpy/pull/2905/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | Coverage Δ | | |---|---|---| | [behaviourtests](https://app.codecov.io/gh/pytroll/satpy/pull/2905/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | `3.98% <0.00%> (-0.02%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/pytroll/satpy/pull/2905/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | `96.15% <91.50%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

pdebuyl commented 2 months ago

Only a low score for codecov remaining. I find it hard to add another test for which the type of grid attribute would differ just for the sake of coverage. Is this ok?

I could remove the lines here: https://app.codecov.io/gh/pytroll/satpy/pull/2905/blob/satpy/readers/mcd12q1.py#L84 that don't seem necessary given that I put all of the variables in the YAML file.

mraspaud commented 2 months ago

Coverage is good enough, thanks for adding this reader!

pdebuyl commented 2 months ago

Thanks for reviewing! I prefer to have the code in the main branch of course :-)