VariedFilter¶
- class sofia_redux.scan.filters.varied_filter.VariedFilter(integration=None, data=None)[source]¶
Bases:
Filter
Initialize an integration varied filter.
The filter is designed to filter integration data using an FFT. The varied filter also contains a source profile, point response, and
dp
or delta dependents for channels. This is an abstract class used to model a varying filter response across frequencies.- Parameters:
- integrationIntegration, optional
- datanumpy.ndarray (float), optional
An array of shape (nt, n_channels) where nt is the nearest power of 2 integer above the number of integration frames. i.e., if n_frames=5, nt=8, or if n_frames=13, nt=16. If not provided will be set to frame_data * frame_relative_weight.
Attributes Summary
Return attributes that are dependent on the parent channels.
Methods Summary
calc_point_response
([channels])Return the point response of the source profile.
dft_filter
([channels])Return the filter rejection using a discrete FFT.
Return the configuration name.
get_id
()Return the filter ID.
Return the mean point response of the filter.
get_point_response
([channels])Return the point response for the filter.
Return the source profile of the varied filter.
post_filter_channels
([channels])Performs the post-filtering channels steps.
pre_filter_channels
([channels])Performs the pre-filtering channels steps.
remove_from_frames
(rejected_signal, frames, ...)Remove the rejected signal from frame data.
response_at
(fch)Return the response at a given frequency channel(s).
set_integration
(integration)Set the varied filter integration.
Create the source profile based on integration crossing time.
Attributes Documentation
- channel_dependent_attributes¶
Return attributes that are dependent on the parent channels.
This is required during a slim operation (reducing number of channels).
- Returns:
- set (str)
Methods Documentation
- calc_point_response(channels=None)[source]¶
Return the point response of the source profile.
- channelsChannelGroup, optional
The channel group for which to calculate the point response. The default is all filtering channels.
The point response is given as:
sum(profile <below hi-pass>) + sum(profile * response <above hi-pass>) divided by the
source_norm
attribute.- Returns:
- responsenumpy.ndarray (float)
The point response for each channel of shape (n_channels,).
- dft_filter(channels=None)[source]¶
Return the filter rejection using a discrete FFT.
UNSUPPORTED FOR THE VARIED FILTER.
- Parameters:
- channelsChannelGroup, optional
The channel group for which the filtering applied. By default, set to the filtering channels.
- Returns:
- None
- get_mean_point_response()[source]¶
Return the mean point response of the filter.
- Returns:
- responsefloat
- get_point_response(channels=None)[source]¶
Return the point response for the filter.
- Parameters:
- channelsChannelGroup, optional
The channels for which to extract the point response. The default is the filtering channels.
- Returns:
- point_responsenumpy.ndarray (float)
The point response for the given channels.
- get_source_profile()[source]¶
Return the source profile of the varied filter.
- Returns:
- source_profilenumpy.ndarray (float)
The source profile of shape (nf + 1) where nf = nt // 2 and nt = pow2ceil(integration.size).
- post_filter_channels(channels=None)[source]¶
Performs the post-filtering channels steps.
- Parameters:
- channelsChannelGroup, optional
The channel group for which to perform the post-filtering step. If not supplied, defaults to the filtering channels.
- Returns:
- None
- pre_filter_channels(channels=None)[source]¶
Performs the pre-filtering channels steps.
- Parameters:
- channelsChannelGroup, optional
The channel group for which to perform the pre-filtering step. If not supplied, defaults to the filtering channels.
- Returns:
- None
- remove_from_frames(rejected_signal, frames, channels)[source]¶
Remove the rejected signal from frame data.
- Parameters:
- rejected_signalnumpy.ndarray (float)
The rejected signal of shape (filtering_channels.size, n_frames).
- framesFrames
The frames for which to remove the rejected signal.
- channelsChannelGroup
The channel for which to subtract the signal.
- Returns:
- None
- abstract response_at(fch)[source]¶
Return the response at a given frequency channel(s).
- Parameters:
- fchint or numpy.ndarray (int or bool) or slice
The frequency channel or channels in question.
- Returns:
- responsenumpy.ndarray (float)