pipeline.domain.spectralwindow.Channel
- class Channel(start: Frequency, end: Frequency, effective_bw: Frequency)[source]
Bases:
objectRepresentation of a channel within a spectral window.
This object can be considered as a FrequencyRange object plus an effective bandwidth property. It provides the same interface as a FrequencyRange.
- frequency_range
FrequencyRange object denoting the low- and high-end frequencies of this channel (in Hertz).
- effective_bw
The effective bandwidth of this channel (in Hertz).
Methods
Returns whether the Channel contains given frequency (range).
Converts both endpoints of this Channel (frequency range) to the given units.
Returns the center frequency of the Channel.
Returns a new frequency range that represents the region of frequency space between this Channel (frequency range) and
other.Return a new frequency range that represents the region of overlap between this Channel (frequency range) and "other".
Returns the width of the Channel.
Returns whether this Channel overlaps with given
otherChannel.Set frequency range for this Channel based on given frequency endpoints.
Attributes
Returns the high end frequency of the Channel.
Return the low end frequency of the Channel.
- __init__(start: Frequency, end: Frequency, effective_bw: Frequency) None[source]
Creates a new Channel with the given start and end frequency and effective bandwidth.
- Parameters:
start -- Start frequency of channel (in Hertz).
end -- End frequency of channel (in Hertz).
effective_bw -- Effective bandwidth of channel (in Hertz).
- contains(frequency: Frequency | FrequencyRange) bool[source]
Returns whether the Channel contains given frequency (range).
- convert_to(newUnits: dict = {'hz': Decimal('1E+9'), 'name': 'GIGAHERTZ', 'symbol': 'GHz'}) FrequencyRange[source]
Converts both endpoints of this Channel (frequency range) to the given units.
This converts the endpoint frequency of the endpoints in-place, as well as returns a reference to the frequency range of this Channel.
- Parameters:
newUnits -- New units to convert the frequencies to. By default, this will convert to Gigahertz.
- getGapBetween(other: FrequencyRange) FrequencyRange | None[source]
Returns a new frequency range that represents the region of frequency space between this Channel (frequency range) and
other. If the other range is coincident with, or overlaps, this Channel, None is returned. If the other range is None, None is returned.- Parameters:
other -- Channel/frequency range for which to assess frequency gap with this Channel.
- Returns:
The frequency gap between this range and
other.
- getOverlapWith(other: FrequencyRange) FrequencyRange[source]
Return a new frequency range that represents the region of overlap between this Channel (frequency range) and "other". If there is no overlap, None is returned.
- Parameters:
other -- Another frequency range that may overlap this Channel.
- Returns:
FrequencyRange object representing the overlapping region of this range and other, or None if there is no overlap.
- overlaps(other: Channel) bool[source]
Returns whether this Channel overlaps with given
otherChannel.The Channel spans a frequency range that is a closed interval, that is, one that contains both of its endpoints.
- Parameters:
other -- Another Channel (frequency range) that may overlap this one.
- Returns:
True if this Channel overlaps with
other. Ifotheris not a Channel, the return value is False.