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 for projections using a spherical earth #336

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

mpvginde
Copy link
Contributor

@mpvginde mpvginde commented Aug 9, 2023

Some projections use a spherical earth. This is indicated in the proj4-string by either
the +R=... identifier or
by setting the +a= and +b= equal.

In both cases the parse_proj4_string returns a dict with the R-key, but this key is not checked by proj4_to_cartopy resulting in the default WGS84 globe for the cartopy CRS, giving small differences in the locations of the gridpoints.

This is now fixed by explicitly checking for the R-key in proj4_to_cartopy and defining the correct globe keywords.

I needed this to take advantage of the plot_precip_fields function for plotting precipitation coming from the ALARO NWP model.

@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Patch coverage: 33.33% and project coverage change: -0.02% ⚠️

Comparison is base (57ece43) 83.34% compared to head (8856d5c) 83.33%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #336      +/-   ##
==========================================
- Coverage   83.34%   83.33%   -0.02%     
==========================================
  Files         161      161              
  Lines       12355    12358       +3     
==========================================
+ Hits        10297    10298       +1     
- Misses       2058     2060       +2     
Flag Coverage Δ
unit_tests 83.33% <33.33%> (-0.02%) ⬇️

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

Files Changed Coverage Δ
pysteps/visualization/utils.py 56.42% <33.33%> (-0.51%) ⬇️

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

@dnerini
Copy link
Member

dnerini commented Aug 9, 2023

Hi @mpvginde thanks for the contribution! @pulkkins do you want to take this?

@dnerini dnerini requested a review from pulkkins August 9, 2023 09:28
@dnerini dnerini self-requested a review August 16, 2023 18:14
@dnerini dnerini merged commit 8dca14a into pySTEPS:master Aug 16, 2023
8 of 10 checks passed
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.

None yet

2 participants