MotionFlags

class sofia_redux.scan.flags.motion_flags.MotionFlags(direction)[source]

Bases: Flags

Initialize a MotionFlags object.

Unlike most other flag classes, the MotionFlags class can be initialized for use in extracting motion signals from a given position. The given position object (passed into MotionFlags.__call__() or MotionFlags.get_value()) must have retrievable values in the ‘x’, ‘y’, or ‘z’ attribute.

Parameters:
directionint or str or enum.Enum

The direction from which the MotionFlags object will extract position signals. For example, direction='x^2' will return the value of the ‘x’ attribute squared from any given object.

Attributes Summary

descriptions

letters

position_functions

Methods Summary

__call__(position)

Get the value for a given position.

convert_flag(flag)

Convert a given user flag to a standard flag Enum.

get_value(position)

Return a value for the given position.

Attributes Documentation

descriptions = {<MotionFlagTypes.CHOPPER: 8192>: 'Chopper', <MotionFlagTypes.MAGNITUDE: 512>: 'Magnitude', <MotionFlagTypes.NORM: 1024>: 'Norm', <MotionFlagTypes.PROJECT_GLS: 16384>: 'Project GLS', <MotionFlagTypes.SCANNING: 4096>: 'Scanning', <MotionFlagTypes.TELESCOPE: 2048>: 'Telescope', <MotionFlagTypes.X2: 8>: 'x^2', <MotionFlagTypes.X: 1>: 'x', <MotionFlagTypes.X_MAGNITUDE: 64>: '|x|', <MotionFlagTypes.Y2: 16>: 'y^2', <MotionFlagTypes.Y: 2>: 'y', <MotionFlagTypes.Y_MAGNITUDE: 128>: '|y|', <MotionFlagTypes.Z2: 32>: 'z^2', <MotionFlagTypes.Z: 4>: 'z', <MotionFlagTypes.Z_MAGNITUDE: 256>: '|z|'}
letters = {'M': <MotionFlagTypes.MAGNITUDE: 512>, 'X': <MotionFlagTypes.X_MAGNITUDE: 64>, 'Y': <MotionFlagTypes.Y_MAGNITUDE: 128>, 'Z': <MotionFlagTypes.Z_MAGNITUDE: 256>, 'c': <MotionFlagTypes.CHOPPER: 8192>, 'i': <MotionFlagTypes.X2: 8>, 'j': <MotionFlagTypes.Y2: 16>, 'k': <MotionFlagTypes.Z2: 32>, 'n': <MotionFlagTypes.NORM: 1024>, 'p': <MotionFlagTypes.PROJECT_GLS: 16384>, 's': <MotionFlagTypes.SCANNING: 4096>, 't': <MotionFlagTypes.TELESCOPE: 2048>, 'x': <MotionFlagTypes.X: 1>, 'y': <MotionFlagTypes.Y: 2>, 'z': <MotionFlagTypes.Z: 4>}
position_functions = {<MotionFlagTypes.MAGNITUDE: 512>: <function MotionFlags.<lambda>>, <MotionFlagTypes.NORM: 1024>: <function MotionFlags.<lambda>>, <MotionFlagTypes.X2: 8>: <function MotionFlags.<lambda>>, <MotionFlagTypes.X: 1>: <function MotionFlags.<lambda>>, <MotionFlagTypes.X_MAGNITUDE: 64>: <function MotionFlags.<lambda>>, <MotionFlagTypes.Y2: 16>: <function MotionFlags.<lambda>>, <MotionFlagTypes.Y: 2>: <function MotionFlags.<lambda>>, <MotionFlagTypes.Y_MAGNITUDE: 128>: <function MotionFlags.<lambda>>, <MotionFlagTypes.Z2: 32>: <function MotionFlags.<lambda>>, <MotionFlagTypes.Z: 4>: <function MotionFlags.<lambda>>, <MotionFlagTypes.Z_MAGNITUDE: 256>: <function MotionFlags.<lambda>>, <MotionFlagTypes: 0>: <function MotionFlags.<lambda>>}

Methods Documentation

__call__(position)[source]

Get the value for a given position.

Parameters:
positionCoordinate
Returns:
valuefloat or numpy.ndarray or units.Quantity
classmethod convert_flag(flag)[source]

Convert a given user flag to a standard flag Enum.

Parameters:
flagenum.Enum or None or int or str

None will return flag(0). str values will look for that given flag name. Note that unlike the Flags class, the ‘|’ character indicates magnitude rather than a separator for multiple flags.

Returns:
enum.Enum
get_value(position)[source]

Return a value for the given position.

Parameters:
positionCoordinate
Returns:
valuefloat or numpy.ndarray or units.Quantity