swiftsimio.subset_writer module
Functions for reading a subset of a SWIFT dataset and writing it to a new file.
- swiftsimio.subset_writer.write_subset(output_file: str, mask: SWIFTMask, allow_unconstrained: bool = False) None[source]
Write subset of data according to specified mask to new data file.
- Parameters:
output_file (str) – Path to output file for data subset.
mask (SWIFTMask) – The mask used to define subset that is written to new snapshot.
allow_unconstrained (bool) – Set to
Trueto allow a mask with no constraints applied, this would normally result in a full copy of the data to a new file.
- Raises:
ValueError – If the
maskhas no constraints applied, unlessallow_unconstrainedis set toTrue.