MaskPolicy#
- class pypillometry.MaskPolicy(layers=(), unless=(), nan=True, name=None, exclude=())[source]#
Bases:
objectWhich samples count as unusable (masked).
A sample is masked if its value is NaN (with nan), or if one of the layers is set and none of the layers in unless is set. Recording-wide layers (e.g.,
"excluded") mask a sample regardless of unless.The predefined policies are in POLICIES:
"default"(NaN and all layers are masked: blinks, off-screen gaze, eye divergences, user masks, excluded periods and the layers ofmask_signal()or your own; interpolated samples are used),"strict"(interpolated samples are masked too) and"raw"(nothing is masked, not even NaN). All processing and analysis methods take the policy as their policy argument.- Parameters:
layers (str or list of str) – layers that make a sample unusable;
"*"stands for all layers (except internal ones, whose names start with_)unless (str or list of str) – layers that make a sample usable again (e.g.,
"interpolated": the value was reconstructed)nan (
bool) – NaN values are unusableexclude (str or list of str) – layers that do not make a sample unusable, even with
"*"
Examples
>>> d.mask("left", "pupil", policy=MaskPolicy(["blink"]))
Details