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

Fix 'awips_tiled' writer producing an invalid y coordinate #1776

Merged
merged 4 commits into from Jul 29, 2021

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Jul 27, 2021

@joleenf pointed out that something was wrong in the coordinates with the 'awips_tiled' writer. After spending a while tracking it down I discovered that the add_offset was being set to the .min() value of the Y coordinate data. The Y data is always in descending order (negative scale_factor) so using the min as the add_offset results in the scale in-file values being -5119, -5118, ..., 0. For the existing templates, these values are int16 with _Unsigned = 'true' which means these negative values are incorrect (and -1 is the fill value). It is all just bad overall and resulted in invalid Y coordinates when unscaled from the file.

@joleenf do you think you'd be able to test this with some of the other stuff you've been doing before I merge it?

  • Tests added

@djhoese
Copy link
Member Author

djhoese commented Jul 27, 2021

@mraspaud @sfinkens Looks like the fiduceo reader is failing tests now. Not sure how it didn't fail in the unstable environment first (or maybe it would have but we didn't have enough recent pull requests).

@djhoese
Copy link
Member Author

djhoese commented Jul 27, 2021

Looks like it was made into a PR here: pydata/xarray#5630 4 days ago, merged, and then released immediately.

@djhoese
Copy link
Member Author

djhoese commented Jul 27, 2021

See #1777 for fixes.

@joleenf
Copy link
Contributor

joleenf commented Jul 28, 2021

@djhoese As noted in slack, the area_extent and range of y coordinates are consistent. The y coordinate is increasing from a negative value to a positive value. I only checked the fixed grid that was broken before the bug fix. I will check the grid that was okay before the bug fix and make sure it is still okay and get back to you.

@joleenf
Copy link
Contributor

joleenf commented Jul 29, 2021

Navigation and tiles looking good for both 211e and us_1km grids with clavrx data.

@djhoese djhoese merged commit 3def9a7 into pytroll:main Jul 29, 2021
@djhoese djhoese deleted the bugfix-y-coord-awips branch July 29, 2021 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants