casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::NewMSSimulator Class Reference

Create an empty MeasurementSet from observation and telescope descriptions. More...

#include <NewMSSimulator.h>

Public Member Functions

 NewMSSimulator (const String &)
 Constructor from name only. More...
 
 NewMSSimulator (MeasurementSet &)
 Constructor from existing MS. More...
 
 NewMSSimulator (const NewMSSimulator &mss)
 Copy constructor - for completeness only. More...
 
 ~NewMSSimulator ()
 
NewMSSimulatoroperator= (const NewMSSimulator &)
 Assignment. More...
 
void setMaxData (const Double maxData=2e9)
 Set maximum amount of data (bytes) to be written into any one scratch column hypercube. More...
 
void initAnt (const String &telname, const Vector< Double > &x, const Vector< Double > &y, const Vector< Double > &z, const Vector< Double > &dishDiameter, const Vector< Double > &offset, const Vector< String > &mount, const Vector< String > &name, const Vector< String > &padname, const String &coordsystem, const MPosition &mRefLocation)
 set the antenna and array data. More...
 
bool getAnt (String &telescope, Int &nAnt, Matrix< Double > *antXYZ, Vector< Double > &antDiam, Vector< Double > &offset, Vector< String > &mount, Vector< String > &name, Vector< String > &padname, String &coordsystem, MPosition &mRefLocation)
 get the info back More...
 
void initFields (const String &sourceName, const MDirection &sourceDirection, const String &calCode)
 set the observed fields More...
 
bool getFields (Int &nField, Vector< String > &sourceName, Vector< MDirection > &sourceDirection, Vector< String > &calCode)
 
void initFeeds (const String &mode)
 set the Feeds; brain dead version More...
 
bool getFeedMode (String &mode)
 
void initFeeds (const String &mode, const Vector< Double > &x, const Vector< Double > &y, const Vector< String > &pol)
 set the Feeds; Smart version More...
 
void initSpWindows (const String &spWindowName, const Int &nChan, const Quantity &startFreq, const Quantity &freqInc, const Quantity &freqRes, const MFrequency::Types &freqType, const String &stokesString)
 set the spectral windows information More...
 
bool getSpWindows (Int &nSpw, Vector< String > &spWindowName, Vector< Int > &nChan, Vector< Quantity > &startFreq, Vector< Quantity > &freqInc, Vector< String > &stokesString)
 
void setFractionBlockageLimit (const Double fraclimit)
 
void setElevationLimit (const Quantity &ellimit)
 
void setAutoCorrelationWt (const Float autocorrwt)
 
void settimes (const Quantity &qIntegrationTime, const Bool useHourAngles, const MEpoch &mRefTime)
 
void observe (const String &sourceName, const String &spWindowName, const Quantity &qStartTime, const Quantity &qStopTime, const Bool add_observation=True, const Bool state_sig=True, const Bool state_ref=True, const double &state_cal=0., const double &state_load=0., const unsigned int state_sub_scan=1, const String &state_obs_mode="OBSERVE_TARGET.ON_SOURCE", const String &observername="CASA simulator", const String &projectname="CASA simulation")
 
void observe (const Vector< String > &sourceNames, const String &spWindowName, const Vector< Quantity > &qStartTimes, const Vector< Quantity > &qStopTimes, const Vector< MDirection > &directions, const Bool add_observation=True, const Bool state_sig=True, const Bool state_ref=True, const double &state_cal=0., const double &state_load=0., const unsigned int state_sub_scan=1, const String &state_obs_mode="OBSERVE_TARGET.ON_SOURCE", const String &observername="CASA simulator", const String &projectname="CASA simulation")
 
casacore::CountedPtr
< MeasurementSet
getMs () const
 

Private Member Functions

 NewMSSimulator ()
 Prevent use of default constructor. More...
 
void local2global (Vector< Double > &xReturned, Vector< Double > &yReturned, Vector< Double > &zReturned, const MPosition &mRefLocation, const Vector< Double > &xIn, const Vector< Double > &yIn, const Vector< Double > &zIn)
 
void longlat2global (Vector< Double > &xReturned, Vector< Double > &yReturned, Vector< Double > &zReturned, const MPosition &mRefLocation, const Vector< Double > &xIn, const Vector< Double > &yIn, const Vector< Double > &zIn)
 
void blockage (Double &fraction1, Double &fraction2, const Vector< Double > &uvw, const Double diam1, const Double diam2)
 Returns the fractional blockage of one antenna by another We will want to put this somewhere else eventually, but I don't yet know where! Till then. More...
 
String formatDirection (const MDirection &)
 
String formatTime (const Double)
 
void addHyperCubes (const Int id, const Int nBase, const Int nChan, const Int nCorr)
 
void defaults ()
 
Bool calcAntUVW (MEpoch &epoch, MDirection &refdir, Matrix< Double > &uvwAnt)
 

Private Attributes

Double fractionBlockageLimit_p
 
Quantity elevationLimit_p
 
Float autoCorrelationWt_p
 
String telescope_p
 
Quantity qIntegrationTime_p
 
Bool useHourAngle_p
 
Bool hourAngleDefined_p
 
MEpoch mRefTime_p
 
Double t_offset_p
 
Double dataWritten_p
 
Int hyperCubeID_p
 
Bool hasHyperCubes_p
 
Int lastSpWID_p
 
Int lastNchan_p
 
casacore::CountedPtr
< MeasurementSet
ms_p
 
TiledDataStManAccessor dataAcc_p
 
TiledDataStManAccessor scratchDataAcc_p
 
TiledDataStManAccessor sigmaAcc_p
 
TiledDataStManAccessor flagAcc_p
 
Double maxData_p
 

Detailed Description

Create an empty MeasurementSet from observation and telescope descriptions.

Prerequisite

Etymology

MS is from MeasurementSet, Simulator refers to the generation of 'fake' data from a set of parameters for instrument and sources.

Synopsis

This class creates a MeasurementSet from a set of parameters for instrument and sources. It does not simulate the data, only the coordinates of a measurement. The application "simulator" uses this class to create a true simulated MS with perfect or corrupted data.

Motivation

To test calibration and imaging programs it is necessary to have flawless data and data with errors that are known exactly. This class generates empty MeasurementSets (only coordinates filled in) that can be filled with predicted data.

To Do

Definition at line 90 of file NewMSSimulator.h.

Constructor & Destructor Documentation

casacore::NewMSSimulator::NewMSSimulator ( const String )

Constructor from name only.

casacore::NewMSSimulator::NewMSSimulator ( MeasurementSet )

Constructor from existing MS.

casacore::NewMSSimulator::NewMSSimulator ( const NewMSSimulator mss)

Copy constructor - for completeness only.

casacore::NewMSSimulator::~NewMSSimulator ( )
casacore::NewMSSimulator::NewMSSimulator ( )
inlineprivate

Prevent use of default constructor.

Definition at line 223 of file NewMSSimulator.h.

Member Function Documentation

void casacore::NewMSSimulator::addHyperCubes ( const Int  id,
const Int  nBase,
const Int  nChan,
const Int  nCorr 
)
private
void casacore::NewMSSimulator::blockage ( Double fraction1,
Double fraction2,
const Vector< Double > &  uvw,
const Double  diam1,
const Double  diam2 
)
private

Returns the fractional blockage of one antenna by another We will want to put this somewhere else eventually, but I don't yet know where! Till then.

fraction1: fraction of antenna 1 that is blocked by 2 fraction2: fraction of antenna 2 that is blocked by 1 hint: at least one of the two will be 0.0

Bool casacore::NewMSSimulator::calcAntUVW ( MEpoch epoch,
MDirection refdir,
Matrix< Double > &  uvwAnt 
)
private
void casacore::NewMSSimulator::defaults ( )
private
String casacore::NewMSSimulator::formatDirection ( const MDirection )
private
String casacore::NewMSSimulator::formatTime ( const Double  )
private
bool casacore::NewMSSimulator::getAnt ( String telescope,
Int nAnt,
Matrix< Double > *  antXYZ,
Vector< Double > &  antDiam,
Vector< Double > &  offset,
Vector< String > &  mount,
Vector< String > &  name,
Vector< String > &  padname,
String coordsystem,
MPosition mRefLocation 
)

get the info back

bool casacore::NewMSSimulator::getFeedMode ( String mode)
bool casacore::NewMSSimulator::getFields ( Int nField,
Vector< String > &  sourceName,
Vector< MDirection > &  sourceDirection,
Vector< String > &  calCode 
)
casacore::CountedPtr<MeasurementSet> casacore::NewMSSimulator::getMs ( ) const
bool casacore::NewMSSimulator::getSpWindows ( Int nSpw,
Vector< String > &  spWindowName,
Vector< Int > &  nChan,
Vector< Quantity > &  startFreq,
Vector< Quantity > &  freqInc,
Vector< String > &  stokesString 
)
void casacore::NewMSSimulator::initAnt ( const String telname,
const Vector< Double > &  x,
const Vector< Double > &  y,
const Vector< Double > &  z,
const Vector< Double > &  dishDiameter,
const Vector< Double > &  offset,
const Vector< String > &  mount,
const Vector< String > &  name,
const Vector< String > &  padname,
const String coordsystem,
const MPosition mRefLocation 
)

set the antenna and array data.

These are written immediately to the existing MS. The same model is used for the other init infor.

void casacore::NewMSSimulator::initFeeds ( const String mode)

set the Feeds; brain dead version

void casacore::NewMSSimulator::initFeeds ( const String mode,
const Vector< Double > &  x,
const Vector< Double > &  y,
const Vector< String > &  pol 
)

set the Feeds; Smart version

void casacore::NewMSSimulator::initFields ( const String sourceName,
const MDirection sourceDirection,
const String calCode 
)

set the observed fields

void casacore::NewMSSimulator::initSpWindows ( const String spWindowName,
const Int nChan,
const Quantity startFreq,
const Quantity freqInc,
const Quantity freqRes,
const MFrequency::Types freqType,
const String stokesString 
)

set the spectral windows information

void casacore::NewMSSimulator::local2global ( Vector< Double > &  xReturned,
Vector< Double > &  yReturned,
Vector< Double > &  zReturned,
const MPosition mRefLocation,
const Vector< Double > &  xIn,
const Vector< Double > &  yIn,
const Vector< Double > &  zIn 
)
private
void casacore::NewMSSimulator::longlat2global ( Vector< Double > &  xReturned,
Vector< Double > &  yReturned,
Vector< Double > &  zReturned,
const MPosition mRefLocation,
const Vector< Double > &  xIn,
const Vector< Double > &  yIn,
const Vector< Double > &  zIn 
)
private
void casacore::NewMSSimulator::observe ( const String sourceName,
const String spWindowName,
const Quantity qStartTime,
const Quantity qStopTime,
const Bool  add_observation = True,
const Bool  state_sig = True,
const Bool  state_ref = True,
const double &  state_cal = 0.,
const double &  state_load = 0.,
const unsigned int  state_sub_scan = 1,
const String state_obs_mode = "OBSERVE_TARGET.ON_SOURCE",
const String observername = "CASA simulator",
const String projectname = "CASA simulation" 
)
void casacore::NewMSSimulator::observe ( const Vector< String > &  sourceNames,
const String spWindowName,
const Vector< Quantity > &  qStartTimes,
const Vector< Quantity > &  qStopTimes,
const Vector< MDirection > &  directions,
const Bool  add_observation = True,
const Bool  state_sig = True,
const Bool  state_ref = True,
const double &  state_cal = 0.,
const double &  state_load = 0.,
const unsigned int  state_sub_scan = 1,
const String state_obs_mode = "OBSERVE_TARGET.ON_SOURCE",
const String observername = "CASA simulator",
const String projectname = "CASA simulation" 
)
NewMSSimulator& casacore::NewMSSimulator::operator= ( const NewMSSimulator )

Assignment.

void casacore::NewMSSimulator::setAutoCorrelationWt ( const Float  autocorrwt)
inline

Definition at line 176 of file NewMSSimulator.h.

References autoCorrelationWt_p.

void casacore::NewMSSimulator::setElevationLimit ( const Quantity ellimit)
inline

Definition at line 173 of file NewMSSimulator.h.

References elevationLimit_p.

void casacore::NewMSSimulator::setFractionBlockageLimit ( const Double  fraclimit)
inline

Definition at line 170 of file NewMSSimulator.h.

References fractionBlockageLimit_p.

void casacore::NewMSSimulator::setMaxData ( const Double  maxData = 2e9)
inline

Set maximum amount of data (bytes) to be written into any one scratch column hypercube.

Definition at line 112 of file NewMSSimulator.h.

References maxData_p.

void casacore::NewMSSimulator::settimes ( const Quantity qIntegrationTime,
const Bool  useHourAngles,
const MEpoch mRefTime 
)

Member Data Documentation

Float casacore::NewMSSimulator::autoCorrelationWt_p
private

Definition at line 228 of file NewMSSimulator.h.

Referenced by setAutoCorrelationWt().

TiledDataStManAccessor casacore::NewMSSimulator::dataAcc_p
private

Definition at line 243 of file NewMSSimulator.h.

Double casacore::NewMSSimulator::dataWritten_p
private

Definition at line 235 of file NewMSSimulator.h.

Quantity casacore::NewMSSimulator::elevationLimit_p
private

Definition at line 227 of file NewMSSimulator.h.

Referenced by setElevationLimit().

TiledDataStManAccessor casacore::NewMSSimulator::flagAcc_p
private

Definition at line 243 of file NewMSSimulator.h.

Double casacore::NewMSSimulator::fractionBlockageLimit_p
private

Definition at line 226 of file NewMSSimulator.h.

Referenced by setFractionBlockageLimit().

Bool casacore::NewMSSimulator::hasHyperCubes_p
private

Definition at line 237 of file NewMSSimulator.h.

Bool casacore::NewMSSimulator::hourAngleDefined_p
private

Definition at line 232 of file NewMSSimulator.h.

Int casacore::NewMSSimulator::hyperCubeID_p
private

Definition at line 236 of file NewMSSimulator.h.

Int casacore::NewMSSimulator::lastNchan_p
private

Definition at line 239 of file NewMSSimulator.h.

Int casacore::NewMSSimulator::lastSpWID_p
private

Definition at line 238 of file NewMSSimulator.h.

Double casacore::NewMSSimulator::maxData_p
private

Definition at line 245 of file NewMSSimulator.h.

Referenced by setMaxData().

MEpoch casacore::NewMSSimulator::mRefTime_p
private

Definition at line 233 of file NewMSSimulator.h.

casacore::CountedPtr<MeasurementSet> casacore::NewMSSimulator::ms_p
private

Definition at line 241 of file NewMSSimulator.h.

Quantity casacore::NewMSSimulator::qIntegrationTime_p
private

Definition at line 230 of file NewMSSimulator.h.

TiledDataStManAccessor casacore::NewMSSimulator::scratchDataAcc_p
private

Definition at line 243 of file NewMSSimulator.h.

TiledDataStManAccessor casacore::NewMSSimulator::sigmaAcc_p
private

Definition at line 243 of file NewMSSimulator.h.

Double casacore::NewMSSimulator::t_offset_p
private

Definition at line 234 of file NewMSSimulator.h.

String casacore::NewMSSimulator::telescope_p
private

Definition at line 229 of file NewMSSimulator.h.

Bool casacore::NewMSSimulator::useHourAngle_p
private

Definition at line 231 of file NewMSSimulator.h.


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