get_source_signal

sofia_redux.scan.source_models.source_numba_functions.get_source_signal(frame_data, frame_valid, frame_gains, frame_weights, channel_flags, channel_variance, map_values, map_valid, map_indices, sync_gains)[source]

Remove map source gains from frame data and flag samples.

For a given sample at frame i and channel j, frame data d_{i,j} will be decremented by dg where:

dg = fg * ( (gain(source) * map[index]) - (gain(sync) * base[index]) )

Here, fg is the frame gain and index is the index on the map of sample (i,j).

Any masked map value will result in matching samples being flagged.

Parameters:
frame_datanumpy.ndarray (float)

The frame data of shape (n_frames, all_channels). Data will be updated in-place.

frame_validnumpy.ndarray (bool)

A boolean mask of shape (n_frames,) where False excludes a frame from all processing.

frame_gainsnumpy.ndarray (float)

An array of frame gains of shape (n_frames,).

frame_weightsnumpy.ndarray (float)

The frame weights of shape (n_frames,).

channel_flagsnumpy.ndarray (int)

The channel flags of shape (n_channels,). Any nonzero value will

channel_variancenumpy.ndarray (int)

The channel variance of shape (n_channels,).

map_valuesnumpy.ndarray (float)

The current map supplied as a regular grid of arbitrary shape and dimensions (image_shape,).

map_validnumpy.ndarray (bool)

A boolean mask of shape (image_shape,) where False excludes a map element from synchronization.

map_indicesnumpy.ndarray (int)

The sample map indices of shape (n_dimensions, n_frames, all_channels) where dimensions are ordered in (x,y) FITS format. These contain map (pixel) indices for each sample. For pixel maps, all pixels will have zero position values, so the array should be of shape (n_dimensions, n_frames, 1) in this case.

sync_gainsnumpy.ndarray (float)

The prior channel source gains of shape (all_channels,).

Returns:
source_signal, source_errornumpy.ndarray, numpy.ndarray