|
| 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 VisBuffer &vb) |
| add componentlists or ftmachines More...
|
|
void | addModel (const casacore::RecordInterface &rec, const casacore::Vector< casacore::Int > &msids, const vi::VisBuffer2 &vb) |
|
VisModelDataI * | clone () |
|
casacore::Bool | getModelVis (VisBuffer &vb) |
| put the model data for this VisBuffer in the modelVisCube More...
|
|
casacore::Bool | getModelVis (vi::VisBuffer2 &vb) |
|
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 VisBuffer &vb) |
| init has to be called once at least to make sure isVersion2 to be correct More...
|
|
void | init (const vi::VisBuffer2 &) |
|
| 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 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) |
| casacore::List the fields More...
|
|
static FTMachine * | NEW_FT (const casacore::Record &ftrec) |
|
static bool | setFactory (Factory, casacore::Int whichone=0) |
|
static VisModelDataI * | create () |
|
static VisModelDataI * | create2 () |
|
|
static casacore::Bool | addToRec (casacore::TableRecord &therec, const casacore::Vector< casacore::Int > &spws) |
|
static casacore::Bool | addToRec (casacore::TableRecord &therec, const casacore::Matrix< casacore::Int > &combindex) |
|
static casacore::Bool | removeSpwFromMachineRec (casacore::RecordInterface &ftclrec, const casacore::Vector< casacore::Int > &spws) |
|
static casacore::Bool | removeFTFromRec (casacore::TableRecord &therec, const casacore::String &keyval, const casacore::Bool relabel=true) |
|
static casacore::Bool | removeSpw (casacore::TableRecord &therec, const casacore::Vector< casacore::Int > &spws, const casacore::Vector< casacore::Int > &fields=casacore::Vector< casacore::Int >(0)) |
|
static casacore::Bool | putModelRecord (const casacore::Vector< casacore::Int > &fieldIds, casacore::TableRecord &theRec, casacore::MeasurementSet &theMS) |
|
static void | removeRecordByKey (casacore::MeasurementSet &theMS, const casacore::String &theKey) |
| Remove the casacore::Record which has the given key...will exterminate it from both the Source table or Main table. More...
|
|
static void | putRecordByKey (casacore::MeasurementSet &theMS, const casacore::String &theKey, const casacore::TableRecord &theRec, const casacore::Int sourceRowNum=-1) |
| 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 More...
|
|
static void | deleteDiskImage (casacore::MeasurementSet &theMS, const casacore::String &theKey) |
|
static casacore::Int | firstSourceRowRecord (const casacore::Int field, const casacore::MeasurementSet &theMS, casacore::TableRecord &rec) |
|
static void | modifyDiskImagePath (casacore::Record &rec, const VisBuffer &vb) |
|
Object to provide MODEL_DATA visibilities on demand.
Prerequisite
and ComponentFTMachine
Etymology
Vis for Visibility ModelData is self explanatory
Synopsis
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
Example
VisibilityIterator vi(theMS,sort);
VisBuffer vb(vi);
casacore::MDirection myDir=vi.msColumns().field().phaseDirMeas(0);
ComponentList cl;
SkyComponent otherPoint(ComponentType::
POINT);
otherPoint.flux() = Flux<
casacore::
Double>(0.00001, 0.0, 0.0, 0.00000);
otherPoint.shape().setRefDirection(myDir);
clrec.define("
type", "componentlist");
clrec.define("fields", field);
clrec.defineRecord("container", container);
outRec.define("numcl", 1);
outRec.defineRecord("cl_0", clrec);
VisModelData.
putModel(theMS, container, field, spws,
casacore::
Vector<
casacore::Int>(1,0),
casacore::
Vector<
casacore::Int>(1,63),
casacore::
Vector<
casacore::Int>(1,1), true, false);
Setup vm to serve the model
for the fieldid()
}
for (vi.originChunks();vi.moreChunks(); vi.nextChunk()){
for (vi.origin(); vi.more(); vi++){
This fills the vb.modelVisCube with the appropriate model visibility
vm.getModelVis(vb);
cerr <<
"field " << vb.fieldId() <<
" spw " << vb.spectralWindow() <<
" max " <<
max(
amplitude(vb.modelVisCube())) << endl;
}
}
Motivation
Definition at line 147 of file VisModelData.h.