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

poloidal_plot argument for plot2d_wrapper #167

Open johnomotani opened 4 years ago

johnomotani commented 4 years ago

It would be nice to have a poloidal_plot argument to plot2d_wrapper() (and so for BoutDataArray.pcolormesh(), BoutDataArray.contour() and BoutDataArray.contourf()) like animate2D() and animate_list() have so that we can turn off the poloidal plot feature and just plot any simple slice of the data. We've got a few extra features (e.g. simple log-scaling of the colorbar) compared to the base xarray methods that would be nice to have. Needs a bit of restructuring of plot2d_wrapper() to not always use regions.

Question is what the sensible default value for poloidal_plot would be. I think my ideal solution would be: True if spatial dimensions are the ones corresponding to bout_xdim and bout_ydim and the DataArray has regions (i.e. if a poloidal_plot is possible); and False otherwise. That is different from animate2D() and animate_list() (which default to poloidal_plot=False) - I'd favour updating them to have this default behaviour. It would keep the current behaviour of plot2d_wrapper() for cases that it can currently plot.