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: 'Chopper', MotionFlagTypes.MAGNITUDE: 'Magnitude', MotionFlagTypes.NORM: 'Norm', MotionFlagTypes.PROJECT_GLS: 'Project GLS', MotionFlagTypes.SCANNING: 'Scanning', MotionFlagTypes.TELESCOPE: 'Telescope', MotionFlagTypes.X: 'x', MotionFlagTypes.X2: 'x^2', MotionFlagTypes.X_MAGNITUDE: '|x|', MotionFlagTypes.Y: 'y', MotionFlagTypes.Y2: 'y^2', MotionFlagTypes.Y_MAGNITUDE: '|y|', MotionFlagTypes.Z: 'z', MotionFlagTypes.Z2: 'z^2', MotionFlagTypes.Z_MAGNITUDE: '|z|'}
letters = {'M': MotionFlagTypes.MAGNITUDE, 'X': MotionFlagTypes.X_MAGNITUDE, 'Y': MotionFlagTypes.Y_MAGNITUDE, 'Z': MotionFlagTypes.Z_MAGNITUDE, 'c': MotionFlagTypes.CHOPPER, 'i': MotionFlagTypes.X2, 'j': MotionFlagTypes.Y2, 'k': MotionFlagTypes.Z2, 'n': MotionFlagTypes.NORM, 'p': MotionFlagTypes.PROJECT_GLS, 's': MotionFlagTypes.SCANNING, 't': MotionFlagTypes.TELESCOPE, 'x': MotionFlagTypes.X, 'y': MotionFlagTypes.Y, 'z': MotionFlagTypes.Z}
position_functions = {MotionFlagTypes.MAGNITUDE: <function MotionFlags.<lambda>>, MotionFlagTypes.NORM: <function MotionFlags.<lambda>>, MotionFlagTypes.None: <function MotionFlags.<lambda>>, MotionFlagTypes.X: <function MotionFlags.<lambda>>, MotionFlagTypes.X2: <function MotionFlags.<lambda>>, MotionFlagTypes.X_MAGNITUDE: <function MotionFlags.<lambda>>, MotionFlagTypes.Y: <function MotionFlags.<lambda>>, MotionFlagTypes.Y2: <function MotionFlags.<lambda>>, MotionFlagTypes.Y_MAGNITUDE: <function MotionFlags.<lambda>>, MotionFlagTypes.Z: <function MotionFlags.<lambda>>, MotionFlagTypes.Z2: <function MotionFlags.<lambda>>, MotionFlagTypes.Z_MAGNITUDE: <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