get_sample_points¶
- sofia_redux.scan.source_models.source_numba_functions.get_sample_points(frame_data, frame_gains, frame_weights, source_gains, channel_variance, valid_frames, map_indices, channel_indices, sample_flags, exclude_sample_flag)[source]¶
Return the cross-product of frame and channel gains.
- Parameters:
- frame_datanumpy.ndarray (float)
The frame data of shape (n_frames, all_channels).
- frame_gainsnumpy.ndarray (float)
The frame gains of shape (n_frames,).
- frame_weightsnumpy.ndarray (float)
The frame relative weights of shape (n_frames,).
- source_gainsnumpy.ndarray (float)
The channel (pixel) gains of shape (all_channels,)
- channel_variancenumpy.ndarray (float)
The channel (pixel) variances of shape (n_channels,)
- valid_framesnumpy.ndarray (bool)
A boolean mask of shape (n_frames,) where
False
indicates a frame that should be excluded from all calculations.- map_indicesnumpy.ndarray (int)
The map indices of shape (2, n_frames, all_channels) containing the (ix, iy) map indices. For pixel maps, all pixels have zero position, and therefore, map_indices depend solely of frame position. In these cases, the shape should be (2, n_frames, 1) to indicate that only a single channel position is relevant.
- channel_indicesnumpy.ndarray (int)
The channel indices of shape (n_channels,) mapping n_channels onto all_channels.
- sample_flagsnumpy.ndarray (int)
The sample flag array of shape (n_frames, all_channels). Any flag containing
exclude_sample_flag
will be ignored.- exclude_sample_flagint
Indicates which sample flags should be ignored.
- Returns:
- n, data, gains, weights, indices5-tuple (int, array+)
The total number of mapping frames and the cross product of frame_gains and source_gains as an array of shape (n_frames, n_channels). Any invalid frames/sample flags will result in a NaN gain value for the sample in question.