SubsamplingApplier

class PlasmaCalcs.dimensions.subsampling.SubsamplingApplier(info, *, array_dims, snap_applier=None, **extra_info)

Bases: object

applier of a subsampling method.

info: any object
info required for self.apply.
array_dims: list of str
names of expected array dimensions in order.
May be used to translate between information in info, and an array being subsampled.
extra_info: any objects
any 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.

_check_info()

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 None
False –> crash with SubsamplingNotFoundError if snap_applier is None.