concatenate#
- caput.containers.tod.concatenate(data_list: collections.abc.Sequence[TOData], out_group: caput.memdata._memh5.GroupLike | None = None, start: int | dict | None = None, stop: int | dict | None = None, datasets: collections.abc.Sequence[str] | None = None, dataset_filter: collections.abc.Callable | None = None, convert_attribute_strings: bool = True, convert_dataset_strings: bool = False) TOData[source]#
Concatenate data along the time axis.
All
TODataobjects to be concatenated are assumed to have the same datasets and index_maps with compatible shapes and data types.Currently only ‘time’ axis concatenation is supported, and it must be the fastest varying index.
All attributes, history, and other non-time-dependant information is copied from the first item.
- Parameters:
- data_list
list[TOData] Sequence of
TOData. These are assumed to be identical in every way except along the axes representing time, over which they are concatenated. All other data and attributes are simply copied from the first entry of the list.- out_group
GroupLike|None, optional Underlying hdf5 like container that will store the data for the BaseData instance.
- start
int|dict, optional In the aggregate datasets at what index to start. Every thing before this index is excluded. If provided as a dict, the keys should be
data_list[0].time_axes.- stop
int|dict, optional In the aggregate datasets at what index to stop. Every thing after this index is excluded. If provided as a dict, the keys should be
data_list[0].time_axes.- datasets
Sequence[str], optional Which datasets to include. Default is all of them.
- dataset_filter
callable(), optional Function for preprocessing all datasets. Useful for changing data types etc. Takes a dataset as an argument and should return a dataset (either h5py or memdata). Optionally may accept a second argument that is slice along the time axis, which the filter should apply.
- convert_attribute_stringsbool, optional
Try and convert attribute string types to unicode. Default is True.
- convert_dataset_stringsbool, optional
Try and convert dataset string types to unicode. Default is False.
- data_list
- Returns:
- dataset
TOData Concatenated time-ordered data.
- dataset