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

More lenient guess_coord_axis() rules? #464

Open
kthyng opened this issue Aug 14, 2023 · 3 comments
Open

More lenient guess_coord_axis() rules? #464

kthyng opened this issue Aug 14, 2023 · 3 comments

Comments

@kthyng
Copy link
Contributor

kthyng commented Aug 14, 2023

Hi. I regularly find myself wishing guess_coord_axis() would find more dimension and coordinate names. I was just adding some to do a PR but I see that some are purposely excluded. For example I would like it to find "lat" when the variable name doesn't start with "lat" but it is just in the name somewhere. I see this was purposefully done because some people must have datasets that use "nlat" as a dimension to count their latitudes but want it to be "Y" not "latitude". Same with lon, time, and Z.

I also would like to add "eta" and "xi" to the guess regex for "Y" and "X" respectively to pick up dimensions in ROMS files. However, perhaps this would cause a problem for some users if they have other variable names with those names in them.

Would it make sense to have a flag for levels of leniency for guesses? Or for whether they have to be at the start of the variable name or not?

I can submit the code I have if this is too abstract to discuss. Thanks.

@kthyng
Copy link
Contributor Author

kthyng commented Aug 16, 2023

@dcherian What do you think about this? My hope is to avoid needing to change e.g. eta_rho to a coordinate and add the attribute axis="Y" for all ROMS output.

@dcherian
Copy link
Contributor

For ROMS I would add a SGRID variable.

cf_xarray.datasets.sgrid_roms["grid"]

has all the metadata you need and it's the same for all ROMS simulations AFAICT

@dcherian
Copy link
Contributor

This could be a good addition to the FAQ: https://cf-xarray.readthedocs.io/en/latest/faq.html

Add a grid_topology variable to allow referring to variables without actual values.

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

No branches or pull requests

2 participants