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

sgrid helper utilities #204

Open
dcherian opened this issue Apr 13, 2021 · 15 comments
Open

sgrid helper utilities #204

dcherian opened this issue Apr 13, 2021 · 15 comments
Labels
opinion wanted User input requested

Comments

@dcherian
Copy link
Contributor

Copied from #201 re: https://sgrid.github.io/sgrid/

I think there's an opportunity for better metadata handling around gridded, xgcm, sgrid, xesmf with cf_xarray providing a little helper function layer to consolidate the code.

It seems a common issue is figuring out cell metrics; and cell centers and corner points. This is needed by xgcm, maybe cmip6_preprocessing, and probably xesmf (definitely needed to specify xesmf inputs).

I think cf_xarray can provide a tiny sgrid module that helps autoguess some sgrid parameters and maybe parses the sgrid attributes and lets them be used in a convenient way. We can take inspiration from (and maybe copy over) https://noaa-orr-erd.github.io/gridded/gridded.pysgrid.html

I think a call some time in the next two weeks would be good to sort this out, and make a plan.

cc @aulemahal @mgrover1 @malmans2

@mgrover1
Copy link

This is a great idea - can we try to set something up for next week?

@malmans2
Copy link
Member

I think a call some time in the next two weeks would be good to sort this out, and make a plan.

Good idea!

@aulemahal
Copy link
Contributor

Interesting! I am available for a call in the next two weeks.

@mgrover1
Copy link

What day works well for people this week?

@dcherian
Copy link
Contributor Author

Thursday/Friday with Friday preferred.

@mgrover1
Copy link

Would 10 AM MST on Friday April 23 work well for everyone?

@dcherian
Copy link
Contributor Author

cc @jbusecke @raphaeldussin

@dcherian dcherian added the opinion wanted User input requested label Apr 20, 2021
@jbusecke
Copy link

Yes I can make that! Thanks for organizing.

@dcherian
Copy link
Contributor Author

See xgcm/xgcm#109 for things that xgcm needs.

@mgrover1
Copy link

mgrover1 commented Apr 20, 2021

I created a Google Calendar event for Friday.

Here is a link to the event

Within the event, you will find a document which will serve as the agenda - feel free to make edits to that!

@jbusecke
Copy link

That link does not seem to work for me @mgrover1. Could you resend it?

@mgrover1
Copy link

Meet

Notes

@mgrover1
Copy link

Meet meet.google.com/uab-gvff-mdk

@dcherian
Copy link
Contributor Author

dcherian commented Mar 3, 2022

https://ioos.github.io/ioos_code_lab/content/code_gallery/data_analysis_and_visualization_notebooks/2016-11-16-CF-UGRID-SGRID-conventions.html

Some useful stuff here.

@dcherian
Copy link
Contributor Author

dcherian commented Feb 7, 2023

From https://sgrid.github.io/sgrid/#roms

int grid ;
        grid:cf_role = grid_topology
        grid:topology_dimension = 2 ;
        grid:node_dimensions = "xi_psi eta_psi" ;
        grid:face_dimensions = "xi_rho: xi_psi (padding: both) eta_rho: eta_psi (padding: both)" ;
        grid:edge1_dimensions = "xi_u: xi_psi eta_u: eta_psi (padding: both)" ;
        grid:edge2_dimensions = "xi_v: xi_psi (padding: both) eta_v: eta_psi" ;
        grid:node_coordinates = "lon_psi lat_psi" ;
        grid:face_coordinates = "lon_rho lat_rho" ;
        grid:edge1_coordinates = "lon_u lat_u" ;
        grid:edge2_coordinates = "lon_v lat_v" ;
        grid:vertical_dimensions = "s_rho: s_w (padding: none)" ;

One thing we could do is parse this to understand that xi_*, eta_*, s_* are axes X, Y, Z even though they don't have the axes attribute set. In particular this helps with xi_*, eta_* which are "virtual variables" i.e. there is no data associated with them, or they are "unlabeled dimensions" with no associated coordinate variable or attrs.

@dcherian dcherian mentioned this issue Feb 8, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
opinion wanted User input requested
Projects
None yet
Development

No branches or pull requests

5 participants