[ecco-support] Mapping to Lat-Lon
Deb Gardner
dagardne at ucsd.edu
Thu Jul 16 16:13:19 EDT 2020
Good day, colleagues,
I have hit a roadblock. I'm attempting to plot zonal and depth-integrated
v4r4 variables as a function of latitude. I'm using the xgcm python package
and jupyter notebook. I did find LLCMapper and have attempted to use that
information to create something that will work for my needs. My problems are
1) 'faces' are called 'tile' in v4r4 variables
2) I'm getting the error that I must have 'i' coordinate (I have 'i_g',
perhaps shift to 'i'?)
3) I'm not entirely sure LLCMapper is going to allow me to do what I
eventually want to do.
Would someone mind taking a look at my code below and giving
feedback/suggestions? Thanks in advance!
Warm regards,
Deb Gardner (she/her/ella)
NSF Graduate Research Fellow
Best Waffle Topping, 2019 | Scripps Institution of Oceanography
SIO Graduate Student Council, Junior Co-Chair 2020-2021
--
I respectfully acknowledge that UC San Diego and its surrounding
communities occupy the stolen territory of the Kumeyaay/Kumiai Nation and
to whom I owe honor and gratitude. / Whose land are you on?
<https://native-land.ca/>
# calculate pressure gradient in x-dir
dP = gcm_grid.derivative(P,'X',boundary='extend')
# zonal and depth integral of pressure gradient in x
dP_int = gcm_grid.integrate(dP,['Z','X'])
# dP coords - k, tile, j, i_g
# zonal integration of windstress
taue_int = gcm_grid.cumsum(oceTAUE,'X',boundary='extend')
# note: grid.integrate does not work with oceTAUE
#taue_int has coordinates tile, j, i_g
Pmapper = LLCMapper(P_coords)
tauemapper = LLCMapper(taue_coords)
#calling either of the mappers with the integrated values produces the same
error (below)
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-34-1562da53e232> in <module>
----> 1 Pmapper(dP_int)
<ipython-input-8-efce9e1da44c> in __call__(self, da, ax, projection, lon_0,
**plt_kwargs)
14 self.new_grid =
pyresample.geometry.GridDefinition(lons=self.new_grid_lon,lats=self.new_grid_lat)
15 def __call__(self, da, ax=None, projection=cart.crs.Robinson(),
lon_0=-60, **plt_kwargs):
---> 16 assert set(da.dims) == set(['face', 'j', 'i']), "da must
have dimensions ['face', 'j', 'i']"
17 if ax is None:
18 fig, ax = plt.subplots(figsize=(12, 6))
AssertionError: da must have dimensions ['face', 'j', 'i']
<https://native-land.ca/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/ecco-support/attachments/20200716/4dc640ec/attachment.html
More information about the ecco-support
mailing list