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

[Feature]: Enable recognition of vertical axes if Z-axis is not defined #603

Open
pochedls opened this issue Feb 10, 2024 · 1 comment
Open

Comments

@pochedls
Copy link
Collaborator

Is your feature request related to a problem?

If the latitude axis doesn't have axis=Y set, we should still be able to recognize it as a latitude axis if it is called lat or latitude. This is similarly true for longitude (recognized as lon or longitude). At the same time, if a dataset has a unique name for latitude (e.g., g4_lat_2 in the JRA reanalysis), we probably should not hard code that into xcdat as it is overly specific to one dataset.

This ticket is spurred from this PR [see discussion therein]. We should carefully consider what we want to recognize as "standard" names for vertical axes.

Describe the solution you'd like

Inclusion of "standard" vertical level names into xcdat.

Describe alternatives you've considered

No response

Additional context

No response

@tomvothecoder
Copy link
Collaborator

tomvothecoder commented Feb 12, 2024

Thanks for opening for this Steve.

If the latitude axis doesn't have axis=Y set, we should still be able to recognize it as a latitude axis if it is called lat or latitude. This is similarly true for longitude (recognized as lon or longitude). At the same time, if a dataset has a unique name for latitude (e.g., g4_lat_2 in the JRA reanalysis), we probably should not hard code that into xcdat as it is overly specific to one dataset.

We try to do this now, but we haven't more carefully defined what the generally accepted "common" names are for the Z-axis. I incorrectly assumed the ones proposed in #584 were generally accepted common axis names for Z and prematurely merged that PR.

Here's the current map for more context:

xcdat/xcdat/axis.py

Lines 41 to 60 in 94271f1

# A dictionary that maps common variable names to coordinate variables. This
# map is used as fall-back when coordinate variables don't have CF attributes
# set for ``cf_xarray`` to interpret using `CF_ATTR_MAP`.
VAR_NAME_MAP: Dict[CFAxisKey, List[str]] = {
"X": ["longitude", "lon"],
"Y": ["latitude", "lat"],
"T": ["time"],
"Z": [
"vertical",
"height",
"pressure",
"lev",
"plev",
"depth",
"deptht",
"olevel",
"rho",
],
}

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

No branches or pull requests

2 participants