SubsamplingApplier
- class PlasmaCalcs.dimensions.subsampling.SubsamplingApplier(info, *, array_dims, snap_applier=None, **extra_info)
Bases:
objectapplier of a subsampling method.
info: any object
info required for self.apply.array_dims: list of strnames of expected array dimensions in order.May be used to translate between information in info, and an array being subsampled.extra_info: any objectsany extra kwargs will all be saved in self.extra_info.Methods
__init_subclass__(*[, mode])register subclass as a subsampling mode.
apply(array)apply subsampling to array; return new array.
apply1d(dict_)return result of subsampling dict_ of 1d arrays, with keys in array_dims.
apply_snap_applier(snap_srcs, *[, missing_ok])return self.snap_applier(snap_srcs), or snap_srcs unchanged if self.snap_applier=None.
checks that self.info is in the expected format.
- classmethod __init_subclass__(*, mode=None, **kw)
register subclass as a subsampling mode.
- _check_info()
checks that self.info is in the expected format. Crash if not.
- apply(array)
apply subsampling to array; return new array.
- apply1d(dict_)
return result of subsampling dict_ of 1d arrays, with keys in array_dims.
Subclass should raise SubsamplingError if this is not possible.
- apply_snap_applier(snap_srcs, *, missing_ok=True)
return self.snap_applier(snap_srcs), or snap_srcs unchanged if self.snap_applier=None.
missing_ok: bool
whether it is okay for snap_applier to be NoneFalse –> crash with SubsamplingNotFoundError if snap_applier is None.