AdaptiveFilter¶
- class sofia_redux.scan.filters.adaptive_filter.AdaptiveFilter(integration=None, data=None)[source]¶
Bases:
VariedFilter
Initialize an integration adaptive filter.
The adaptive filter is an abstract class where each channel has an individual frequency response (see
VariedFilter
).- 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
accumulate_profiles
([channels])Accumulates the channel profiles into a single profile.
calc_point_response
([channels])Return the point response of the source profile.
count_parms
([channels])Return the rejection filter sum above the high pass frequency.
Return the configuration name.
get_id
()Return the filter ID.
Return the adaptive filter profile.
get_valid_profiles
([channels])Return the valid channel profiles.
post_filter_channels
([channels])Performs the post-filtering channels steps.
resample
(old_profile, new_profile)ResamplePolynomial the old profile to a new profile.
response_at
(fch)Return the response at a given frequency channel(s).
set_integration
(integration)Set the varied filter integration.
set_size
(nf)Set the number of frequencies in the adaptive filter.
Update the filter source profile.
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
- accumulate_profiles(channels=None)[source]¶
Accumulates the channel profiles into a single profile.
- Parameters:
- channelsChannelGroup, optional
The channel group for which to accumulate profiles.
- The accumulated profile is the multiplication of each channel profile.
- Returns:
- None
- 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,).
- count_parms(channels=None)[source]¶
Return the rejection filter sum above the high pass frequency.
- channelsChannelGroup, optional
The channel group for which to determine dependents. The default is all filtering channels.
- Returns:
- dependentsnumpy.ndarray (float)
An array of shape (n_channels,).
- get_valid_profiles(channels=None)[source]¶
Return the valid channel profiles.
- Parameters:
- channelsChannelGroup, optional
The channel group for which to get profiles. The default is all filtering channels.
- Returns:
- channel_profilesnumpy.ndarray (float)
- 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
- resample(old_profile, new_profile)[source]¶
ResamplePolynomial the old profile to a new profile.
- Parameters:
- old_profilenumpy.ndarray (float)
An array of shape (n_channels, n1) containing the current profile.
- new_profilenumpy.ndarray (float)
The new array of shape (n_channels, n2) to populate.
- Returns:
- None
- 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)
The response array of shape (n_channels,) or (n_channels, fch.size).
- set_integration(integration)[source]¶
Set the varied filter integration.
Sets the padding of the FFT filter, the number of frequencies, the frequency spacing, and retrieves the channels from the integration if necessary.
- Parameters:
- integrationIntegration
- Returns:
- None