pyUSID.io.hdf_utils.model.write_main_dataset¶
- pyUSID.io.hdf_utils.model.write_main_dataset(h5_parent_group, main_data, main_data_name, quantity, units, pos_dims, spec_dims, main_dset_attrs=None, h5_pos_inds=None, h5_pos_vals=None, h5_spec_inds=None, h5_spec_vals=None, aux_spec_prefix='Spectroscopic_', aux_pos_prefix='Position_', verbose=False, slow_to_fast=False, **kwargs)[source]¶
Writes the provided data as a ‘Main’ dataset with all appropriate linking. By default, the instructions for generating the ancillary datasets should be specified using the pos_dims and spec_dims arguments as dictionary objects. Alternatively, if both the indices and values datasets are already available for either/or the positions / spectroscopic, they can be specified using the keyword arguments. In this case, fresh datasets will not be generated.
- Parameters:
h5_parent_group (
h5py.Group
) – Parent group under which the datasets will be createdmain_data (numpy.ndarray, dask.array.core.Array, list or tuple) – 2D matrix formatted as [position, spectral] or a list / tuple with the shape for an empty dataset. If creating an empty dataset - the dtype must be specified via a kwarg.
main_data_name (String / Unicode) – Name to give to the main dataset. This cannot contain the ‘-’ character.
quantity (String / Unicode) – Name of the physical quantity stored in the dataset. Example - ‘Current’
units (String / Unicode) – Name of units for the quantity stored in the dataset. Example - ‘A’ for amperes
pos_dims (Dimension or array-like of Dimension objects) – Sequence of Dimension objects that provides all necessary instructions for constructing the indices and values datasets Object specifying the instructions necessary for building the Position indices and values datasets
spec_dims (Dimension or array-like of Dimension objects) – Sequence of Dimension objects that provides all necessary instructions for constructing the indices and values datasets Object specifying the instructions necessary for building the Spectroscopic indices and values datasets
main_dset_attrs (dictionary, Optional) – Dictionary of parameters that will be written to the main dataset. Do NOT include region references here.
h5_pos_inds (h5py.Dataset, Optional) – Dataset that will be linked with the name “Position_Indices”
h5_pos_vals (h5py.Dataset, Optional) – Dataset that will be linked with the name “Position_Values”
h5_spec_inds (h5py.Dataset, Optional) – Dataset that will be linked with the name “Spectroscopic_Indices”
h5_spec_vals (h5py.Dataset, Optional) – Dataset that will be linked with the name “Spectroscopic_Values”
aux_spec_prefix (str or unicode, Optional) – Default prefix for Spectroscopic datasets. Default = “Spectroscopic”
aux_pos_prefix (str or unicode, Optional) – Default prefix for Position datasets. Default = “Position”
verbose (bool, Optional, default=False) – If set to true - prints debugging logs
slow_to_fast (bool, Optional. Default=False) – Set to True if the dimensions are arranged from slowest varying to fastest varying. Set to False otherwise.
chunking (kwargs will be passed onto the creation of the dataset. Please pass) – arguments this way
compression – arguments this way
dtype – arguments this way
other (and) – arguments this way
- Returns:
h5_main – Reference to the main dataset
- Return type: