-
Notifications
You must be signed in to change notification settings - Fork 303
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
Delete unnecessary coordinates in tropomi reader #1589
Conversation
My long term goal (a wish) has been to make the base reader support this type of logic (a coordinate variable depending on itself for coordinates). I don't expect you to fix it and I don't expect myself to have the time to do it right now either so I am OK with this PR if it fixes all of this CF writer stuff. That said, I'm still not sure I understand why the CF writer chokes on this. |
Codecov Report
@@ Coverage Diff @@
## master #1589 +/- ##
==========================================
+ Coverage 91.62% 92.84% +1.22%
==========================================
Files 246 251 +5
Lines 36034 37193 +1159
==========================================
+ Hits 33016 34532 +1516
+ Misses 3018 2661 -357
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@djhoese If these coordinates are not deleted, the problem is caused by https://github.com/pydata/xarray/blob/50d97e9d35bac783850827fa66ff5eb768e62905/xarray/conventions.py#L764-L765.
|
🤔 So maybe the CF writer should check for bad coordinates and remove them? But then again, the CF writer shouldn't have to fix every piece of metadata... |
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.
Looks good enough to me. This is a complicated topic that has a lot of parts (as far as the problem that is actually trying to be solved). This seems like the simplest fix for now until we get better coordinate handling in the base reader class.
The coordinates of
longitude
andlatitude
shouldn't be linked to themselves again.And this PR can fix this error of
scn.save_datasets()
when loadinglongitude
orlatitude
: