yt.frontends.open_pmd.misc module

yt.frontends.open_pmd.misc.get_component(group, component_name, index=0, offset=None)[source]

Grabs a dataset component from a group as a whole or sliced.

  • group (h5py.Group) –
  • component_name (str) – relative path of the component in the group
  • index (int, optional) – first entry along the first axis to read
  • offset (int, optional) – number of entries to read if not supplied, every entry after index is returned


This scales every entry of the component with the respective “unitSI”.

Returns:(N,) 1D in case of particle data (O,P,Q) 1D/2D/3D in case of mesh data
Return type:ndarray

Determines whether a group or dataset in the HDF5 file is constant.

Parameters:record_component (h5py.Group or h5py.Dataset) –
Returns:True if constant, False otherwise
Return type:bool



Transforms an openPMD unitDimension into a string.

Parameters:unit_dimension (array_like) –

integer array of length 7 with one entry for the dimensional component of every SI unit

[0] length L, [1] mass M, [2] time T, [3] electric current I, [4] thermodynamic temperature theta, [5] amount of substance N, [6] luminous intensity J


Return type:str


>>> velocity = [1., 0., -1., 0., 0., 0., 0.]
>>> print parse_unit_dimension(velocity)
>>> magnetic_field = [0., 1., -2., -1., 0., 0., 0.]
>>> print parse_unit_dimension(magnetic_field)