basemap icon indicating copy to clipboard operation
basemap copied to clipboard

Is basemap.rotate_vector working correctly?

Open guziy opened this issue 9 years ago • 3 comments
trafficstars

I have another indication that there might be something wrong in case of the rotpole projection, I'll try to make an example with that, later when I have some time. But for now please see the example below, should those to arrows be identical in this projection? (red is the rotated one and green is the original one) ...

figure_1


    import numpy as np
    from mpl_toolkits.basemap import Basemap
    import matplotlib.pyplot as plt

    u = np.array([0.5, ])
    v = np.array([0.5, ])

    lon = -84
    lat = 45

    lon = np.array([lon, ])
    lat = np.array([lat, ])

    b = Basemap(lon_0=0)

    urot, vrot = b.rotate_vector(u, v, lon, lat)
    xx, yy = b(lon, lat)


    b.quiver(xx, yy, urot, vrot, color="r")

    b.quiver(xx, yy, u, v, color="g")



    b.drawcoastlines()

Cheers

guziy avatar May 06 '16 15:05 guziy

OK, sorry I was too soon to conclude about the rotpole, that one seems to be fine, my problem was the range of longitudes: I was using [0, 360] instead of [-180, 180] for rotation, and the results were weird...

The example above looks like an accuracy problem, which is understandable... So if it is OK with everyone I'll close the issue.

Cheers

guziy avatar May 06 '16 15:05 guziy

Is cylindrical direction-preserving? I wish there was a simple table that showed projection type (rows) and property (columns) and stated whether that property was preserved or not.

On Fri, May 6, 2016 at 11:57 AM, Huziy Oleksandr (Sasha) < [email protected]> wrote:

OK, sorry I was too soon to conclude about the rotpole, that one seems to be fine, my problem was the range of longitudes: I was using [0, 360] instead of [-180, 180] for rotation, and the results were weird...

The example below looks like an accuracy problem, which is understandable... So if it is OK with everyone I'll close the issue.

Cheers

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/matplotlib/basemap/issues/294#issuecomment-217483266

WeatherGod avatar May 06 '16 16:05 WeatherGod

@WeatherGod the arrows are identical when either u or v component of the vector is 0, so I would expect it to be direction conserving...

guziy avatar May 06 '16 20:05 guziy