Get Grid Data¶
- class postcactus.cactus_grid_omni.GridOmniDir(sd)¶
This class provides access to all grid data.
This includes 1D-3D data in hdf5 format as well as 1D ASCII data. Data of the required dimensionality is read from any format available (hdf5 preferred over ascii). If necessary, cuts are applied to 2D/3D data to get requested 1D/2D data.
- Variables
x – Access to 1D data along x-axis.
y – Access to 1D data along y-axis.
z – Access to 1D data along z-axis.
xy – Access to 2D data along xy-plane.
xz – Access to 2D data along xz-plane.
yz – Access to 2D data along yz-plane.
xyz – Access to 3D data.
hdf5 – Access specifically hdf5 grid data.
ascii – Access specifically ascii grid data.
- class postcactus.cactus_grid_omni.GridOmniReader(dims, readers)¶
This class provides access to all grid data of given dimensions.
This includes hdf5 format and, for 1D data, ASCII format. Data is read from any format available (hdf5 preferred over ascii). If necessary, cuts are applied to available data in order to get the requested dimensionality.
- all_fields()¶
Returns a list of all available variables.
- dimensionality()¶
Dimensionality
- get_grid_spacing(level, name, **kwargs)¶
Get grid spacing for a given refinement level.
- Parameters
level – refinement level.
name – variable from which to extract the spacing.
- get_iters(name)¶
Get list of iterations for a given variable.
- get_restarts(name)¶
Get a list of restarts for a given variable.
- get_times(name)¶
Get list of iteration times for a given variable.
- read(name, it, cut=None, **kwargs)¶
Read grid data for given variable and iteration.
This can either return a grid hierarchy or resample to a uniform grid. For the latter, there is an option to return the refinement level used for each point instead of the data.
- Parameters
name – variable to read.
it – iteration to read.
geom (
RegGeom
instance) – if given, resample to uniform grid.adjust_spacing – whether to snap grid spacing to next finest level.
order (0 or 1) – interpolation order for resampling.
outside_val – fill value for points not covered by data.
level_fill – if True, return refinement level instead of actual data.