casa
5.7.0-16
|
Object to provide MODEL_DATA visibilities on demand. More...
#include <VisModelData.h>
Public Member Functions | |
VisModelData () | |
empty constructor More... | |
virtual | ~VisModelData () |
From a FTMachine Record VisModelData(const casacore::Record& ftmachinerec, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds);. More... | |
void | addFlatModel (const casacore::Vector< casacore::Double > &value, const casacore::Vector< casacore::Int > &validfieldids, const casacore::Vector< casacore::Int > &msIds) |
Add Image/FTMachine to generate visibilities for void addFTMachine(const casacore::Record& recordFTMachine, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds); Add componentlist to generate visibilities for void addCompFTMachine(const ComponentList& cl, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds); For simple model a special case for speed. More... | |
void | addModel (const casacore::RecordInterface &rec, const casacore::Vector< casacore::Int > &msids, const vi::VisBuffer2 &vb) |
add componentlists or ftmachines More... | |
void | addModel (const casacore::RecordInterface &, const casacore::Vector< casacore::Int > &, const VisBuffer &) |
Add Image/FTMachine to generate visibilities for void addFTMachine(const casacore::Record& recordFTMachine, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds); Add componentlist to generate visibilities for void addCompFTMachine(const ComponentList& cl, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds); For simple model a special case for speed. More... | |
VisModelDataI * | clone () |
casacore::Bool | getModelVis (vi::VisBuffer2 &vb) |
put the model data for this VisBuffer in the modelVisCube More... | |
casacore::Bool | getModelVis (VisBuffer &) |
//put the model data for this VisBuffer in the modelVisCube More... | |
void | putModelI (const casacore::MeasurementSet &thems, const casacore::RecordInterface &rec, const casacore::Vector< casacore::Int > &validfields, const casacore::Vector< casacore::Int > &spws, const casacore::Vector< casacore::Int > &starts, const casacore::Vector< casacore::Int > &nchan, const casacore::Vector< casacore::Int > &incr, casacore::Bool iscomponentlist=true, casacore::Bool incremental=false) |
this is a helper function that writes the model record to the ms More... | |
void | putModelI (const casacore::MeasurementSet &thems, const casacore::RecordInterface &rec, const casacore::Matrix< casacore::Int > &indexComb, const casacore::Matrix< casacore::Int > &chansel, casacore::Bool iscomponentlist=true, casacore::Bool incremental=false) |
Version 2 record to keep track of state and scan number. More... | |
void | clearModelI (const casacore::MeasurementSet &thems) |
helper function to clear the keywordSet of the ms of the model for the fields in that ms More... | |
casacore::Bool | isModelDefinedI (const casacore::Int fieldId, const casacore::MeasurementSet &thems, casacore::String &key, casacore::Int &sourceRow) |
Functions to see if model is defined in the casacore::MS either in the SOURCE table or else in the MAIN. More... | |
casacore::Bool | getModelRecordI (const casacore::String &theKey, casacore::TableRecord &theRec, const casacore::MeasurementSet &theMs) |
Get a given model that is defined by key Forcing user to use a casacore::TableRecord rather than Generic casacore::RecordInterface...just so as to avoid a copy. More... | |
casacore::Int | hasModel (casacore::Int msid, casacore::Int field, casacore::Int spw) |
check if an addFT or addCompFT is necessary casacore::Bool hasFT(casacore::Int msid, casacore::Int fieldid); casacore::Bool hasCL(casacore::Int msid, casacore::Int fieldid); returns a -1 if there is no model for this combination of ms,field,spw...but has not been // checked yet if there is one returns a -2 if it has been tested before but does have it. More... | |
casacore::Bool | isVersion2 () |
void | init (const vi::VisBuffer2 &vb) |
void | init (const VisBuffer &) |
Make sure that VisModel has been called once loaded checks and detection of version 1 or 2 is valid. More... | |
![]() | |
VisModelDataI () | |
empty constructor More... | |
virtual | ~VisModelDataI () |
From a FTMachine Record VisModelDataI(const casacore::Record& ftmachinerec, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds);. More... | |
Static Public Member Functions | |
static void | putModel (const casacore::MeasurementSet &thems, const casacore::RecordInterface &rec, const casacore::Vector< casacore::Int > &validfields, const casacore::Vector< casacore::Int > &spws, const casacore::Vector< casacore::Int > &starts, const casacore::Vector< casacore::Int > &nchan, const casacore::Vector< casacore::Int > &incr, casacore::Bool iscomponentlist=true, casacore::Bool incremental=false) |
static void | putModel (const casacore::MeasurementSet &thems, const casacore::RecordInterface &rec, const casacore::Matrix< casacore::Int > &indexComb, const casacore::Matrix< casacore::Int > &chansel, casacore::Bool iscomponentlist=true, casacore::Bool incremental=false) |
Verion 2.0 of putModel to support Intent index Comb is a Matrix of n rows 4 columns Each row is a unique combination of field_id, spw_id, scan_number, state_id for which this record is valid chansel is Matrix of nspw rows and 4 columns (spw_id, start, nchan, incr) More... | |
static void | clearModel (const casacore::MeasurementSet &thems) |
static void | clearModel (const casacore::MeasurementSet &thems, const casacore::String field, const casacore::String spws=casacore::String("")) |
...with field selection and optionally spw More... | |
static casacore::Bool | isModelDefined (const casacore::Int fieldId, const casacore::MeasurementSet &thems, casacore::String &key, casacore::Int &sourceRow) |
static casacore::Bool | isModelDefined (const casacore::String &elkey, const casacore::MeasurementSet &thems) |
static casacore::Bool | getModelRecord (const casacore::String &theKey, casacore::TableRecord &theRec, const casacore::MeasurementSet &theMs) |
static void | listModel (const casacore::MeasurementSet &thems) |
List the fields in the logger. More... | |
static casacore::Bool | hasAnyModel (const casacore::MeasurementSet &thems, casacore::Vector< casacore::Int > &fieldids) |
Returns true if any valid virtual model is found, fieldids of which are also returned. More... | |
static FTMachine * | NEW_FT (const casacore::Record &ftrec) |
![]() | |
static bool | setFactory (Factory, casacore::Int whichone=0) |
static VisModelDataI * | create () |
static VisModelDataI * | create2 () |
Private Member Functions | |
void | initializeToVis () |
casacore::Vector < casacore::CountedPtr < ComponentList > > | getCL (const casacore::Int msId, const casacore::Int fieldId, casacore::Int spw) |
casacore::Vector < casacore::CountedPtr < FTMachine > > | getFT (const casacore::Int msId, const casacore::Int fieldId, casacore::Int spw) |
void | getMatchingMachines (casacore::Vector< casacore::CountedPtr< FTMachine > > &ft, casacore::Vector< casacore::CountedPtr< ComponentList > > &cl, const vi::VisBuffer2 &vb) |
void | updateHolders (const vi::VisBuffer2 &vb, const std::vector< casacore::Int > &index) |
void | getUniqueIndicesComb (const vi::VisBuffer2 &vb, casacore::Vector< casacore::Vector< casacore::Int > > &retval) |
get all the combinations of field, spw, scan, state in this visbuffer More... | |
Private Attributes | |
casacore::Block < casacore::Vector < casacore::CountedPtr < ComponentList > > > | clholder_p |
casacore::Block < casacore::Vector < casacore::CountedPtr < FTMachine > > > | ftholder_p |
casacore::Block < casacore::Vector < casacore::Double > > | flatholder_p |
casacore::CountedPtr < ComponentFTMachine > | cft_p |
casacore::Cube< casacore::Int > | ftindex_p |
casacore::Cube< casacore::Int > | clindex_p |
std::map< std::vector < casacore::Int > , casacore::Int > | ftindex2_p |
These 2 maps will hold the index of ftholder_p or clholder_p from key (field_id, spw_id, scan, state, msid) More... | |
std::map< std::vector < casacore::Int > , casacore::Int > | clindex2_p |
casacore::Int | version_p |
Static Private Attributes | |
static casacore::Bool | initialize |
Additional Inherited Members | |
![]() | |
typedef VisModelDataI *(* | Factory )() |
Object to provide MODEL_DATA visibilities on demand.
Vis for Visibility ModelData is self explanatory
This Class also offer a lot of helper functions to query add and delete/modify models To be noted the models that are supported are FTMachines and Componentlist A given FIELD_ID can have multiple models added to the same record (i.e for e.g multiple spw models or multiple outlier images or in the case of componentlist multiple component list models. A model may be valid for multiple fields e.g a mosaic To save storage in such cases multiple field id will point to the same model Look for the keyword "definedmodel_field_x" in the Source table keywords (or the main table if source is not present). This will point to another key which is going to point to the model. Thus multiple "definedmodel_field_x" may point to the same key. If there is no valid SOURCE table the key will hold a casacore::Record of the model to use in the main table Otherwise in the SOURCE table the key will hold the row of the SOURCE table in whose SOURCE_MODEL cell the casacore::Record of the model to use will be resident. Now a given model casacore::Record in a SOURCE_MODEL cell can hold multiple FTMachine's or Compnentlist (e.g multiple direction images or spw images associated with a given field) and they are all cumulative (while respecting spw selection conditions) when a request is made for the model visibility
Definition at line 148 of file VisModelData.h.
casa::refim::VisModelData::VisModelData | ( | ) |
empty constructor
|
virtual |
From a FTMachine Record VisModelData(const casacore::Record& ftmachinerec, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds);.
void casa::refim::VisModelData::addFlatModel | ( | const casacore::Vector< casacore::Double > & | value, |
const casacore::Vector< casacore::Int > & | validfieldids, | ||
const casacore::Vector< casacore::Int > & | msIds | ||
) |
Add Image/FTMachine to generate visibilities for void addFTMachine(const casacore::Record& recordFTMachine, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds); Add componentlist to generate visibilities for void addCompFTMachine(const ComponentList& cl, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds); For simple model a special case for speed.
|
virtual |
add componentlists or ftmachines
Implements casa::VisModelDataI.
|
inlinevirtual |
Add Image/FTMachine to generate visibilities for void addFTMachine(const casacore::Record& recordFTMachine, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds); Add componentlist to generate visibilities for void addCompFTMachine(const ComponentList& cl, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds); For simple model a special case for speed.
void addFlatModel(const casacore::Vector<casacore::Double>& value, const casacore::Vector<casacore::Int>& validfieldids, const casacore::Vector<casacore::Int>& msIds);
add componentlists or ftmachines
Implements casa::VisModelDataI.
Definition at line 167 of file VisModelData.h.
|
staticprivate |
|
staticprivate |
Version 2.0.
|
static |
Referenced by clearModelI().
|
static |
...with field selection and optionally spw
|
inlinevirtual |
helper function to clear the keywordSet of the ms of the model for the fields in that ms
Implements casa::VisModelDataI.
Definition at line 201 of file VisModelData.h.
References clearModel().
|
virtual |
Implements casa::VisModelDataI.
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
static |
Referenced by getModelRecordI().
|
inlinevirtual |
Get a given model that is defined by key Forcing user to use a casacore::TableRecord rather than Generic casacore::RecordInterface...just so as to avoid a copy.
Implements casa::VisModelDataI.
Definition at line 216 of file VisModelData.h.
References getModelRecord().
|
virtual |
put the model data for this VisBuffer in the modelVisCube
Implements casa::VisModelDataI.
|
inlinevirtual |
//put the model data for this VisBuffer in the modelVisCube
Implements casa::VisModelDataI.
Definition at line 174 of file VisModelData.h.
|
private |
get all the combinations of field, spw, scan, state in this visbuffer
|
static |
Returns true if any valid virtual model is found, fieldids of which are also returned.
|
virtual |
check if an addFT or addCompFT is necessary casacore::Bool hasFT(casacore::Int msid, casacore::Int fieldid); casacore::Bool hasCL(casacore::Int msid, casacore::Int fieldid); returns a -1 if there is no model for this combination of ms,field,spw...but has not been // checked yet if there is one returns a -2 if it has been tested before but does have it.
returns a 1 if it has a model stored
Implements casa::VisModelDataI.
|
virtual |
Implements casa::VisModelDataI.
|
inlinevirtual |
Make sure that VisModel has been called once loaded checks and detection of version 1 or 2 is valid.
Implements casa::VisModelDataI.
Definition at line 237 of file VisModelData.h.
|
private |
|
static |
Referenced by isModelDefinedI().
|
static |
|
inlinevirtual |
Functions to see if model is defined in the casacore::MS either in the SOURCE table or else in the MAIN.
Implements casa::VisModelDataI.
Definition at line 207 of file VisModelData.h.
References isModelDefined().
|
inlinevirtual |
Implements casa::VisModelDataI.
Definition at line 235 of file VisModelData.h.
References version_p.
|
static |
List the fields in the logger.
|
staticprivate |
|
static |
|
static |
Referenced by putModelI().
|
static |
Verion 2.0 of putModel to support Intent index Comb is a Matrix of n rows 4 columns Each row is a unique combination of field_id, spw_id, scan_number, state_id for which this record is valid chansel is Matrix of nspw rows and 4 columns (spw_id, start, nchan, incr)
|
inlinevirtual |
this is a helper function that writes the model record to the ms
Implements casa::VisModelDataI.
Definition at line 176 of file VisModelData.h.
References putModel().
|
inlinevirtual |
Version 2 record to keep track of state and scan number.
Implements casa::VisModelDataI.
Definition at line 192 of file VisModelData.h.
References putModel().
|
staticprivate |
|
staticprivate |
put the casacore::Record by key if sourcerownum=-1 then it is saved in the main table this default should only be used if the optional SOURCE table in non-existant
|
staticprivate |
|
staticprivate |
Remove the casacore::Record which has the given key...will exterminate it from both the Source table or Main table.
|
staticprivate |
|
staticprivate |
|
private |
|
private |
Definition at line 265 of file VisModelData.h.
|
private |
Definition at line 262 of file VisModelData.h.
|
private |
Definition at line 270 of file VisModelData.h.
|
private |
Definition at line 267 of file VisModelData.h.
|
private |
Definition at line 264 of file VisModelData.h.
|
private |
Definition at line 263 of file VisModelData.h.
|
private |
These 2 maps will hold the index of ftholder_p or clholder_p from key (field_id, spw_id, scan, state, msid)
Definition at line 269 of file VisModelData.h.
|
private |
Definition at line 266 of file VisModelData.h.
|
staticprivate |
Definition at line 272 of file VisModelData.h.
|
private |
Definition at line 271 of file VisModelData.h.
Referenced by isVersion2().