xmitgcm icon indicating copy to clipboard operation
xmitgcm copied to clipboard

Projecting LLC2160 Sea Ice Quiver onto Cartopy Northern Stereonet

Open LizzWebb opened this issue 2 years ago • 1 comments

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 avatar Jun 29 '23 21:06 LizzWebb

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...

timothyas avatar Jul 04 '23 03:07 timothyas