WSClean
Public Types | Public Member Functions | Static Public Member Functions | List of all members
BandData Class Reference

Contains information about a single band ("spectral window"). More...

#include <banddata.h>

Public Types

typedef std::reverse_iterator< const double * > const_reverse_iterator
 
typedef std::reverse_iterator< double * > reverse_iterator
 

Public Member Functions

 BandData ()
 Construct an empty instance.
 
 BandData (casacore::MSSpectralWindow &spwTable)
 Construct an instance from a spectral window table. More...
 
 BandData (casacore::MSSpectralWindow &spwTable, size_t bandIndex)
 Construct an instance from a specified entry of a spectral window table. More...
 
 BandData (const BandData &source)
 Copy constructor. More...
 
 BandData (const BandData &source, size_t startChannel, size_t endChannel)
 Construct a new instance from a part of another band. More...
 
 BandData (size_t channelCount, const double *frequencies)
 Construct a new BandData class and initialize it with an array of frequencies. More...
 
 ~BandData ()
 Destructor. More...
 
double BandEnd () const
 Get the end of the frequency range covered by this band. More...
 
double BandStart () const
 Get the start of the frequency range covered by this band. More...
 
double Bandwidth () const
 Get the total bandwidth covered by this band. More...
 
double * begin ()
 Iterator over frequencies, pointing to first channel.
 
const double * begin () const
 Constant iterator over frequencies, pointing to first channel.
 
double CentreFrequency () const
 Get the centre frequency. More...
 
double CentreWavelength () const
 Get the wavelength of the central channel. More...
 
size_t ChannelCount () const
 Retrieve number of channels in this band. More...
 
double ChannelFrequency (size_t channelIndex) const
 Get the frequency in Hz of a specified channel. More...
 
double ChannelWavelength (size_t channelIndex) const
 Get the wavelength in m of a specified channel. More...
 
double * end ()
 Iterator over frequencies, pointing past last channel.
 
const double * end () const
 Constant iterator over frequencies, pointing to last channel.
 
double FrequencyStep () const
 Get the distance between channels in Hz. More...
 
double HighestFrequency () const
 Get the frequency of the last channel. More...
 
double LongestWavelength () const
 Get the wavelength of the first channel. More...
 
double LowestFrequency () const
 Get the frequency of the first channel. More...
 
void operator= (const BandData &source)
 Assignment operator.
 
std::reverse_iterator< double * > rbegin ()
 
std::reverse_iterator< const double * > rbegin () const
 
std::reverse_iterator< double * > rend ()
 
std::reverse_iterator< const double * > rend () const
 
void Set (size_t channelCount, const double *frequencies)
 Assign new frequencies to this instance. More...
 
double SmallestWavelength () const
 Get the wavelength of the last channel. More...
 

Static Public Member Functions

static double FrequencyToLambda (double frequencyHz)
 Convert a frequency to a wavelength. More...
 

Detailed Description

Contains information about a single band ("spectral window").

A band consists of a sequence of contiguous channels.

Constructor & Destructor Documentation

BandData::BandData ( casacore::MSSpectralWindow &  spwTable)
inline

Construct an instance from a spectral window table.

The spectral window table can only have a single entry, otherwise an exception is thrown.

Parameters
spwTableThe CASA Measurement Set spectral window table.
BandData::BandData ( casacore::MSSpectralWindow &  spwTable,
size_t  bandIndex 
)
inline

Construct an instance from a specified entry of a spectral window table.

Parameters
spwTableThe CASA Measurement Set spectral window table.
bandIndexThe entry index of the spectral window table.
BandData::BandData ( const BandData source)
inline

Copy constructor.

Parameters
sourceCopied to the new banddata.
BandData::BandData ( const BandData source,
size_t  startChannel,
size_t  endChannel 
)
inline

Construct a new instance from a part of another band.

Parameters
sourceInstance that is partially copied.
startChannelStart of range of channels that are copied.
endChannelEnd of range, exclusive.
BandData::BandData ( size_t  channelCount,
const double *  frequencies 
)
inline

Construct a new BandData class and initialize it with an array of frequencies.

Parameters
channelCountNumber of channels in the new instance.
frequenciesArray of channelCount doubles containing the channel frequencies.
BandData::~BandData ( )
inline

Destructor.

Member Function Documentation

double BandData::BandEnd ( ) const
inline

Get the end of the frequency range covered by this band.

Returns
End of the band in Hz.
double BandData::BandStart ( ) const
inline

Get the start of the frequency range covered by this band.

Returns
Start of the band in Hz.
double BandData::Bandwidth ( ) const
inline

Get the total bandwidth covered by this band.

Returns
Bandwidth in Hz.
double BandData::CentreFrequency ( ) const
inline

Get the centre frequency.

Returns
0.5 * (HighestFrequency + LowestFrequency)
double BandData::CentreWavelength ( ) const
inline

Get the wavelength of the central channel.

Returns
Central channel wavelength.
size_t BandData::ChannelCount ( ) const
inline

Retrieve number of channels in this band.

Returns
Number of channels.
double BandData::ChannelFrequency ( size_t  channelIndex) const
inline

Get the frequency in Hz of a specified channel.

Parameters
channelIndexZero-indexed channel index.
double BandData::ChannelWavelength ( size_t  channelIndex) const
inline

Get the wavelength in m of a specified channel.

Parameters
channelIndexZero-indexed channel index.
double BandData::FrequencyStep ( ) const
inline

Get the distance between channels in Hz.

Returns
Distance between channels.
static double BandData::FrequencyToLambda ( double  frequencyHz)
inlinestatic

Convert a frequency to a wavelength.

Parameters
frequencyHzFrequency in Hz.
Returns
Wavelength in m.
double BandData::HighestFrequency ( ) const
inline

Get the frequency of the last channel.

Returns
Highest frequency.
double BandData::LongestWavelength ( ) const
inline

Get the wavelength of the first channel.

Returns
longest wavelength.
double BandData::LowestFrequency ( ) const
inline

Get the frequency of the first channel.

Returns
Lowest frequency.
void BandData::Set ( size_t  channelCount,
const double *  frequencies 
)
inline

Assign new frequencies to this instance.

Parameters
channelCountNumber of channels.
frequenciesArray of channelCount doubles containing the channel frequencies.
double BandData::SmallestWavelength ( ) const
inline

Get the wavelength of the last channel.

Returns
smallest wavelength.

The documentation for this class was generated from the following file: