casacore
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::NewMSSimulator Class Reference

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< MeasurementSetgetMs () 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< MeasurementSetms_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

◆ NewMSSimulator() [1/4]

casacore::NewMSSimulator::NewMSSimulator ( const String )

Constructor from name only.

◆ NewMSSimulator() [2/4]

casacore::NewMSSimulator::NewMSSimulator ( MeasurementSet )

Constructor from existing MS.

◆ NewMSSimulator() [3/4]

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

Copy constructor - for completeness only.

◆ ~NewMSSimulator()

casacore::NewMSSimulator::~NewMSSimulator ( )

◆ NewMSSimulator() [4/4]

casacore::NewMSSimulator::NewMSSimulator ( )
inlineprivate

Prevent use of default constructor.

Definition at line 223 of file NewMSSimulator.h.

Member Function Documentation

◆ addHyperCubes()

void casacore::NewMSSimulator::addHyperCubes ( const Int  id,
const Int  nBase,
const Int  nChan,
const Int  nCorr 
)
private

◆ blockage()

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

◆ calcAntUVW()

Bool casacore::NewMSSimulator::calcAntUVW ( MEpoch epoch,
MDirection refdir,
Matrix< Double > &  uvwAnt 
)
private

◆ defaults()

void casacore::NewMSSimulator::defaults ( )
private

◆ formatDirection()

String casacore::NewMSSimulator::formatDirection ( const MDirection )
private

◆ formatTime()

String casacore::NewMSSimulator::formatTime ( const  Double)
private

◆ getAnt()

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

◆ getFeedMode()

bool casacore::NewMSSimulator::getFeedMode ( String mode)

◆ getFields()

bool casacore::NewMSSimulator::getFields ( Int nField,
Vector< String > &  sourceName,
Vector< MDirection > &  sourceDirection,
Vector< String > &  calCode 
)

◆ getMs()

casacore::CountedPtr<MeasurementSet> casacore::NewMSSimulator::getMs ( ) const

◆ getSpWindows()

bool casacore::NewMSSimulator::getSpWindows ( Int nSpw,
Vector< String > &  spWindowName,
Vector< Int > &  nChan,
Vector< Quantity > &  startFreq,
Vector< Quantity > &  freqInc,
Vector< String > &  stokesString 
)

◆ initAnt()

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.

◆ initFeeds() [1/2]

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

set the Feeds; brain dead version

◆ initFeeds() [2/2]

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

set the Feeds; Smart version

◆ initFields()

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

set the observed fields

◆ initSpWindows()

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

◆ local2global()

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

◆ longlat2global()

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

◆ observe() [1/2]

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" 
)

◆ observe() [2/2]

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" 
)

◆ operator=()

NewMSSimulator& casacore::NewMSSimulator::operator= ( const NewMSSimulator )

Assignment.

◆ setAutoCorrelationWt()

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

Definition at line 176 of file NewMSSimulator.h.

References autoCorrelationWt_p.

◆ setElevationLimit()

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

Definition at line 173 of file NewMSSimulator.h.

References elevationLimit_p.

◆ setFractionBlockageLimit()

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

Definition at line 170 of file NewMSSimulator.h.

References fractionBlockageLimit_p.

◆ setMaxData()

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.

◆ settimes()

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

Member Data Documentation

◆ autoCorrelationWt_p

Float casacore::NewMSSimulator::autoCorrelationWt_p
private

Definition at line 228 of file NewMSSimulator.h.

Referenced by setAutoCorrelationWt().

◆ dataAcc_p

TiledDataStManAccessor casacore::NewMSSimulator::dataAcc_p
private

Definition at line 243 of file NewMSSimulator.h.

◆ dataWritten_p

Double casacore::NewMSSimulator::dataWritten_p
private

Definition at line 235 of file NewMSSimulator.h.

◆ elevationLimit_p

Quantity casacore::NewMSSimulator::elevationLimit_p
private

Definition at line 227 of file NewMSSimulator.h.

Referenced by setElevationLimit().

◆ flagAcc_p

TiledDataStManAccessor casacore::NewMSSimulator::flagAcc_p
private

Definition at line 243 of file NewMSSimulator.h.

◆ fractionBlockageLimit_p

Double casacore::NewMSSimulator::fractionBlockageLimit_p
private

Definition at line 226 of file NewMSSimulator.h.

Referenced by setFractionBlockageLimit().

◆ hasHyperCubes_p

Bool casacore::NewMSSimulator::hasHyperCubes_p
private

Definition at line 237 of file NewMSSimulator.h.

◆ hourAngleDefined_p

Bool casacore::NewMSSimulator::hourAngleDefined_p
private

Definition at line 232 of file NewMSSimulator.h.

◆ hyperCubeID_p

Int casacore::NewMSSimulator::hyperCubeID_p
private

Definition at line 236 of file NewMSSimulator.h.

◆ lastNchan_p

Int casacore::NewMSSimulator::lastNchan_p
private

Definition at line 239 of file NewMSSimulator.h.

◆ lastSpWID_p

Int casacore::NewMSSimulator::lastSpWID_p
private

Definition at line 238 of file NewMSSimulator.h.

◆ maxData_p

Double casacore::NewMSSimulator::maxData_p
private

Definition at line 245 of file NewMSSimulator.h.

Referenced by setMaxData().

◆ mRefTime_p

MEpoch casacore::NewMSSimulator::mRefTime_p
private

Definition at line 233 of file NewMSSimulator.h.

◆ ms_p

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

Definition at line 241 of file NewMSSimulator.h.

◆ qIntegrationTime_p

Quantity casacore::NewMSSimulator::qIntegrationTime_p
private

Definition at line 230 of file NewMSSimulator.h.

◆ scratchDataAcc_p

TiledDataStManAccessor casacore::NewMSSimulator::scratchDataAcc_p
private

Definition at line 243 of file NewMSSimulator.h.

◆ sigmaAcc_p

TiledDataStManAccessor casacore::NewMSSimulator::sigmaAcc_p
private

Definition at line 243 of file NewMSSimulator.h.

◆ t_offset_p

Double casacore::NewMSSimulator::t_offset_p
private

Definition at line 234 of file NewMSSimulator.h.

◆ telescope_p

String casacore::NewMSSimulator::telescope_p
private

Definition at line 229 of file NewMSSimulator.h.

◆ useHourAngle_p

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: