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

Allow dim in get_bitinformation as list #105

Closed
aaronspring opened this issue May 20, 2022 · 2 comments · Fixed by #106
Closed

Allow dim in get_bitinformation as list #105

aaronspring opened this issue May 20, 2022 · 2 comments · Fixed by #106
Labels
good first issue Good for newcomers

Comments

@aaronspring
Copy link
Collaborator

No description provided.

@aaronspring aaronspring added the good first issue Good for newcomers label May 20, 2022
@rsignell-usgs
Copy link
Contributor

rsignell-usgs commented May 20, 2022

This would be most welcome, as I just hit this issue with our ROMS model, which uses a C-grid, and therefore variables on different cell locations have different dimensions.

I'd like to specify the "y" dimensions in a list, e.g. dim = ['eta_rho', 'eta_u', 'eta_v'] and then use whichever one is found for a specific variable.

Is that what you had in mind?

<xarray.Dataset>
Dimensions:                 (time1: 5, eta_rho: 178, xi_rho: 395, eta_u: 178,
                             xi_u: 395, eta_v: 178, xi_v: 395, s_rho: 16,
                             s_w: 17, time: 5, Nbed: 1)
Coordinates: (12/13)
  * s_rho                   (s_rho) float64 -0.9688 -0.9062 ... -0.03125
  * s_w                     (s_w) float64 -1.0 -0.9375 -0.875 ... -0.0625 0.0
    lon_rho                 (eta_rho, xi_rho) float64 ...
    lat_rho                 (eta_rho, xi_rho) float64 ...
    lon_u                   (eta_u, xi_u) float64 ...
    lat_u                   (eta_u, xi_u) float64 ...
    ...                      ...
    lat_v                   (eta_v, xi_v) float64 ...
  * Nbed                    (Nbed) float64 -1.0
  * time                    (time) datetime64[ns] 2010-07-21T11:00:00 ... 201...
    time_run                (time) datetime64[ns] ...
  * time1                   (time1) datetime64[ns] 2009-08-21T10:00:00 ... 20...
    time1_run               (time1) datetime64[ns] ...
Dimensions without coordinates: eta_rho, xi_rho, eta_u, xi_u, eta_v, xi_v
Data variables: (12/82)
    zeta                    (time1, eta_rho, xi_rho) float32 ...
    ubar                    (time1, eta_u, xi_u) float32 ...
    vbar                    (time1, eta_v, xi_v) float32 ...
    u                       (time1, s_rho, eta_u, xi_u) float32 ...
    v                       (time1, s_rho, eta_v, xi_v) float32 ...

@aaronspring
Copy link
Collaborator Author

For now I would transpose and/or use axis=1

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

Successfully merging a pull request may close this issue.

2 participants