-
Notifications
You must be signed in to change notification settings - Fork 41
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
Discovering Axes for ROMS #84
Comments
But it's discovered a lot! you can use
I'm happy to merge more heuristics for |
Sorry I missed the bit about I think we could try to mark cf-xarray/cf_xarray/accessor.py Lines 109 to 112 in 235acac
Related: There's some discussion about X vs longitude and Y vs latitude here: #23 EDIT: (also i love that you're using this with ROMS; i've been testing with MOM6 mostly so this is a great way to generalize things a bit more.). |
I didn't mean to imply nothing is working, sorry! It looked to me like the Axes labels are important for what I am trying to do, but I am also still learning what the objectives of cf-xarray are so that I can use it properly. I hate having to specify the grid that I am on when I am doing unambiguous operations to Dataarrays, and it looks like cf-xarray can help me with this, but it also looks like I need the Axes properly labeled for that. I see that having the coordinates pulled out like they already are will allow me to plot without having to specify a different staggered grid for each variable, so that is great. I'm fine with X, Y, Z for dimensions vs. lon, lat for coordinates, though ROMS people use xi and eta instead of X and Y so having the choice between X, Y and xi, eta might be good. How is time identified? This doesn't seem to work for either Axes or coords so far (name is I tried |
Oh, and I think it is fine to have xroms set up things that don't make sense to go into cf-xarray, but 1. I am not clear where that line is and 2. could you point me to any examples for how to set it up by hand for that purpose? |
Ah, sorry for posting again, but I see you probably mean to modify attributes of each variable as described here: https://cf-xarray.readthedocs.io/en/latest/examples/introduction.html#What-attributes-have-been-discovered? |
I didn't take it to mean that. no worries!
OK cf_xarray works by interpreting CF attributes so these attributes need to be set. ( The "CF" compliance bit rules out using ds.coords["xi_rho"] = ds.xi_rho # makes coordinate variable so we can set attributes; weird syntax
ds.xi_rho.attrs["axis"] = "X"
This is a bug. It should detect that |
Closing. Feel free to repoen if there are other things not working. |
Quick question: Is
and maybe this would save some of the lines I've been adding to get attributes added? |
👍 Yes
If you can trust the guessing heuristics. A more long term fix would be to report these attribute losses upstream somewhere (I've been slowly working on fixing them). |
We now have SGRID support, so |
I am trying to use this excellent package but it doesn't seem to work for ROMS output. What is the best way to use this when the input names are apparently not expected? Here is what I get:
for full Dataset:

For single DataArray:

For the T axis,

ocean_time
should be straight-forward since there is only one. For vertical coordinates, there are actually a bunch in my Dataset for all different grid configurations:The text was updated successfully, but these errors were encountered: