casa
$Rev:20696$
|
#include <MsPlotConvert.h>
Public Member Functions | |
MSPlotConvertChanToFreq (Vector< Int > inIds, MsPlot *inMsPlot, Bool inAveOn, Vector< Vector< Int > > &inStartChans, Vector< Vector< Int > > &inEndChans, Vector< Vector< Int > > &inStepChans, Bool onXAxis) | |
Constructor. | |
void | showConverter () |
~MSPlotConvertChanToFreq () | |
Destructor. | |
void | setSpwIds (Vector< Int > inIds) |
This is a MAJOR HACK to support multiple spws!!! Just a word of warning that this really needs to be cleaned up at some point. | |
Double | Xconvert_col (Double x, Int row, Int tblnum) |
Conversion along the Xaxis. | |
Double | Yconvert_col (Double y, Int row, Int tblnum) |
Conversion along the Yaxis. | |
Protected Member Functions | |
Int | getSpwId (Int tblNum) |
Check if the supplied table ID is smaller then our list of Ids. | |
Vector< Int > | getChannelRange (Double aveChanValue, Int spwId) |
If the averaging is on then the channel value passed in is an averaged channel value. | |
Double | getAveFreq (Vector< Int > chanRange, Int tblNum) |
Get the averaged frequency for the averaged channel value. | |
Double | getFreq (Int channel, Int spwId) |
Get the frequency associated with this channel Routine based on demo4 in tTablePlot.cc, written by Urvashi R.V. | |
Private Attributes | |
MsPlot * | itsMsPlot |
Measurement set the data belongs to. | |
Vector< Int > | itsSpwIds |
List of Ids assoc. | |
Bool | itsAveragingOn |
Averaging information, the list of averaged ranges in two lists. | |
Vector< Vector< Int > > | itsStartChans |
Vector< Vector< Int > > | itsStepChans |
Vector< Vector< Int > > | itsEndChans |
Bool | convertOnX |
Indicate if we are averaging on the X or Y axis. | |
SLog * | log |
Message logger. | |
uInt | numPlotted |
A counter for messaging. | |
Static Private Attributes | |
static const String | clname |
Definition at line 1140 of file MsPlotConvert.h.
casa::MSPlotConvertChanToFreq::MSPlotConvertChanToFreq | ( | Vector< Int > | inIds, |
MsPlot * | inMsPlot, | ||
Bool | inAveOn, | ||
Vector< Vector< Int > > & | inStartChans, | ||
Vector< Vector< Int > > & | inEndChans, | ||
Vector< Vector< Int > > & | inStepChans, | ||
Bool | onXAxis | ||
) | [inline] |
Constructor.
Store the list of Ids for each table locally. The Ids are currently SPWs, but in the future the will be Data Desc Ids.
Store the Measurement Set data locally
Store the channel averaging information.
Store which axis we are converting on.
Definition at line 1144 of file MsPlotConvert.h.
References clname, convertOnX, casa::SLog::FnEnter(), casa::SLog::FnExit(), itsAveragingOn, itsEndChans, itsMsPlot, itsSpwIds, itsStartChans, itsStepChans, log, numPlotted, and casa::SLog::slog().
casa::MSPlotConvertChanToFreq::~MSPlotConvertChanToFreq | ( | ) | [inline] |
Destructor.
Definition at line 1190 of file MsPlotConvert.h.
References clname, casa::SLog::FnEnter(), casa::SLog::FnExit(), and log.
Double casa::MSPlotConvertChanToFreq::getAveFreq | ( | Vector< Int > | chanRange, |
Int | tblNum | ||
) | [inline, protected] |
Get the averaged frequency for the averaged channel value.
sum += getFreq( chanRange[i], tblNum );
Definition at line 1406 of file MsPlotConvert.h.
References CASA_MPC_DBG_FREQ, clname, casa::SLog::FnEnter(), casa::SLog::FnExit(), casa::MsPlot::getChanFrequency(), itsMsPlot, log, casa::ArrayBase::nelements(), numPlotted, and casa::sum().
Referenced by Xconvert_col(), and Yconvert_col().
Vector<Int> casa::MSPlotConvertChanToFreq::getChannelRange | ( | Double | aveChanValue, |
Int | spwId | ||
) | [inline, protected] |
If the averaging is on then the channel value passed in is an averaged channel value.
We need to find the channel range that this value came from, ie. the value is between the start and end values.
Comment, it might be useful to pre-compute the averaged values in the constructor. They could be computed if the start, end, and step values are given. Then we'd just need to search for the matching number. However, this may not work if we compute the average differently then TablePlot.
Loop through your list of channel start and end values looking for an averaging range that our channel value is between. TODO deal with min/max values. ie. if there is no start or end value. TODO if stepchan < 2 then we aren't averaging, may want to make this a special case.
Definition at line 1338 of file MsPlotConvert.h.
References CASA_MPC_DBG_FREQ, clname, casa::LogMessage::DEBUG1, casa::SLog::FnEnter(), casa::SLog::FnExit(), itsEndChans, itsStartChans, itsStepChans, log, casa::ArrayBase::nelements(), numPlotted, casa::SLog::out(), casa::Vector< T >::resize(), String, and casa::String::toString().
Referenced by Xconvert_col(), and Yconvert_col().
Get the frequency associated with this channel Routine based on demo4 in tTablePlot.cc, written by Urvashi R.V.
Definition at line 1431 of file MsPlotConvert.h.
References CASA_MPC_DBG_FREQ, clname, casa::SLog::FnEnter(), casa::MsPlot::getChanFrequency(), itsMsPlot, log, and numPlotted.
Check if the supplied table ID is smaller then our list of Ids.
If it's larger and exception is thrown.
Check that our tblNum is with in range.
Should never get here, and exception occurs in logMessage()
If we are here all is good, and we can simply look up the Spw ID from our Id list. What?-----------------
Definition at line 1295 of file MsPlotConvert.h.
References CASA_MPC_DBG_FREQ, clname, casa::SLog::FnEnter(), casa::SLog::FnExit(), itsSpwIds, log, casa::ArrayBase::nelements(), numPlotted, casa::SLog::out(), casa::LogMessage::SEVERE, String, casa::vpf::toString(), and casa::True.
Referenced by Xconvert_col(), and Yconvert_col().
This is a MAJOR HACK to support multiple spws!!! Just a word of warning that this really needs to be cleaned up at some point.
Definition at line 1200 of file MsPlotConvert.h.
References itsSpwIds.
void casa::MSPlotConvertChanToFreq::showConverter | ( | ) | [inline] |
Definition at line 1178 of file MsPlotConvert.h.
References convertOnX, itsAveragingOn, itsEndChans, itsSpwIds, itsStartChans, itsStepChans, and casa::ArrayBase::nelements().
Double casa::MSPlotConvertChanToFreq::Xconvert_col | ( | Double | x, |
Int | row, | ||
Int | tblnum | ||
) | [inline, virtual] |
Conversion along the Xaxis.
Check table number with our list of SPW Ids and get the spwId for the table
Look up the frequency from our stored information.
If channels are averaged then
Reimplemented from casa::TPConvertBase.
Definition at line 1205 of file MsPlotConvert.h.
References CASA_MPC_DBG_FREQ, clname, convertOnX, casa::LogMessage::DEBUG1, casa::SLog::FnEnter(), casa::SLog::FnExit(), getAveFreq(), casa::MsPlot::getChanFrequency(), getChannelRange(), getSpwId(), itsAveragingOn, itsMsPlot, log, numPlotted, casa::SLog::out(), String, and casa::String::toString().
Double casa::MSPlotConvertChanToFreq::Yconvert_col | ( | Double | y, |
Int | row, | ||
Int | tblnum | ||
) | [inline, virtual] |
Conversion along the Yaxis.
Check table number with our list of SPW Ids and get the spwId for the table
Look up the frequency from our stored information.
If channels are averaged then
Reimplemented from casa::TPConvertBase.
Definition at line 1250 of file MsPlotConvert.h.
References CASA_MPC_DBG_FREQ, clname, convertOnX, casa::LogMessage::DEBUG1, casa::SLog::FnEnter(), casa::SLog::FnExit(), getAveFreq(), casa::MsPlot::getChanFrequency(), getChannelRange(), getSpwId(), itsAveragingOn, itsMsPlot, log, numPlotted, casa::SLog::out(), String, and casa::String::toString().
const String casa::MSPlotConvertChanToFreq::clname [static, private] |
Definition at line 1463 of file MsPlotConvert.h.
Referenced by getAveFreq(), getChannelRange(), getFreq(), getSpwId(), MSPlotConvertChanToFreq(), Xconvert_col(), Yconvert_col(), and ~MSPlotConvertChanToFreq().
Indicate if we are averaging on the X or Y axis.
Definition at line 1459 of file MsPlotConvert.h.
Referenced by MSPlotConvertChanToFreq(), showConverter(), Xconvert_col(), and Yconvert_col().
Averaging information, the list of averaged ranges in two lists.
The list in which each range starts on and the list each range ends on.
Definition at line 1453 of file MsPlotConvert.h.
Referenced by MSPlotConvertChanToFreq(), showConverter(), Xconvert_col(), and Yconvert_col().
Vector< Vector< Int > > casa::MSPlotConvertChanToFreq::itsEndChans [private] |
Definition at line 1456 of file MsPlotConvert.h.
Referenced by getChannelRange(), MSPlotConvertChanToFreq(), and showConverter().
MsPlot* casa::MSPlotConvertChanToFreq::itsMsPlot [private] |
Measurement set the data belongs to.
Definition at line 1438 of file MsPlotConvert.h.
Referenced by getAveFreq(), getFreq(), MSPlotConvertChanToFreq(), Xconvert_col(), and Yconvert_col().
Vector<Int> casa::MSPlotConvertChanToFreq::itsSpwIds [private] |
List of Ids assoc.
with each table given to TablePlot. May not need this, Its needed if different tables passed in have different channel ranges. Not that index 0, is the SPW ID of table 0, ..\.
Definition at line 1448 of file MsPlotConvert.h.
Referenced by getSpwId(), MSPlotConvertChanToFreq(), setSpwIds(), and showConverter().
Vector< Vector< Int > > casa::MSPlotConvertChanToFreq::itsStartChans [private] |
Definition at line 1454 of file MsPlotConvert.h.
Referenced by getChannelRange(), MSPlotConvertChanToFreq(), and showConverter().
Vector< Vector< Int > > casa::MSPlotConvertChanToFreq::itsStepChans [private] |
Definition at line 1455 of file MsPlotConvert.h.
Referenced by getChannelRange(), MSPlotConvertChanToFreq(), and showConverter().
SLog* casa::MSPlotConvertChanToFreq::log [private] |
Message logger.
Definition at line 1462 of file MsPlotConvert.h.
Referenced by getAveFreq(), getChannelRange(), getFreq(), getSpwId(), MSPlotConvertChanToFreq(), Xconvert_col(), Yconvert_col(), and ~MSPlotConvertChanToFreq().
A counter for messaging.
We really don't need to display millions of messages for debugging purposes. This seems to slow things down a lot if we do anyway -- even if they aren't printed to the logger.
Definition at line 1468 of file MsPlotConvert.h.
Referenced by getAveFreq(), getChannelRange(), getFreq(), getSpwId(), MSPlotConvertChanToFreq(), Xconvert_col(), and Yconvert_col().