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

Assign proper (2D) lat-lon coords with getvar #336

Open
navidcy opened this issue Mar 6, 2024 · 1 comment
Open

Assign proper (2D) lat-lon coords with getvar #336

navidcy opened this issue Mar 6, 2024 · 1 comment

Comments

@navidcy
Copy link
Collaborator

navidcy commented Mar 6, 2024

The variables don't have the unmasked 2D lat-lon coordinates so after we load a variable

var = cosima_cookbook.querying.getvar(experiment, variable, session, frequency='1 monthly', n=-1)

we need to do something like

geolon_t = cosima_cookbook.querying.getvar(experiment, 'geolon_t', session, n=-1)
geolat_t = cosima_cookbook.querying.getvar(experiment, 'geolat_t', session, n=-1)

var = var.assign_coords({'geolon_t': geolon_t, 'geolat_t': geolat_t})

to be able to plot properly; see https://cosima-recipes.readthedocs.io/en/latest/Tutorials/Making_Maps_with_Cartopy.html#Fixing-the-tripole

Why don't we modify the cosima_cookbook.querying.getvar method to load and assign the coords before returning back the dataarray/dataset?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants