boutproject / xBOUT

Collects BOUT++ data from parallelized simulations into xarray.
https://xbout.readthedocs.io/en/latest/
Apache License 2.0
22 stars 10 forks source link

Loading FieldPerp variables #148

Open johnomotani opened 4 years ago

johnomotani commented 4 years ago

Currently FieldPerp variables are not supported, we just skip them when loading https://github.com/boutproject/xBOUT/blob/1f2090e0167b5147a0489889151a76c625b47fc9/xbout/load.py#L700-L707

Following discussion here https://github.com/boutproject/BOUT-dev/pull/2102#pullrequestreview-496349751, I think what we want to do is:

For reading, need to work out how the requirements above can be implemented with xarray's combining methods. Hopefully it might 'just work'. I'm not sure right now what happens to variables that are present in some files but not others.

If we find that a FieldPerp was read at only one, unique yindex_global then I guess we could remove the suffix from its variable name, but that would require more special-case code so I'd vote against unless someone wants that feature badly.

When writing out the FieldPerps: