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

Update VIIRS L1b reader to use additional netcdf attributes #2891

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

simonrp84
Copy link
Member

@simonrp84 simonrp84 commented Aug 29, 2024

The VIIRS L1b reader (NASA format VIIRS data) misses some netCDF attributes that may be useful to users.
This PR adds those attributes: The day/night flag (Day, Night or Both) and the starting plus ending orbital direction (Ascending or Descending). I also added a test to make sure the attrs are being read.

  • Tests added

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.07%. Comparing base (5e27be4) to head (280ebd6).
Report is 67 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2891      +/-   ##
==========================================
+ Coverage   96.05%   96.07%   +0.01%     
==========================================
  Files         370      370              
  Lines       54320    54332      +12     
==========================================
+ Hits        52177    52197      +20     
+ Misses       2143     2135       -8     
Flag Coverage Δ
behaviourtests 3.99% <0.00%> (-0.01%) ⬇️
unittests 96.16% <100.00%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 10612737912

Details

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

Totals Coverage Status
Change from base Build 10528275069: 0.02%
Covered Lines: 52428
Relevant Lines: 54518

💛 - Coveralls

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

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

While I'm fine with this as a short term solution, I think this is yet another case of the readers maybe being too restrictive/inflexible for what some users really want. Or rather, it forces us to draw the line on what satpy readers really are. Are they generic readers that provide all the information from the files in a semi-standard way? Or do they provide only the information that is shared between all (most) Satpy readers (the data + common metadata)?

Side question: Should the orbit information go in an orbital_parameters sub-dictionary like we do for lon/lat/alt information: https://satpy.readthedocs.io/en/stable/reading.html#orbital-parameters

Comment on lines +37 to +51
@property
def day_night_flag(self):
"""Get the day/night flag."""
return self["/attr/DayNightFlag"]

@property
def start_direction(self):
"""Get the swath start direction flag."""
return self["/attr/startDirection"]

@property
def end_direction(self):
"""Get the swath end direction flag."""
return self["/attr/endDirection"]

Copy link
Member

Choose a reason for hiding this comment

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

I don't see a reason for these to be properties on the class. Could you change this to just access self["/attr/endDirection"] (and the others) directly in the get_metadata method?

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.

3 participants