NonLinearResponse

class sofia_redux.scan.channels.mode.non_linear_response.NonLinearResponse(mode, gain_provider=None, name=None)[source]

Bases: Response

Create a non-linear response mode.

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 non-linear response mode contains the additional get_signal method to extract a Signal object from an integration. In this case, the final signal is dependent on a parent mode.

Parameters:
modeMode, 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).

Methods Summary

derive_gains(integration[, robust])

Return gains and weights derived from an integration.

get_signal(integration)

Get a signal from an integration.

update_signal(integration)

Update the signal based on the parent signal values.

Methods Documentation

derive_gains(integration, robust=True)[source]

Return gains and weights derived from an integration.

The returned values are the integration gains plus the mode gains. Weights are determined from only the integration.

Parameters:
integrationIntegration
robustbool, optional

If True, derives the gain increment from the integration using the “robust” definition. This is only applicable if the integration is not phase modulated.

Returns:
gains, weightsnumpy.ndarray (float), numpy.ndarray (float)

The gains and weights derived from the integration and mode. Note that all non-finite values are reset to zero weight and zero value.

get_signal(integration)[source]

Get a signal from an integration.

The signal values are initially set to zero before being updated by the parent signal with drifts removed. Note that this may appear confusing at first: the signal belongs to the integration and is created for the integration if necessary.

Parameters:
integrationIntegration
Returns:
signalSignal
update_signal(integration)[source]

Update the signal based on the parent signal values.

The signal values are set to the square of the parent signal values plus parent drifts. i.e. (parent values + parent drifts)^2. The drifts are then moved from this squared parent signal values.

In other words, values = (parent_values + parent_drifts)^2 - f(drifts).

Parameters:
integrationIntegration
Returns:
None