casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::Simulator Class Reference

Simulates MeasurementSets from SkyModel and SkyEquation. More...

#include <Simulator.h>

List of all members.

Public Member Functions

 Simulator ()
 Simulator (String &msname)
 Construct from string.
 Simulator (MeasurementSet &thems)
 "newsimulator" ctor
String name () const
 Return the name of the MeasurementSet.
 Simulator (const Simulator &other)
Simulatoroperator= (const Simulator &other)
 ~Simulator ()
Bool close ()
Bool setdata (const Vector< Int > &spectralwindowids, const Vector< Int > &fieldids, const String &msSelect)
 Select the data to be predicted or corrupted.
Bool settimes (const Quantity &integrationTime, const Bool useHourAngle, const MEpoch &refTime)
Bool setconfig (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 > &antName, const Vector< String > &padName, const String &coordsystem, const MPosition &referenceLocation)
 set the configuration; NOTE: the telname used here will determine the Voltage Pattern to be used in the simulation
Bool getconfig ()
 get info back from e.g.
Bool setfield (const String &sourceName, const MDirection &sourceDirection, const String &calCode, const Quantity &distance)
 set the observed fields for the simulation
Bool setmosaicfield (const String &sourcename, const String &calcode, const MDirection &fieldcenter, const Int xmosp, const Int ymosp, const Quantity &mosspacing, const Quantity &distance)
 set automatic fields for a mosaic
Bool setspwindow (const String &spwName, const Quantity &freq, const Quantity &deltafreq, const Quantity &freqresolution, const MFrequency::Types &freqType, const Int nchannels, const String &stokes)
 set one or more spectral windows and their characteristics
Bool setfeed (const String &mode, const Vector< Double > &x, const Vector< Double > &y, const Vector< String > &pol)
 Set the simulated feed characteristics.
Bool setvp (const Bool dovp, const Bool defaultVP, const String &vpTable, const Bool doSquint, const Quantity &parAngleInc, const Quantity &skyPosThreshold, const Float &pbLimit)
 Set the voltage pattern.
Bool setseed (const Int seed)
 Set the random number generator seed for the addition of errors.
Bool setapply (const String &type, const Double &t, const String &table, const String &spw, const String &field, const String &interp, const Bool &calwt, const Vector< Int > &spwmap, const Float &opacity)
 Arrange to corrupt with existing calibration (cf Calibrater setapply)
Bool setgain (const String &mode, const String &table, const Quantity &interval, const Vector< Double > &amplitude)
 Apply antenna-based gain errors.
Bool settrop (const String &mode, const String &table, const Float pwv, const Float deltapwv, const Float beta, const Float windspeed)
Bool setpointingerror (const String &epJTableName, const Bool applyPointingOffsets, const Bool doPBCorrection)
 Apply antenna pointing and squint errors.
Bool setleakage (const String &mode, const String &table, const Vector< Double > &amplitude, const Vector< Double > &offset)
 Apply polarization leakage errors.
Bool setbandpass (const String &mode, const String &table, const Quantity &interval, const Vector< Double > &amplitude)
 Apply bandpass errors.
Bool setpa (const String &mode, const String &table, const Quantity &interval)
 Simulate the parallactic angle phase effect.
Bool oldsetnoise (const String &mode, const String &table, const Quantity &simplenoise, const Float antefficiency, const Float correfficiency, const Float spillefficiency, const Float tau, const Float trx, const Float tatmos, const Float tcmb)
 Simulate quasi-realistic thermal noise, which can depend upon elevation, bandwidth, antenna diameter, as expected.
Bool setnoise (const String &mode, const String &caltable, const Quantity &simplenoise, const Quantity &pground, const Float relhum, const Quantity &altitude, const Quantity &waterheight, const Quantity &pwv, const Float tatmos, const Float tau, const Float antefficiency, const Float spillefficiency, const Float correfficiency, const Float trx, const Float tground, const Float tcmb, const Bool OTF, const Float senscoeff, const Int rxtype)
Bool corrupt ()
 apply errors to the data in our MS Bool corrupt();
Bool setlimits (const Double shadowFraction, const Quantity &elevationLimit)
 Set limits.
Bool setauto (const Double autocorrwt)
 Set autocorrelation weight.
Bool observe (const String &sourcename, const String &spwname, const Quantity &startTime, const Quantity &stopTime, const Bool add_observation, const Bool state_sig, const Bool state_ref, const double &state_cal, const double &state_load, const unsigned int state_sub_scan, const String &state_obs_mode, const String &observername, const String &projectname)
 add new visibilities as described by the set methods to an existing or just created measurement set
Bool observemany (const Vector< String > &sourcenames, const String &spwname, const Vector< Quantity > &startTimes, const Vector< Quantity > &stopTimes, const Vector< MDirection > &directions, const Bool add_observation, const Bool state_sig, const Bool state_ref, const double &state_cal, const double &state_load, const unsigned int state_sub_scan, const String &state_obs_mode, const String &observername, const String &projectname)
Bool predict (const Vector< String > &modelImage, const String &compList, const Bool incremental)
 Given a model image, predict the visibilities onto the (u,v) coordinates of our MS.
String state ()
Bool summary ()
Bool resetviscal ()
Bool resetimcal ()
Bool reset ()
Bool setoptions (const String &ftmachine, const Int cache, const Int tile, const String &gridfunction, const MPosition &mLocation, const Float padding, const Int facets, const Double maxData, const Int wprojPlanes)
 Set the processing options.
void setPrtlev (const Int &prtlev)
 Set the print level.
Intprtlev ()
 Return print (cout) level.

Private Member Functions

Bool create_corrupt (Record &simpar)
 Arrange to corrupt with simulated calibration (cf Calibrater setapply)
Bool detached () const
 Prints an error message if the newsimulator DO is detached and returns True.
void defaults ()
 set up some defaults
void makeVisSet ()
 Make a VisSet if needed.
String formatDirection (const MDirection &direction)
 print out some help about create() Format direction nicely
String formatTime (const Double time)
 Format time nicely.
Bool createSummary (LogIO &os)
 individual summary() functions
Bool configSummary (LogIO &os)
Bool fieldSummary (LogIO &os)
Bool spWindowSummary (LogIO &os)
Bool feedSummary (LogIO &os)
Bool timeSummary (LogIO &os)
Bool predictSummary (LogIO &os)
Bool vpSummary (LogIO &os)
Bool optionsSummary (LogIO &os)
Bool corruptSummary (LogIO &os)
Bool noiseSummary (LogIO &os)
Bool createSkyEquation (const Vector< String > &image, const String complist)
 SkyEquation management.
void destroySkyEquation ()

Private Attributes

String msname_p
 
   

MeasurementSetms_p
MeasurementSetmssel_p
VisSetvs_p
Int seed_p
ACohac_p
SkyEquationse_p
CleanImageSkyModelsm_p
FTMachineft_p
ComponentFTMachinecft_p
Int nmodels_p
PtrBlock< PagedImage< Float > * > images_p
ComponentListcomponentList_p
String ftmachine_p
String gridfunction_p
Int cache_p
Int tile_p
MPosition mLocation_p
Float padding_p
Bool MSMayBeOK
Int facets_p
Int wprojPlanes_p
Long maxData_p
Bool areStationCoordsSet_p
 info for coordinates and station locations
String telescope_p
Vector< Doublex_p
Vector< Doubley_p
Vector< Doublez_p
Vector< Doublediam_p
Vector< Doubleoffset_p
Vector< Stringmount_p
Vector< StringantName_p
Vector< StringpadName_p
String coordsystem_p
MPosition mRefLocation_p
Int nField
 info for observed field parameters
Vector< StringsourceName_p
Vector< StringcalCode_p
Vector< MDirectionsourceDirection_p
Vector< Quantitydistance_p
VisEquation ve_p
 VisEquation handles corruption by visibility calibration effects.
PtrBlock< VisCal * > vc_p
 Generic container for any number of calibration effects to corrupt with.
Int nSpw
 info for spectral window parameters
Vector< StringspWindowName_p
Vector< IntnChan_p
Vector< QuantitystartFreq_p
Vector< QuantityfreqInc_p
Vector< QuantityfreqRes_p
Vector< StringstokesString_p
String feedMode_p
 Feed information (there will be much more coming, but we are brain dead at this moment).
Int nFeeds_p
Bool feedsHaveBeenSet
Bool feedsInitialized
Quantity integrationTime_p
 Some times which are required for settimes.
Bool useHourAngle_p
MEpoch refTime_p
Bool timesHaveBeenSet_p
Bool doVP_p
 Some parameters for voltage pattern (vp):
Bool doDefaultVP_p
String vpTableStr_p
Quantity parAngleInc_p
Quantity skyPosThreshold_p
Float pbLimit_p
BeamSquint::SquintType squintType_p
VPSkyJonesvp_p
VPSkyJonesgvp_p
String noisemode_p
 Saving some information about the various corrupting terms.
NewMSSimulatorsim_p
 Cache the newsimulator.
String epJTableName_p
 The Jones matrix to hold the antenna pointing offsets and the associated table name.
Bool applyPointingOffsets_p
Bool doPBCorrection_p
Int prtlev_
 
   


Detailed Description

Simulates MeasurementSets from SkyModel and SkyEquation.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

The name MUST have the 'DO' prefix as this class is derived from ApplicationObject, and hence is classified as a distributed object. For the same reason the rest of its name must be in lower case. This class simulates visibility data, so it is called DOnewsimulator.

Synopsis

Motivation

This class was written to make the simulation capability useful from glish

Thrown Exceptions

To Do

Definition at line 95 of file Simulator.h.


Constructor & Destructor Documentation

Construct from string.

"newsimulator" ctor


Member Function Documentation

apply errors to the data in our MS Bool corrupt();

Bool casa::Simulator::create_corrupt ( Record simpar) [private]

Arrange to corrupt with simulated calibration (cf Calibrater setapply)

Bool casa::Simulator::createSkyEquation ( const Vector< String > &  image,
const String  complist 
) [private]

SkyEquation management.

individual summary() functions

void casa::Simulator::defaults ( ) [private]

set up some defaults

Bool casa::Simulator::detached ( ) const [private]

Prints an error message if the newsimulator DO is detached and returns True.

String casa::Simulator::formatDirection ( const MDirection direction) [private]

print out some help about create() Format direction nicely

String casa::Simulator::formatTime ( const Double  time) [private]

Format time nicely.

get info back from e.g.

loaded ms in newmssimulator

void casa::Simulator::makeVisSet ( ) [private]

Make a VisSet if needed.

Return the name of the MeasurementSet.

Bool casa::Simulator::observe ( const String sourcename,
const String spwname,
const Quantity startTime,
const Quantity stopTime,
const Bool  add_observation,
const Bool  state_sig,
const Bool  state_ref,
const double &  state_cal,
const double &  state_load,
const unsigned int  state_sub_scan,
const String state_obs_mode,
const String observername,
const String projectname 
)

add new visibilities as described by the set methods to an existing or just created measurement set

Bool casa::Simulator::observemany ( const Vector< String > &  sourcenames,
const String spwname,
const Vector< Quantity > &  startTimes,
const Vector< Quantity > &  stopTimes,
const Vector< MDirection > &  directions,
const Bool  add_observation,
const Bool  state_sig,
const Bool  state_ref,
const double &  state_cal,
const double &  state_load,
const unsigned int  state_sub_scan,
const String state_obs_mode,
const String observername,
const String projectname 
)
Bool casa::Simulator::oldsetnoise ( const String mode,
const String table,
const Quantity simplenoise,
const Float  antefficiency,
const Float  correfficiency,
const Float  spillefficiency,
const Float  tau,
const Float  trx,
const Float  tatmos,
const Float  tcmb 
)

Simulate quasi-realistic thermal noise, which can depend upon elevation, bandwidth, antenna diameter, as expected.

Simulator& casa::Simulator::operator= ( const Simulator other)
Bool casa::Simulator::predict ( const Vector< String > &  modelImage,
const String compList,
const Bool  incremental 
)

Given a model image, predict the visibilities onto the (u,v) coordinates of our MS.

Return print (cout) level.

Definition at line 334 of file Simulator.h.

References prtlev_.

Referenced by setPrtlev().

Bool casa::Simulator::setapply ( const String type,
const Double t,
const String table,
const String spw,
const String field,
const String interp,
const Bool calwt,
const Vector< Int > &  spwmap,
const Float opacity 
)

Arrange to corrupt with existing calibration (cf Calibrater setapply)

Bool casa::Simulator::setauto ( const Double  autocorrwt)

Set autocorrelation weight.

Bool casa::Simulator::setbandpass ( const String mode,
const String table,
const Quantity interval,
const Vector< Double > &  amplitude 
)

Apply bandpass errors.

Bool casa::Simulator::setconfig ( 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 > &  antName,
const Vector< String > &  padName,
const String coordsystem,
const MPosition referenceLocation 
)

set the configuration; NOTE: the telname used here will determine the Voltage Pattern to be used in the simulation

Bool casa::Simulator::setdata ( const Vector< Int > &  spectralwindowids,
const Vector< Int > &  fieldids,
const String msSelect 
)

Select the data to be predicted or corrupted.

Bool casa::Simulator::setfeed ( const String mode,
const Vector< Double > &  x,
const Vector< Double > &  y,
const Vector< String > &  pol 
)

Set the simulated feed characteristics.

Bool casa::Simulator::setfield ( const String sourceName,
const MDirection sourceDirection,
const String calCode,
const Quantity distance 
)

set the observed fields for the simulation

Bool casa::Simulator::setgain ( const String mode,
const String table,
const Quantity interval,
const Vector< Double > &  amplitude 
)

Apply antenna-based gain errors.

Bool casa::Simulator::setleakage ( const String mode,
const String table,
const Vector< Double > &  amplitude,
const Vector< Double > &  offset 
)

Apply polarization leakage errors.

Parameters:
amplitudeconst Quantity& interval,
Bool casa::Simulator::setlimits ( const Double  shadowFraction,
const Quantity elevationLimit 
)

Set limits.

Bool casa::Simulator::setmosaicfield ( const String sourcename,
const String calcode,
const MDirection fieldcenter,
const Int  xmosp,
const Int  ymosp,
const Quantity mosspacing,
const Quantity distance 
)

set automatic fields for a mosaic

Bool casa::Simulator::setnoise ( const String mode,
const String caltable,
const Quantity simplenoise,
const Quantity pground,
const Float  relhum,
const Quantity altitude,
const Quantity waterheight,
const Quantity pwv,
const Float  tatmos,
const Float  tau,
const Float  antefficiency,
const Float  spillefficiency,
const Float  correfficiency,
const Float  trx,
const Float  tground,
const Float  tcmb,
const Bool  OTF,
const Float  senscoeff,
const Int  rxtype 
)
Parameters:
pgroundif blank, not stored or ATM calculation
tatmosuser-specified tau and tatmos
Bool casa::Simulator::setoptions ( const String ftmachine,
const Int  cache,
const Int  tile,
const String gridfunction,
const MPosition mLocation,
const Float  padding,
const Int  facets,
const Double  maxData,
const Int  wprojPlanes 
)

Set the processing options.

Bool casa::Simulator::setpa ( const String mode,
const String table,
const Quantity interval 
)

Simulate the parallactic angle phase effect.

Bool casa::Simulator::setpointingerror ( const String epJTableName,
const Bool  applyPointingOffsets,
const Bool  doPBCorrection 
)

Apply antenna pointing and squint errors.

void casa::Simulator::setPrtlev ( const Int prtlev) [inline]

Set the print level.

Definition at line 332 of file Simulator.h.

References prtlev(), and prtlev_.

Set the random number generator seed for the addition of errors.

Bool casa::Simulator::setspwindow ( const String spwName,
const Quantity freq,
const Quantity deltafreq,
const Quantity freqresolution,
const MFrequency::Types freqType,
const Int  nchannels,
const String stokes 
)

set one or more spectral windows and their characteristics

Bool casa::Simulator::settimes ( const Quantity integrationTime,
const Bool  useHourAngle,
const MEpoch refTime 
)
Bool casa::Simulator::settrop ( const String mode,
const String table,
const Float  pwv,
const Float  deltapwv,
const Float  beta,
const Float  windspeed 
)
Bool casa::Simulator::setvp ( const Bool  dovp,
const Bool  defaultVP,
const String vpTable,
const Bool  doSquint,
const Quantity parAngleInc,
const Quantity skyPosThreshold,
const Float pbLimit 
)

Set the voltage pattern.

Bool casa::Simulator::vpSummary ( LogIO os) [private]

Member Data Documentation

Definition at line 391 of file Simulator.h.

Definition at line 422 of file Simulator.h.

Definition at line 507 of file Simulator.h.

info for coordinates and station locations

Definition at line 414 of file Simulator.h.

Definition at line 403 of file Simulator.h.

Definition at line 433 of file Simulator.h.

Definition at line 396 of file Simulator.h.

Definition at line 400 of file Simulator.h.

Definition at line 424 of file Simulator.h.

Definition at line 419 of file Simulator.h.

Definition at line 435 of file Simulator.h.

Definition at line 481 of file Simulator.h.

Definition at line 508 of file Simulator.h.

Some parameters for voltage pattern (vp):

Definition at line 480 of file Simulator.h.

The Jones matrix to hold the antenna pointing offsets and the associated table name.

if applyPointingOffsets is False, only VLA polarization squint will be included in EPJones. If doPBCorrection is True, the model image will be divided by the primary beam before being used to predict the visibilities.

EPJones *epJ_p;

Definition at line 506 of file Simulator.h.

Definition at line 407 of file Simulator.h.

Feed information (there will be much more coming, but we are brain dead at this moment).

Definition at line 465 of file Simulator.h.

Definition at line 467 of file Simulator.h.

Definition at line 468 of file Simulator.h.

Definition at line 456 of file Simulator.h.

Definition at line 457 of file Simulator.h.

Definition at line 395 of file Simulator.h.

Definition at line 402 of file Simulator.h.

Definition at line 402 of file Simulator.h.

Definition at line 488 of file Simulator.h.

Definition at line 399 of file Simulator.h.

Some times which are required for settimes.

Definition at line 472 of file Simulator.h.

Definition at line 409 of file Simulator.h.

Definition at line 404 of file Simulator.h.

Definition at line 421 of file Simulator.h.

Definition at line 425 of file Simulator.h.

Definition at line 385 of file Simulator.h.

Definition at line 406 of file Simulator.h.

   

Definition at line 384 of file Simulator.h.

Definition at line 386 of file Simulator.h.

Definition at line 454 of file Simulator.h.

Definition at line 466 of file Simulator.h.

info for observed field parameters

   

Definition at line 431 of file Simulator.h.

Definition at line 398 of file Simulator.h.

Saving some information about the various corrupting terms.

Definition at line 493 of file Simulator.h.

info for spectral window parameters

spectral windows data

RI 20091107 durn. whoever build this didn't enable multiple spw. we'll at least get some functionality here, but there are probably combinations of pols etc that won't properly report here. better than now, when it doesn't even report more than one spw.

Definition at line 452 of file Simulator.h.

Definition at line 420 of file Simulator.h.

Definition at line 405 of file Simulator.h.

Definition at line 423 of file Simulator.h.

Definition at line 483 of file Simulator.h.

Definition at line 485 of file Simulator.h.

   

Definition at line 511 of file Simulator.h.

Referenced by prtlev(), and setPrtlev().

Definition at line 474 of file Simulator.h.

Definition at line 393 of file Simulator.h.

Definition at line 389 of file Simulator.h.

Cache the newsimulator.

Definition at line 497 of file Simulator.h.

Definition at line 484 of file Simulator.h.

Definition at line 394 of file Simulator.h.

Definition at line 434 of file Simulator.h.

Definition at line 432 of file Simulator.h.

Definition at line 453 of file Simulator.h.

Definition at line 486 of file Simulator.h.

Definition at line 455 of file Simulator.h.

Definition at line 458 of file Simulator.h.

Definition at line 415 of file Simulator.h.

Definition at line 403 of file Simulator.h.

Definition at line 475 of file Simulator.h.

Definition at line 473 of file Simulator.h.

Generic container for any number of calibration effects to corrupt with.

Definition at line 441 of file Simulator.h.

VisEquation handles corruption by visibility calibration effects.

Definition at line 439 of file Simulator.h.

Definition at line 487 of file Simulator.h.

Definition at line 482 of file Simulator.h.

Definition at line 387 of file Simulator.h.

Definition at line 408 of file Simulator.h.

Definition at line 416 of file Simulator.h.

Definition at line 417 of file Simulator.h.

Definition at line 418 of file Simulator.h.


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