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

[example] derotate_vector #268

Open
larsbuntemeyer opened this issue Jul 17, 2024 · 0 comments
Open

[example] derotate_vector #268

larsbuntemeyer opened this issue Jul 17, 2024 · 0 comments

Comments

@larsbuntemeyer
Copy link
Contributor

larsbuntemeyer commented Jul 17, 2024

import numpy as np
import matplotlib.pyplot as plt
import cordex as cx

u = np.array([1., 0., -1.])
v = np.array([-1., 1., 0])
lon = np.array([0., 0., 0.])
lat = np.array([0., 0., 0.])
pollon = 90.
pollat = 45.

u1, v1 = cx.derotate_vector(u, v, lon, lat, pollon, pollat)

V = np.array([[1,1], [-2,2], [4,-7]])
origin = np.array([[0, 0, 0],[0, 0, 0]]) # origin point

plt.quiver(*origin, u, v, color=['r','b','g'], scale=5)
plt.quiver(*origin, u1, v1, color=['r','b','g'], scale=5)
plt.show()
grafik
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

No branches or pull requests

1 participant