VieSched++
VieVS VLBI Scheduling Software
VieVS::Freq Class Reference

FREQ section of observing mode. More...

#include <Freq.h>

Inheritance diagram for VieVS::Freq:
Collaboration diagram for VieVS::Freq:

Classes

class  Chan_def
 Channel definition for observing mode. More...
 

Public Types

enum  Net_sideband {
  Net_sideband::U, Net_sideband::L, Net_sideband::UC, Net_sideband::LC,
  Net_sideband::undefined
}
 net sideband types More...
 

Public Member Functions

 Freq (std::string name)
 constructor More...
 
 Freq (const boost::property_tree::ptree &tree)
 constructor More...
 
void addChannel (std::string bandId, double sky_freq, Net_sideband net_sideband, double chan_bandwidth, std::string chan_id, std::string bbc_id, std::string phase_cal_id)
 add new channel More...
 
boost::property_tree::ptree toPropertytree () const
 converts object to property tree More...
 
std::vector< double > getFrequencies (const std::string &band) const
 get all frequencies for a specific band More...
 
void setSampleRate (double sample_rate)
 set sample rate More...
 
const std::set< std::string > & getBands () const
 get list of all bands More...
 
std::unordered_map< std::string, double > observingRate (const std::shared_ptr< const Freq > &other, const std::map< std::string, int > &bitsPerChannel) const
 calculates observing rates for each band between two stations with potentially different FREQ blocks More...
 
void toVexFreqDefinition (std::ofstream &of, const std::string &comment="") const
 writes FREQ block in vex format More...
 
const std::vector< Chan_def > & getChan_defs () const
 get channel definitions More...
 
std::vector< Chan_def > & refChan_defs ()
 reference channel definitions More...
 
double totalBandwidth () const
 calculate total bandwidth for all channels More...
 
double totalRate (const std::map< std::string, int > &bitsPerChannel) const
 calculate total observing rate More...
 
- Public Member Functions inherited from VieVS::VieVS_NamedObject
 VieVS_NamedObject (std::string name, unsigned long id)
 constructor More...
 
 VieVS_NamedObject (std::string name, std::string alternativeName, unsigned long id)
 constructor More...
 
const std::string & getName () const
 get object name More...
 
const std::string & getAlternativeName () const
 get object alternative name More...
 
bool hasAlternativeName () const
 check if object has alternative name More...
 
bool hasName (const std::string &name) const
 check if object has name More...
 
void changeName (const std::string &newName)
 change name of object More...
 
- Public Member Functions inherited from VieVS::VieVS_Object
 VieVS_Object (unsigned long id)
 constructor More...
 
const unsigned long getId () const
 get object id More...
 
bool hasValidId () const
 check if id is valid More...
 
bool hasId (unsigned long id) const
 check if object has specific id More...
 
void setId (unsigned long id)
 set object id More...
 
std::string printId () const
 object id string More...
 

Static Public Member Functions

static std::string toString (Net_sideband n)
 converts Net_sidband to string More...
 
static Net_sideband netSidebandFromString (const std::string &s)
 convert vex format string to net sideband type More...
 

Private Member Functions

std::pair< double, double > lower_upper_bound (double skyFreq, double bandwidth, Net_sideband net_sideband) const
 calculate lower and upper frequency limit of particular channel More...
 
double overlappingBandwidth (double low1, double up1, double low2, double up2) const
 calculate overlapping bandwidth More...
 

Private Attributes

double sample_rate_
 sample frequency in MHz More...
 
std::vector< Chan_defchan_defs_
 list of channels More...
 
std::set< std::string > bands_
 list of bands More...
 

Static Private Attributes

static unsigned long nextId = 0
 next id for this object type More...
 

Detailed Description

FREQ section of observing mode.

following vex standard The $FREQ block describes the RF sky Frequency, net sideband, and bandwidth characteristics of the channels recorded, where a 'channel' is defined as a single USB or LSB output from a BBC. The $FREQ block does not attempt to describe the recording mode (including format, sample rate, bits per sample, and sample type), since the same set of channels may be recorded in different recording modes (or on different equipment) at different stations. Each frequency channel is defined by a chan_def statement with at least seven fields in each statement.

Author
Matthias Schartner
Date
17.09.2018

Member Enumeration Documentation

net sideband types

Author
Matthias Schartner
Enumerator

upper side band

lower side band

UC 

upper side band I/Q encoding

LC 

lower side band I/Q encoding

undefined 

undefined

Constructor & Destructor Documentation

Freq::Freq ( std::string  name)
explicit

constructor

Author
Matthias Schartner
Parameters
nameFREQ name

Here is the caller graph for this function:

Freq::Freq ( const boost::property_tree::ptree &  tree)
explicit

constructor

Author
Matthias Schartner
Parameters
treeinput property tree from xml file

Member Function Documentation

void Freq::addChannel ( std::string  bandId,
double  sky_freq,
Freq::Net_sideband  net_sideband,
double  chan_bandwidth,
std::string  chan_id,
std::string  bbc_id,
std::string  phase_cal_id 
)

add new channel

Author
Matthias Schartner
Parameters
bandId'Band_ID': RF band name
sky_freqRF sky frequency at 0Hz in the BBC output
net_sidebandNet sideband of this BBC channel
chan_bandwidthBBC Channel bandwidth
chan_id'Chan_ID': Logical channel name
bbc_id'BBC_ID': Logical BBC name
phase_cal_id'Phase-cal_ID': Logical phase-cal name

Here is the caller graph for this function:

const std::set<std::string>& VieVS::Freq::getBands ( ) const
inline

get list of all bands

Author
Matthias Schartner
Returns
list of all bands

Here is the call graph for this function:

const std::vector<Chan_def>& VieVS::Freq::getChan_defs ( ) const
inline

get channel definitions

Author
Matthias schartner

necessary for custom observing mode in GUI

Returns
all channel definitions
std::vector< double > Freq::getFrequencies ( const std::string &  band) const

get all frequencies for a specific band

Author
Matthias Schartner
Parameters
bandtarget band
Returns
list of all frequencies in this band

Here is the caller graph for this function:

std::pair< double, double > Freq::lower_upper_bound ( double  skyFreq,
double  bandwidth,
Freq::Net_sideband  net_sideband 
) const
private

calculate lower and upper frequency limit of particular channel

Author
Matthias Schartner
Parameters
skyFreqsky frequency in MHz
bandwidthbandwidth in MHz
net_sidebandnet sideband
Returns
lower and upper limit

Here is the caller graph for this function:

static Net_sideband VieVS::Freq::netSidebandFromString ( const std::string &  s)
inlinestatic

convert vex format string to net sideband type

Author
Matthias Schartner
Parameters
snet sideband name in vex format
Returns
net sideband type

Here is the call graph for this function:

Here is the caller graph for this function:

std::unordered_map< std::string, double > Freq::observingRate ( const std::shared_ptr< const Freq > &  other,
const std::map< std::string, int > &  bitsPerChannel 
) const

calculates observing rates for each band between two stations with potentially different FREQ blocks

Author
Matthias Schartner
Parameters
other2nd FREQ block
bitsPerChannelnumber of sampled bits per channel
Returns
total mutual observing rate per band

Here is the call graph for this function:

Here is the caller graph for this function:

double Freq::overlappingBandwidth ( double  low1,
double  up1,
double  low2,
double  up2 
) const
private

calculate overlapping bandwidth

Author
Matthias Schartner
Parameters
low1lower limit of first channel in MHz
up1upper limit of first channel in MHz
low2lower limit of second channel in MHz
up2upper limit of second channel in MHz
Returns
overlapping bandwidth in MHz

Here is the caller graph for this function:

std::vector<Chan_def>& VieVS::Freq::refChan_defs ( )
inline

reference channel definitions

Author
Matthias schartner

necessary for custom observing mode in GUI

Returns
reference to all channel definitions

Here is the call graph for this function:

void VieVS::Freq::setSampleRate ( double  sample_rate)
inline

set sample rate

Author
Matthias Schartner
Parameters
sample_rateSample frequency
boost::property_tree::ptree Freq::toPropertytree ( ) const

converts object to property tree

Author
Matthias Schartner
Returns
property tree

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string VieVS::Freq::toString ( Net_sideband  n)
inlinestatic

converts Net_sidband to string

Author
Matthias Schartner
Parameters
nNet_sideband type
Returns
name in vex format

Here is the caller graph for this function:

double Freq::totalBandwidth ( ) const

calculate total bandwidth for all channels

Author
Matthias Schartner
Returns
total bandwidth in MHz

Here is the caller graph for this function:

double Freq::totalRate ( const std::map< std::string, int > &  bitsPerChannel) const

calculate total observing rate

Author
Matthias Schartner
Parameters
bitsPerChannelnumber of sampled bits per channel
Returns
total observing rate

Here is the caller graph for this function:

void Freq::toVexFreqDefinition ( std::ofstream &  of,
const std::string &  comment = "" 
) const

writes FREQ block in vex format

Author
Matthias Schartner
Parameters
ofvex file stream
commentoptional comment

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::set<std::string> VieVS::Freq::bands_
private

list of bands

std::vector<Chan_def> VieVS::Freq::chan_defs_
private

list of channels

unsigned long VieVS::Freq::nextId = 0
staticprivate

next id for this object type

double VieVS::Freq::sample_rate_
private

sample frequency in MHz


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