CorrelatedModality

class sofia_redux.scan.channels.modality.correlated_modality.CorrelatedModality(name=None, identity=None, channel_division=None, gain_provider=None, mode_class=None)[source]

Bases: Modality

Create a correlated modality.

A Modality is a collection of channel modes. A channel mode extracts/sets/operates-on gains from a channel group (collection of channels). Modes are created by the modality from a channel division which is a collection of channel groups. The type of mode may be explicitly defined or will be set to a default mode class for the modality.

The name of the modality should be set, as it is used by the modality to apply specific configuration options.

The correlated modality is similar to the standard Modality but allows additional functionality to operate on correlated modes such as the ability to update signals in an integration.

Parameters:
namestr, optional

The name of the modality.

identitystr, optional

A shorthand abbreviation for the modality.

channel_divisionChannelDivision, optional

A ChannelDivision object containing groups from which to create channel modes.

gain_providerGainProvider or str, optional

If a string is provided, a FieldGainProvider will be created that defined the gain as that field of the channel group data. If a gain provider is explicitly provided, it will be used instead.

mode_classMode, optional

The mode class to be used when creating modes from the channel groups inside the channel division. If not supplied, the default mode class for a modality will be used.

Methods Summary

set_options(configuration[, branch])

Apply a configuration to the modality and modes therein.

set_skip_flags(gain_skip_flag)

Sets the gain skip flags in each mode of the modality.

update_signals(integration[, robust])

Update integration signals for each mode in the modality.

Methods Documentation

set_options(configuration, branch=None)[source]

Apply a configuration to the modality and modes therein.

The following information is extracted and applied:

  1. resolution (in seconds)

  2. triggers

  3. whether to solve for gains

  4. whether phase gains are used

  5. the gain range

  6. whether SIGNED or BIDIRECTIONAL gain flagging should be applied

  7. whether no gain fields exist (gain provider is disabled)

  8. whether to solve signals.

Parameters:
configurationConfiguration or dict

Either a configuration object, or a specific subsection of a configuration relevant to the modality.

branchstr, optional

If a configuration object was provided, specifies the branch that applies to this modality. If not supplied, the branch name is defined as the modality name.

Returns:
None
set_skip_flags(gain_skip_flag)[source]

Sets the gain skip flags in each mode of the modality.

Parameters:
gain_skip_flagChannelFlagTypes or str or int

The gain flag marking channel types that should not be considered valid channels. A string can be supplied such as ‘GAIN’, ‘DEAD’, etc., the flag type itself, or an integer. Integers should be used with care since meaning may vary between various flag types.

Returns:
None
update_signals(integration, robust=False)[source]

Update integration signals for each mode in the modality.

Parameters:
integrationIntegration
robustbool, optional

If True, use the “robust” method to update signals.

Returns:
None