imap_processing.hi.utils.create_dataset_variables#
- imap_processing.hi.utils.create_dataset_variables(variable_names: list[str], variable_shape: int | Sequence[int] | None = None, coords: dict[str, DataArray] | None = None, fill_value: float | None = None, att_manager_lookup_str: str = '{0}') dict[str, DataArray]#
Instantiate new xarray.DataArray variables.
Variable attributes are retrieved from CdfAttributeManager.
- Parameters:
variable_names (list[str]) – List of variable names to create.
variable_shape (int or Sequence of int, Optional) – Shape of the new variables data ndarray. If not provided the shape will attempt to be derived from the coords dictionary.
coords (dict, Optional) – Coordinate variables for the Dataset. If variable_shape is not provided the dataset variables created will use this dictionary along with variable attributes from the CdfAttributeManager to determine the shapes of the dataset variables created.
fill_value (Optional, float) – Value to fill the new variables data arrays with. If not supplied, the fill value is pulled from the CDF variable attributes “FILLVAL” attribute.
att_manager_lookup_str (str) – String defining how to build the string passed to the CdfAttributeManager in order to retrieve the CdfAttributes for each variable. The string passed to CdfAttributeManager will be the result of calling the str.format() method on this input string with the variable name from variable_names as the single argument. Defaults to “{0}”.
- Returns:
new_variables – Dictionary of new xarray.DataArray variables.
- Return type: