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

wind arrow direction depends on map projection #1899

Open
jgrooss opened this issue Aug 14, 2023 · 10 comments
Open

wind arrow direction depends on map projection #1899

jgrooss opened this issue Aug 14, 2023 · 10 comments
Assignees
Labels
mswms question Further information is requested request upstream help

Comments

@jgrooss
Copy link
Contributor

jgrooss commented Aug 14, 2023

When displying plots ECMWF wind data arrows the wind file direction is not correct in all times. The following plots show the same polar stereogaphic plots but for opposite mirrored projections.
For comparison I attach also a gaphically mirrired file.
v1 shows a projection an a flight path from EDMO (upper edge) to Anchorage (lower edge)
map frame settings are "llcrnrlon": 150.0, "llcrnrlat": 50.0, "urcrnrlon": -45.0, "urcrnrlat": 30.0
This seems to be not correct

v2 shows the same data with EDMO at the lower edge
map frame settings are "llcrnrlon": 60.0, "llcrnrlat": 32.0, "urcrnrlon": -127.0,, "urcrnrlat": 48.0
This seems to be correct.

For visual comparison, I also add a mirrored image of V1
V1:
topview_Geopotential_wind_150hPa_v1
V2:
topview_Geopotential_wind_150hPa_v2
V1-mirror:
topview_Geopotential_wind_150hPa_v1_mirror

@jgrooss
Copy link
Contributor Author

jgrooss commented Aug 14, 2023

@joernu76 Do you have any idea what causes this behaviour?

@ReimarBauer ReimarBauer added the bug Something isn't working label Aug 14, 2023
@ReimarBauer ReimarBauer added this to the 8.2.1 milestone Aug 14, 2023
@ReimarBauer ReimarBauer added the question Further information is requested label Aug 14, 2023
@jgrooss
Copy link
Contributor Author

jgrooss commented Aug 14, 2023

The cylindrical projection would be likely correct, This contributes better to V2

topview_Geopotential_wind_150hPa_cyl

@jgrooss
Copy link
Contributor Author

jgrooss commented Aug 15, 2023

NB this is very important as we tried to get a hint whether a direct flight would be possible due to head winds or not...
If the wind arrow depiction does not work for stereographic projections, it should rather left out in this projection.

@ReimarBauer
Copy link
Member

ReimarBauer commented Aug 16, 2023

We don't use cartopy, but that sounds similiar
SciTools/cartopy#1179

look for the section, comparison basemap to cartopy

m = basemap.Basemap(projection="npstere", boundinglat = 50,  lon_0 = 0)
u_rot, v_rot, x, y = m.rotate_vector(u, v, lon ,lat, returnxy=True)
m.quiver(x, y, u_rot, v_rot, angles = "xy")

the rotate_vector is mentioned as solution. This needs to become fixed in mpl_hsec_styles

@ReimarBauer ReimarBauer added mswms and removed question Further information is requested labels Aug 16, 2023
@joernu76
Copy link
Member

Moin, Ill try to have a look. The projection in V2 is mirrored, which happens with "wrong" lon/lat coordinates even though. This is
The wind arrows look fishy, though. Wind should go from the Americas to Europe, I guess.

@joernu76
Copy link
Member

This projection works for me:

        "16 Northern Hemisphere (stereo)": {                                                                                                                                 
            "CRS": "EPSG:77789225",
            "map": {
                "llcrnrlon": 180.0,
                "llcrnrlat": 0.0,
                "urcrnrlon": 0.0,
                "urcrnrlat": 0.0
            }
        }   

@ReimarBauer
Copy link
Member

@jgrooss is your question answered?

@ReimarBauer ReimarBauer added the question Further information is requested label Aug 31, 2023
@jgrooss
Copy link
Contributor Author

jgrooss commented Aug 31, 2023

No, the wind arrows should work for every chosen projection. It seems to me however, that this is an error in the included plotting routines

@joernu76
Copy link
Member

Correct, but if the projection is wrongly parameterized, i.e. if, e.g., the landmasses are reversed in east-west order, nothing is assured to work anymore.

In particular, you are using a projection that is centered on 10°E and 40°S. The coordinates of the corners are flipped in such a fashion that it looks fine, but the winds are wrong.

Incidentally, the "02 PHILEAS (stereo)" projection has the same issue. Using an appropriate center of projection, the winds are fine as well:

        "02 PHILEAS (stereo)": {
            "CRS": "EPSG:77740190",
            "map": {
                "llcrnrlon": 170.0,
                "llcrnrlat": 40.0,
                "urcrnrlon": 260.0,
                "urcrnrlat": 65.0
            }
        },

The specification of corners in lon/lat is dangerous with basemap stereographic projections...

@joernu76
Copy link
Member

joernu76 commented Sep 2, 2023

I uploaded a fixed msui_settings.json file to the PHILEAS cloud. I also added better projections for Norther Canada and a polar Northern Hemisphere plot.

That something is seriously wrong with the current projection is apparent when one zooms out. The area around Anchorage is severely distorted due to the large distance to the center of projection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mswms question Further information is requested request upstream help
Projects
None yet
Development

No branches or pull requests

3 participants