-
Notifications
You must be signed in to change notification settings - Fork 295
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 10612737912Details
💛 - Coveralls |
There was a problem hiding this 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
@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"] | ||
|
There was a problem hiding this comment.
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?
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
orBoth
) and the starting plus ending orbital direction (Ascending
orDescending
). I also added a test to make sure the attrs are being read.