Open abby-baskind opened 3 years ago
Hi @abby-baskind a couple of things:
.assign_coords
function. In that function, you can specify a dictionary that maps the dimension to an array that you wish to use as coordinates. So, for example, if longitudearray
is an array giving the correct longitudes: ds.assign_coords({'x':longitudearray})
.where
command) - you want to orient the figure based on the actual values of the latitude and longitude, whereas the dimensional information is indicative only.
Make sense?
mostly just leaving this as a reminder to myself, but if you're not me and you're here and you have thoughts i'd appreciate it
so despite using the regridded data (
gr
) and despite all the other models being unproblematic, NorCPM1 just wants to continue using indices forx
andy
instead of coordinates fortalk
,thetao
, andso
(but notdissic
bc it doesn't havedissic
)For instance, from
thetao
...y = array([ 1, 2, 3, ..., 382, 383, 384], dtype=int32)
andx = array([ 1, 2, 3, ..., 318, 319, 320], dtype=int32)
. The same thing happens for the other variables.Since the meridional Pacific sections look reasonable (except for the x-axis), the indices clearly scale with latitude (as expected).
But because x and y are indices, x and y don't really translate well onto polar stereographic projections
There MUST be a way to covert these indices to coordinates. That's going to require I know how the coordinates scale with index (i.e. 1 index = how much latitude/longitude). It also will require I know how to change a fundamental attribute of the dataarray/xarray (idk what it is, also need to figure that out). There also might be a solution through preprocessing so I should check that too