sup3r.postprocessing.writers.base.OutputMixin#
- class OutputMixin[source]#
Bases:
object
Methods used by various Output and Collection classes
Methods
get_dset_attrs
(feature)Get attrributes for output feature
get_time_dim_name
(filepath)Get the name of the time dimension in the given file
write_data
(out_file, dsets, time_index, ...)Write list of datasets to out_file.
- static get_time_dim_name(filepath)[source]#
Get the name of the time dimension in the given file
- Parameters:
filepath (str) – Path to the file
- Returns:
time_key (str) – Name of the time dimension in the given file
- static get_dset_attrs(feature)[source]#
Get attrributes for output feature
- Parameters:
feature (str) – Name of feature to write
- Returns:
attrs (dict) – Dictionary of attributes for requested dset
dtype (str) – Data type for requested dset. Defaults to float32
- classmethod write_data(out_file, dsets, time_index, data_list, meta, global_attrs=None)[source]#
Write list of datasets to out_file.
- Parameters:
out_file (str) – Pre-existing H5 file output path
dsets (list) – list of datasets to write to out_file
time_index (pd.DatetimeIndex()) – Pandas datetime index to use for file time_index.
data_list (list) – List of np.ndarray objects to write to out_file
meta (pd.DataFrame) – Full meta dataframe for the final output data.
global_attrs (dict) – Namespace of file-global attributes for the final output data.