MotionResponse

class sofia_redux.scan.channels.mode.motion_response.MotionResponse(channel_group=None, gain_provider=None, name=None)[source]

Bases: Response

An abstract response mode class.

A mode is an object that is applied to a given channel group, defining what constitutes its “gain” and how to operate thereon. This is also dependent on a gain provider.

The motion response is designed to extract a signal from an integration based on some function of position, defined by a specific direction operator. The direction operator is an instance of the MotionFlags class.

Parameters:
channel_groupChannelGroup, optional

The channel group owned by the mode.

gain_providerstr or GainProvider, optional

If a string is provided a FieldGainProvider will be set to operate on the given field of the channel group.

namestr, optional

The name of the mode. If not provided, will be determined from the channel group name (if available). To set the direction, the name should be of the form <name>-<direction> or <name>:<direction>.

Methods Summary

get_signal(integration)

Return a signal object from an integration.

get_signal_from_direction(integration, direction)

Return a signal object from an integration and direction.

set_direction(direction)

Set the direction attribute to a MotionFlags instance.

set_name([name])

Set the name of the mode.

Methods Documentation

get_signal(integration)[source]

Return a signal object from an integration.

Parameters:
integrationIntegration
Returns:
Signal
abstract get_signal_from_direction(integration, direction)[source]

Return a signal object from an integration and direction.

Parameters:
integrationIntegration
directionMotionFlags
Returns:
Signal
set_direction(direction)[source]

Set the direction attribute to a MotionFlags instance.

Parameters:
directionstr or MotionFlags.flags
Returns:
None
set_name(name=None)[source]

Set the name of the mode.

If not provided, the name will be determined from the channel group. If no channel group is available, the name will not be set. If the direction can be determined from the name, it will be set here.

Parameters:
namestr, optional

The new name of the mode. To set the direction, the name should be of the form <name>-<direction> or <name>:<direction>.

Returns:
None