Support for multiple timesteps
Support for reading in model outputs across multiple timesteps has been added,
where each timestep is stored in an individual file.
psipy.io.mas.read_mas_file() will automatically read in all the MAS
output files it finds in the given directory. The time coordinate values can be
queried with the new
Variable.time_coords property of variables.
The following methods have been updated to support this:
Variable.sample_at_coordsnow accepts a
targument to interpolate across timesteps.
Variable.contour_equatorial_cutall now accept a
t_idxargument, which is the time index at which to plot the cuts. This defaults to
When loading a set of netCDF files they will be lazily loaded along the time dimension (ie. only one file will be read into memory at any one time).
When loading a set of HDF4 or HDF5 files all of them will be read into memory, so beware loading lots of them! Support for lazy loading may be implemented for HDF4 or HDF5 files in the future.
Variable.plot_equatorial_cut now support animation creation. If multiple
timesteps are loaded in the
Variable and the timestep isn’t specified, a
Animation object will be returend instead of
a single plot being created. See the example gallery for more information on
how to save the animation to disk.
Other new features
convert_hdf_to_netcdf()to convert a set of HDF files to netCDF files. This is useful for creating animations from large datasets, as psipy can keep track of a number of netCDF files without reading them all into memory at once.
Accessing a variable from a model output multiple times will now return the same object, instead of making two copies of the variable in memory.
Added the ability to change the units and radial coordinates of a
There are two new examples showing how to do this in the example gallery.
First PsiPy release.