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

Projecting LLC2160 Sea Ice Quiver onto Cartopy Northern Stereonet #323

Open
LizzWebb opened this issue Jun 29, 2023 · 1 comment
Open

Projecting LLC2160 Sea Ice Quiver onto Cartopy Northern Stereonet #323

LizzWebb opened this issue Jun 29, 2023 · 1 comment

Comments

@LizzWebb
Copy link

Hi All,

I am having troubles plotting the quiver of sea-ice velocity on the northern stereonet cartopy projection. I've tried it using fake/made up data, and it seems to work just fine (hence why I don't think it is an issue with cartopy). When I plot the the LLC2160 output, arrows point towards the north pole. We should instead expect a circular motion/rotation close to the Eastern Siberian sea, as well as ice moving towards/through the Fram strait.

Has anyone had this issue before or have any suggestions?
Thanks in advance, my code is below!

model = llcreader.ECCOPortalLLC2160Model()
ds   = model.get_dataset(varnames=['SIuice', 'SIvice]).sel(time="2012-03-01T00:00:00.000000000", face=6)

x = ds.XC.values.ravel()
y = ds.YC.values.ravel()
u = ds.SIuice.values.ravel()
v = ds.SIvice.values.ravel()

fig = plt.figure(figsize=[15,15])
ax = plt.axes(projection=ccrs.NorthPolarStereo())

minLat = 60 
maxLat = 90 
minLon = -180 
maxLon = 180 
ax.set_extent([minLon, maxLon, minLat, maxLat], ccrs.PlateCarree())
ax.add_feature(cart.feature.COASTLINE)

plt.quiver(x,y,u,v, transform= ccrs.PlateCarree(), regrid_shape=25)
plt.show()
@LizzWebb LizzWebb changed the title Projecting LLC2160 Sea Ice Quiver onto Cartopy Northern Stereonet Projection Projecting LLC2160 Sea Ice Quiver onto Cartopy Northern Stereonet Jun 29, 2023
@timothyas
Copy link
Member

Hi @LizzWebb! The LLC grid topology is rotated on some faces, so that "uice" doesn't necessarily point eastward nor "vice" northward. The arctic face is the most complicated of them all actually, since each grid cell is slightly rotated based on it's location. For plotting, I would recommend first applying these rotations, which are available via the "CS" and "SN" (cosine and sine) grid information and should be in the coordinates of the dataset, and then interpolating to cell center (rather than plotting what's on the grid cell edges).

I'd recommend using the ecco_v4_py package. You'd specifically want the code in this function. Something like the following should hopefully get you started

from xmitgcm import llcreader
import ecco_v4_py 
ds = model.get_dataset(...)
uice, vice = ecco_v4_py.vector_calc.UEVNfromUXVY(ds.SIuice, ds.SIvice, coords=ds.coords)

# ... etc etc
plt.quiver(x, y, uice.values.ravel(), vice.values.ravel(), ...)

I hope that helps! The documentation for the ecco_v4_py package is here although it doesn't necessarily compactly document what you would like to do...

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

2 participants