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
Only add longitude/latitude variables in cf_writer if they are not included already. #1357
Conversation
Level1c4pps ended up with both lat/lon and latitude/longitude coordinates.
Codecov Report
@@ Coverage Diff @@
## master #1357 +/- ##
==========================================
+ Coverage 90.46% 90.48% +0.01%
==========================================
Files 228 228
Lines 33211 33269 +58
==========================================
+ Hits 30045 30103 +58
Misses 3166 3166
Continue to review full report at Codecov.
|
satpy/writers/cf_writer.py
Outdated
'standard_name': "latitude", | ||
'units': 'degrees_north'}, | ||
name='latitude') | ||
if ('lat' in dataarray and 'lon' in dataarray) or ('latitude' in dataarray and 'longitude' in dataarray): |
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.
To make this clearer, could we have if ('lat' in dataarray.coords and...
?
@ninahakansson Thanks for adding this. Do you know where the |
The lat/lon is from level1c4pps and from PPS. So in one way they do not belong here I guess. We have the include_lonlats attribute that in level1c4pps is set to False to avoid adding lat/lons again. But in area2cf this attribute is ignored if the data is in Swath definition. This line: |
@ninahakansson changing |
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.
Good start. I'm missing a test that describe your use case, with the renaming of the coordinates. Maybe that would be testing the _collect_datasets
function?
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.
LGTM, thanks for fixing the lon/lat overwrite!
@sfinkens do you want to check this against pygac-fdr before I merge this? |
No, go ahead! I'll see what the system tests will find. |
Only add lon/lat variables if they are not included already.
Level1c4pps ended up with both lat/lon and latitude/longitude coordinates.
flake8 satpy