frequency_bands
- class trap.frequency_bands.FrequencyBands[source]
Bases:
object- static parse_frequency(header, im_path)[source]
Obtain frequency parameters in the FITS file header.
- Parameters:
header (astropy.io.fits.header.Header) – The FITS header from which to read the frequency related parameters
im_path (str) – The path to the image, only used for log warnings.
- Returns:
freq_eff (float) – The effective frequency extracted from the FITS header.
freq_bw (float) – The bandwidth extracted from the FITS header.
- get_frequency_band(im_freq_eff, im_freq_bw)[source]
Get the ID of the frequency band that is related to the given effective frequency and it’s related bandwidth. If there is no frequency band that matches the given parameters, create a new one and return it’s related ID.
- Parameters:
im_freq_eff (float) – The effective frequency
im_freq_bw (float) – The frequency bandwidth
- Returns:
The ID of the band, matching the self.bands dataframe.
- Return type:
int
- plot_freq_bands(effective_frequencies, bandwidths)[source]
Convenience function that plots all frequency bands currently stored in self.bands. It also plots any effective frequency supplied to this function to make it clear which frequency falls into which band.
- Parameters:
effective_frequencies (List) – A list or array of frequencies to plot