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

Export to xarray #1072

Open
ksunden opened this issue Jun 8, 2022 · 0 comments
Open

Export to xarray #1072

ksunden opened this issue Jun 8, 2022 · 0 comments
Assignees

Comments

@ksunden
Copy link
Member

ksunden commented Jun 8, 2022

While the full richness we like in wt may not be 100% supported in xarray, I think there is at least a reasonable minimum viable that may include some fairly generic dimension names (As that is not a concept we have)

Something like:

_001_dat (/tmp/811qwfvb.wt5)
├── axes
│   ├── 0: w2 (nm) (41, 1, 1)
│   ├── 1: w1=wm (nm) (1, 41, 1)
│   └── 2: d2 (fs) (1, 1, 23)
├── constants
├── variables
│   ├── 0: w2 (nm) (41, 1, 1)
│   ├── 1: w1 (nm) (1, 41, 1)
│   ├── 2: wm (nm) (1, 41, 1)
│   ├── 3: d2 (fs) (1, 1, 23)
│   ├── 4: w3 (nm) (1, 1, 1)
│   ├── 5: d0 (fs) (1, 1, 1)
│   └── 6: d1 (fs) (1, 1, 1)
└── channels
    ├── 0: ai0 (41, 41, 23)
    ├── 1: ai1 (41, 41, 23)
    ├── 2: ai2 (41, 41, 23)
    ├── 3: ai3 (41, 41, 23)
    ├── 4: ai4 (41, 41, 23)
    └── 5: mc (41, 41, 23)

Would result in an xarray minimally containing coordinate arrays for the non-scalar variables: w2 along "dim0", w1 and wm along "dim1" and d2 along "dim2"

The scalars would similarly be scalars

The channels would then be arrays with dimensions "dim0, dim1, dim2" (any 1's in the shape get removed, essentially)

I think we can ignore axes for the first go around, at least outside of attrs, unless there is a slick way to do it.

I would make sure that units get put in in the most standardized way (I think there is a de facto standard, but not a "used within xarray itself" standard) and as rich of attrs as we can provide are transferred over (perhaps missing those that are redundant with the information in the structure of xarray already)

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

No branches or pull requests

2 participants