pipeline.domain.spectralwindow.Channel

class Channel(start: Frequency, end: Frequency, effective_bw: Frequency)[source]

Bases: object

Representation 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

contains

Returns whether the Channel contains given frequency (range).

convert_to

Converts both endpoints of this Channel (frequency range) to the given units.

getCentreFrequency

Returns the center frequency of the Channel.

getGapBetween

Returns a new frequency range that represents the region of frequency space between this Channel (frequency range) and other.

getOverlapWith

Return a new frequency range that represents the region of overlap between this Channel (frequency range) and "other".

getWidth

Returns the width of the Channel.

overlaps

Returns whether this Channel overlaps with given other Channel.

set

Set frequency range for this Channel based on given frequency endpoints.

Attributes

frequency_range

effective_bw

high

Returns the high end frequency of the Channel.

low

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.

getCentreFrequency() Frequency[source]

Returns the center frequency of the Channel.

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.

getWidth() Frequency[source]

Returns the width of the Channel.

property high: Frequency

Returns the high end frequency of the Channel.

property low: Frequency

Return the low end frequency of the Channel.

overlaps(other: Channel) bool[source]

Returns whether this Channel overlaps with given other Channel.

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. If other is not a Channel, the return value is False.

set(frequency1: Frequency, frequency2: Frequency) None[source]

Set frequency range for this Channel based on given frequency endpoints.

Parameters:
  • frequency1 -- One endpoint of frequency range for this Channel.

  • frequency2 -- Other endpoint of frequency range for this Channel.