casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
casa::SubMS Class Reference

#include <SubMS.h>

Inheritance diagram for casa::SubMS:
casa::SimpleSubMS

Public Types

enum  RegriddingAlternatives {
  useFFTShift,
  useLinIntThenFFTShift
}
 
enum  asdmStManUseAlternatives {
  DONT,
  USE_FOR_DATA,
  USE_FOR_DATA_WEIGHT_SIGMA_FLAG
}
 

Public Member Functions

 SubMS (casacore::String &theMS, casacore::Table::TableOption option=casacore::Table::Old)
 
 SubMS (casacore::MeasurementSet &ms)
 construct from an MS More...
 
virtual ~SubMS ()
 
void setMS (casacore::MeasurementSet &ms)
 Change or Set the casacore::MS this casacore::MSSelector refers to. More...
 
casacore::Bool selectSpw (const casacore::String &spwstr, const casacore::Vector< casacore::Int > &steps)
 Select spw and channels for each spw. More...
 
void selectSpw (casacore::Vector< casacore::Int > spw, casacore::Vector< casacore::Int > nchan, casacore::Vector< casacore::Int > start, casacore::Vector< casacore::Int > step)
 This older version is used by the older version of setmsselect(). More...
 
casacore::Bool selectCorrelations (const casacore::String &corrstr)
 Setup polarization selection (for now, only from available correlations - no casacore::Stokes transformations.) More...
 
casacore::Bool setmsselect (const casacore::String &spw="", const casacore::String &field="", const casacore::String &baseline="", const casacore::String &scan="", const casacore::String &uvrange="", const casacore::String &taql="", const casacore::Vector< casacore::Int > &step=casacore::Vector< casacore::Int >(1, 1), const casacore::String &subarray="", const casacore::String &correlation="", const casacore::String &intent="", const casacore::String &obs="")
 select casacore::Time and time averaging or regridding void selectTime(); More...
 
void setmsselect (const casacore::String &spw, const casacore::String &field, const casacore::String &baseline, const casacore::String &scan, const casacore::String &obs, const casacore::String &uvrange, const casacore::String &taql, const casacore::Vector< casacore::Int > &nchan, const casacore::Vector< casacore::Int > &start, const casacore::Vector< casacore::Int > &step, const casacore::String &subarray, const casacore::String &intent="")
 This older version does not return a success value, and does need nchan, start, and step. More...
 
casacore::Bool selectSource (const casacore::Vector< casacore::Int > &fieldid)
 Select source or field. More...
 
void selectAntenna (const casacore::Vector< casacore::Int > &antennaids, const casacore::Vector< casacore::String > &antennaSel)
 Select Antennas to split out. More...
 
void selectArray (const casacore::String &subarray)
 Select array IDs to use. More...
 
void selectTime (casacore::Double timeBin=-1.0, casacore::String timerng="")
 select time parameters More...
 
void setFitOrder (casacore::Int fitorder, casacore::Bool advise=true)
 void selectSource(casacore::Vector<casacore::String> sourceid); More...
 
void setFitSpw (const casacore::String &fitspw)
 Set the selection string for line-free channels. More...
 
void setFitOutSpw (const casacore::String &fitoutspw)
 Selection string for output channels if doing continuum subtraction. More...
 
casacore::Bool makeSubMS (casacore::String &submsname, casacore::String &whichDataCol, const casacore::Vector< casacore::Int > &tileShape=casacore::Vector< casacore::Int >(1, 0), const casacore::String &combine="")
 Method to make the subMS. More...
 
virtual casacore::MeasurementSetmakeScratchSubMS (const casacore::Vector< casacore::MS::PredefinedColumns > &whichDataCols, const casacore::Bool forceInMemory=false)
 Method to make a scratch subMS and even in memory if posssible Useful if temporary subselection/averaging is necessary It'll be in memory if the basic output ms is less than half of memory reported by casacore::HostInfo unless forced to by user... More...
 
virtual casacore::MeasurementSetmakeScratchSubMS (const casacore::String &whichDataCol, const casacore::Bool forceInMemory=false)
 In this form whichDataCol gets passed to parseColumnNames(). More...
 
void verifyColumns (const casacore::MeasurementSet &ms, const casacore::Vector< casacore::MS::PredefinedColumns > &colNames)
 
casacore::Int regridSpw (casacore::String &message, const casacore::String &outframe="", const casacore::String &regridQuant="chan", const casacore::Double regridVeloRestfrq=-3E30, const casacore::String &regridInterpMeth="LINEAR", const casacore::Double regridCenter=-3E30, const casacore::Double regridBandwidth=-1., const casacore::Double regridChanWidth=-1., const casacore::Bool doHanningSmooth=false, const casacore::Int phaseCenterFieldId=-2, casacore::MDirection phaseCenter=casacore::MDirection(), const casacore::Bool centerIsStart=false, const casacore::Bool startIsEnd=false, const casacore::Int nchan=0, const casacore::Int width=0, const casacore::Int start=-1)
 Transform spectral data to different reference frame, optionally regrid the frequency channels return values: -1 = casacore::MS not modified, 1 = casacore::MS modified and OK, 0 = casacore::MS modified but not OK (i.e. More...
 
casacore::Bool createPartnerColumn (casacore::TableDesc &modMSTD, const casacore::String &oldName, const casacore::String &newName, const casacore::Int &hypercolumnDim, const casacore::IPosition &tileShape)
 Support method for regridSpw(): results in the column oldName being renamed to newName, and a new column which is an empty copy of oldName being created together with a TileShapeStMan data manager and hypercolumn (name copied from the old hypercolumn) with given dimension, the old hypercolumn of name hypercolumnName is renamed to name+"B". More...
 
casacore::Bool setRegridParameters (std::vector< casacore::Int > &oldSpwId, std::vector< casacore::Int > &oldFieldId, std::vector< casacore::Int > &newDataDescId, std::vector< casacore::Bool > &regrid, std::vector< casacore::Bool > &transform, std::vector< casacore::MDirection > &theFieldDirV, std::vector< casacore::MPosition > &mObsPosV, std::vector< casacore::MFrequency::Types > &fromFrameTypeV, std::vector< casacore::MFrequency::Ref > &outFrameV, std::vector< casacore::MRadialVelocity > &outRadVelV, std::vector< casacore::Double > &weightScaleV, std::vector< casacore::Vector< casacore::Double > > &xold, std::vector< casacore::Vector< casacore::Double > > &xout, std::vector< casacore::Vector< casacore::Double > > &xin, vector< casacore::Int > &method, casacore::Bool &msMod, const casacore::String &outframe, const casacore::String &regridQuant, const casacore::Double regridVeloRestfrq, const casacore::String &regridInterpMeth, const casacore::Double regridCenter, const casacore::Double regridBandwidth, const casacore::Double regridChanWidth, const casacore::Int regridPhaseCenterFieldId, const casacore::MDirection regridPhaseCenter, const casacore::Bool writeTables, casacore::LogIO &os, casacore::String &regridMessage, const casacore::Bool centerIsStart=false, const casacore::Bool startIsEnd=false, const casacore::Int nchan=0, const casacore::Int width=0, const casacore::Int start=-1)
 Support method for regridSpw(): if writeTables is false, the (const) input parameters are only verified, nothing is written; return value is true if the parameters are OK. More...
 
casacore::Bool combineSpws (const casacore::Vector< casacore::Int > &spwids, const casacore::Bool noModify, casacore::Vector< casacore::Double > &newCHAN_FREQ, casacore::Vector< casacore::Double > &newCHAN_WIDTH, casacore::Bool verbose=false)
 combineSpws(): make one spectral window from all spws given by the spwids vector More...
 
casacore::Bool combineSpws (const casacore::Vector< casacore::Int > &spwids=casacore::Vector< casacore::Int >(1,-1))
 
void setTVIDebug (bool debug)
 
void setWantCont (bool want_cont)
 

Static Public Member Functions

static std::set< casacore::IntfindBadSpws (casacore::MeasurementSet &ms, casacore::Vector< casacore::Int > spwv)
 Returns the set (possibly empty) of spectral windows that are in spwv but not listed in ms's DATA_DESCRIPTION subtable. More...
 
static casacore::Bool pickAntennas (casacore::Vector< casacore::Int > &selected_antennaids, casacore::Vector< casacore::String > &selected_antenna_strs, const casacore::Vector< casacore::Int > &antennaids, const casacore::Vector< casacore::String > &antennaSel)
 
static casacore::MeasurementSetsetupMS (const casacore::String &msname, const casacore::Int nchan, const casacore::Int npol, const casacore::String &telescop, const casacore::Vector< casacore::MS::PredefinedColumns > &colNamesTok, const casacore::Int obstype=0, const casacore::Bool compress=false, const asdmStManUseAlternatives asdmStManUse=DONT)
 This sets up a default new ms Declared static as it can be (and is) called directly outside of SubMS. More...
 
static casacore::MeasurementSetsetupMS (const casacore::String &msname, const casacore::Int nchan, const casacore::Int npol, const casacore::Vector< casacore::MS::PredefinedColumns > &colNamesTok, const casacore::Vector< casacore::Int > &tileShape=casacore::Vector< casacore::Int >(1, 0), const casacore::Bool compress=false, const asdmStManUseAlternatives asdmStManUse=DONT)
 Same as above except allowing manual tileshapes. More...
 
static casacore::uInt addOptionalColumns (const casacore::Table &inTab, casacore::Table &outTab, const casacore::Bool beLazy=false)
 Add optional columns to outTab if present in inTab and possColNames. More...
 
static casacore::Bool copyCols (casacore::Table &out, const casacore::Table &in, const casacore::Bool flush=true)
 Like casacore::TableCopy::copyRows, but by column. More...
 
static void createSubtables (casacore::MeasurementSet &ms, casacore::Table::TableOption option)
 A customized version of casacore::MS::createDefaultSubtables(). More...
 
static const casacore::Vector
< casacore::MS::PredefinedColumns > & 
parseColumnNames (casacore::String colNameList)
 Declared static because it's used in setupMS(). More...
 
static const casacore::Vector
< casacore::MS::PredefinedColumns > & 
parseColumnNames (casacore::String colNameList, const casacore::MeasurementSet &ms)
 This version uses the casacore::MeasurementSet to check what columns are present, i.e. More...
 
static casacore::Bool mustConvertToData (const casacore::uInt nTok, const casacore::Vector< casacore::MS::PredefinedColumns > &datacols)
 The output casacore::MS must have (at least?) 1 of DATA, FLOAT_DATA, or LAG_DATA. More...
 
static casacore::Bool sepFloat (const casacore::Vector< casacore::MS::PredefinedColumns > &anyDataCols, casacore::Vector< casacore::MS::PredefinedColumns > &complexDataCols)
 
static casacore::Bool getCorrMaps (casacore::MSSelection &mssel, const casacore::MeasurementSet &ms, casacore::Vector< casacore::Vector< casacore::Int > > &outToIn, const casacore::Bool areSelecting=false)
 Fills outToIn[pol] with a map from output correlation index to input correlation index, for each input polID pol. More...
 
static void remap (casacore::Vector< casacore::Int > &col, const casacore::Vector< casacore::Int > &mapper)
 Replaces col[i] with mapper[col[i]] for each element of col. More...
 
static void remap (casacore::Vector< casacore::Int > &col, const std::map< casacore::Int, casacore::Int > &mapper)
 
static casacore::lDouble vrad (const casacore::lDouble freq, const casacore::lDouble rest)
 the following inline convenience methods for regridSpw bypass the whole CASA measure system because when they are used, they can assume that the frame stays the same and the units are OK More...
 
static casacore::lDouble vopt (const casacore::lDouble freq, const casacore::lDouble rest)
 
static casacore::lDouble lambda (const casacore::lDouble freq)
 
static casacore::lDouble freq_from_vrad (const casacore::lDouble vrad, const casacore::lDouble rest)
 
static casacore::lDouble freq_from_vopt (const casacore::lDouble vopt, const casacore::lDouble rest)
 
static casacore::lDouble freq_from_lambda (const casacore::lDouble lambda)
 
static casacore::Bool regridChanBounds (casacore::Vector< casacore::Double > &newChanLoBound, casacore::Vector< casacore::Double > &newChanHiBound, const casacore::Double regridCenter, const casacore::Double regridBandwidth, const casacore::Double regridChanWidth, const casacore::Double regridVeloRestfrq, const casacore::String regridQuant, const casacore::Vector< casacore::Double > &transNewXin, const casacore::Vector< casacore::Double > &transCHAN_WIDTH, casacore::String &message, const casacore::Bool centerIsStart=false, const casacore::Bool startIsEnd=false, const casacore::Int nchan=0, const casacore::Int width=0, const casacore::Int start=-1)
 Support method for regridSpw(): calculate the final new channel boundaries from the regridding parameters and the old channel boundaries (already transformed to the desired reference frame); returns false if input paramters were invalid and no useful boundaries could be created. More...
 
static casacore::Bool convertGridPars (casacore::LogIO &os, const casacore::String &mode, const int nchan, const casacore::String &start, const casacore::String &width, const casacore::String &interp, const casacore::String &restfreq, const casacore::String &outframe, const casacore::String &veltype, casacore::String &t_mode, casacore::String &t_outframe, casacore::String &t_regridQuantity, casacore::Double &t_restfreq, casacore::String &t_regridInterpMeth, casacore::Double &t_cstart, casacore::Double &t_bandwidth, casacore::Double &t_cwidth, casacore::Bool &t_centerIsStart, casacore::Bool &t_startIsEnd, casacore::Int &t_nchan, casacore::Int &t_width, casacore::Int &t_start)
 a helper function for handling the gridding parameter user input More...
 
static casacore::Bool calcChanFreqs (casacore::LogIO &os, casacore::Vector< casacore::Double > &newCHAN_FREQ, casacore::Vector< casacore::Double > &newCHAN_WIDTH, const casacore::Vector< casacore::Double > &oldCHAN_FREQ, const casacore::Vector< casacore::Double > &oldCHAN_WIDTH, const casacore::MDirection phaseCenter, const casacore::MFrequency::Types theOldRefFrame, const casacore::MEpoch theObsTime, const casacore::MPosition mObsPos, const casacore::String &mode, const int nchan, const casacore::String &start, const casacore::String &width, const casacore::String &restfreq, const casacore::String &outframe, const casacore::String &veltype, const casacore::Bool verbose=false, const casacore::MRadialVelocity mRV=casacore::MRadialVelocity())
 A wrapper for SubMS::regridChanBounds() which takes the user interface type gridding parameters The ready-made grid is returned in newCHAN_FREQ and newCHAN_WIDTH. More...
 
static casacore::Bool calcChanFreqs (casacore::LogIO &os, casacore::Vector< casacore::Double > &newCHAN_FREQ, casacore::Vector< casacore::Double > &newCHAN_WIDTH, casacore::Double &weightScale, const casacore::Vector< casacore::Double > &oldCHAN_FREQ, const casacore::Vector< casacore::Double > &oldCHAN_WIDTH, const casacore::MDirection phaseCenter, const casacore::MFrequency::Types theOldRefFrame, const casacore::MEpoch theObsTime, const casacore::MPosition mObsPos, const casacore::String &mode, const int nchan, const casacore::String &start, const casacore::String &width, const casacore::String &restfreq, const casacore::String &outframe, const casacore::String &veltype, const casacore::Bool verbose=false, const casacore::MRadialVelocity mRV=casacore::MRadialVelocity())
 Overloaded version of the above method returning the additional value weightScale which is the factor by which WEIGHT needs to be scaled when transforming from the old grid to the new grid. More...
 
static void getDataColMap (casacore::MSColumns *msc, casacore::ArrayColumn< casacore::Complex > *mapper, casacore::uInt ntok, const casacore::Vector< casacore::MS::PredefinedColumns > &colEnums)
 Fills mapper[ntok] with a map from dataColumn indices to ArrayColumns in the output. More...
 

Protected Member Functions

casacore::Bool makeSelection ()
 method that returns the selected ms (?! - but it's Boolean - RR) More...
 
casacore::Bool fillAllTables (const casacore::Vector< casacore::MS::PredefinedColumns > &colNames)
 (Sub)table fillers. More...
 
casacore::Bool fillDDTables ()
 
casacore::Bool fillFieldTable ()
 
casacore::Bool writeAllMainRows (const casacore::Vector< casacore::MS::PredefinedColumns > &colNames)
 Used to be fillMainTable(colnames), but what distinguishes it from writeSomeMainRows(colnames) is that it is for cases where there is a 1-1 match between rows in mssel_p and msOut_p (including order). More...
 
casacore::Bool writeSomeMainRows (const casacore::Vector< casacore::MS::PredefinedColumns > &colNames)
 Used to be fillAverMainTable(colnames), but what distinguishes it from writeAllMainRows(colnames) is that it is for cases where there is not necessarily a 1-1 match between rows in mssel_p and msOut_p. More...
 
casacore::Bool copyAntenna ()
 
casacore::Bool copyFeed ()
 
casacore::Bool copyFlag_Cmd ()
 
casacore::Bool copyHistory ()
 
casacore::Bool copyObservation ()
 
casacore::Bool copyPointing ()
 
casacore::Bool copyProcessor ()
 
casacore::Bool copySource ()
 
casacore::Bool copyState ()
 
casacore::Bool copySyscal ()
 
casacore::Bool copyWeather ()
 
casacore::Bool copyGenericSubtables ()
 
void copyMainTableKeywords (casacore::TableRecord &outKeys, const casacore::TableRecord &inKeys)
 
casacore::Bool filterOptSubtable (const casacore::String &subtabname)
 This falls between copyGenericSubtables() and the copiers for standard subtables like copyFeed(). More...
 
casacore::Bool fillAccessoryMainCols ()
 casacore::Bool writeDiffSpwShape(const casacore::Vector<casacore::MS::PredefinedColumns>& colNames); More...
 
void copySubtable (const casacore::String &tabName, const casacore::Table &inTab, const casacore::Bool noRows=false)
 *** Private member functions *** More...
 
casacore::Bool getDataColumn (casacore::ArrayColumn< casacore::Complex > &data, const casacore::MS::PredefinedColumns colName)
 
casacore::Bool getDataColumn (casacore::ArrayColumn< casacore::Float > &data, const casacore::MS::PredefinedColumns colName)
 
casacore::Bool putDataColumn (casacore::MSColumns &msc, casacore::ArrayColumn< casacore::Complex > &data, const casacore::MS::PredefinedColumns datacol, const casacore::Bool writeToDataCol=false)
 
casacore::Bool putDataColumn (casacore::MSColumns &msc, casacore::ArrayColumn< casacore::Float > &data, const casacore::MS::PredefinedColumns datacol, const casacore::Bool writeToDataCol=false)
 
casacore::Bool copyDataFlagsWtSp (const casacore::Vector< casacore::MS::PredefinedColumns > &colNames, const casacore::Bool writeToDataCol)
 This method uses VisIter for efficient copy mode data transfer. More...
 
casacore::Bool subtractContinuum (const casacore::Vector< casacore::MS::PredefinedColumns > &colNames, const VBRemapper &remapper)
 Like doTimeAver(), but it subtracts the continuum instead of time averaging. More...
 
casacore::Bool doChannelMods (const casacore::Vector< casacore::MS::PredefinedColumns > &colNames)
 
void fill_vbmaps (std::map< VisBufferComponents::EnumType, std::map< casacore::Int, casacore::Int > > &vbmaps)
 
casacore::Double n_bytes ()
 
return the number of unique antennas selected

casacore::Int numOfBaselines(casacore::Vector<casacore::Int>& ant1, casacore::Vector<casacore::Int>& ant2, casacore::Bool includeAutoCorr=false); More...

 
const casacore::ArrayColumn
< casacore::Complex > & 
right_column (const casacore::ROMSColumns *ms_p, const casacore::MS::PredefinedColumns datacol)
 Picks a reference to DATA, MODEL_DATA, CORRECTED_DATA, or LAG_DATA out of ms_p. More...
 
casacore::ArrayColumn
< casacore::Complex > & 
right_column (casacore::MSColumns *msclala, const casacore::MS::PredefinedColumns col, const casacore::Bool writeToDataCol)
 The writable version of the above. More...
 
casacore::uInt fillAntIndexer (std::map< casacore::Int, casacore::Int > &antIndexer, const casacore::ROMSColumns *msc)
 Figures out the number, maximum, and index of the selected antennas. More...
 
casacore::Bool doTimeAver (const casacore::Vector< casacore::MS::PredefinedColumns > &dataColNames, const VBRemapper &remapper)
 Read the input, time average it to timeBin_p, and write the output. More...
 
casacore::Bool doTimeAverVisIterator (const casacore::Vector< casacore::MS::PredefinedColumns > &dataColNames, const VBRemapper &remapper)
 
void getDataColMap (casacore::ArrayColumn< casacore::Complex > *mapper, casacore::uInt ntok, const casacore::Vector< casacore::MS::PredefinedColumns > &colEnums)
 
casacore::Bool areDataShapesConstant ()
 Returns whether or not the numbers of correlations and channels are independent of DATA_DESCRIPTION_ID, for both the input and output MSes. More...
 
casacore::Bool existsFlagCategory () const
 Returns whether or not the input casacore::MS has a valid FLAG_CATEGORY, and its first row has the right number of correlations and channels. More...
 
void relabelSources ()
 Sets up sourceRelabel_p for mapping input SourceIDs (if any) to output ones. More...
 
void relabelIDs ()
 
void remapColumn (casacore::ScalarColumn< casacore::Int > &outcol, const casacore::ScalarColumn< casacore::Int > &incol, const casacore::Vector< casacore::Int > &selvals)
 Sets outcol to the indices of selvals that correspond to incol, i.e. More...
 
void remapColumn (casacore::ScalarColumn< casacore::Int > &outcol, const casacore::ScalarColumn< casacore::Int > &incol)
 Equivalent to but slightly more efficient than remapColumn(outcol, incol, incol.getColumn()). More...
 
casacore::uInt remapped (const casacore::Int ov, const casacore::Vector< casacore::Int > &mapper, casacore::uInt i)
 
void setupNewPointing ()
 Sets up the stub of a POINTING, enough to create an MSColumns. More...
 
casacore::Bool setSortOrder (casacore::Block< casacore::Int > &sort, const casacore::String &uncombinable="", const casacore::Bool verbose=true) const
 Sets sort to a casacore::Block of columns that a VisibilityIterator should sort by, according to combine_p. More...
 
casacore::Bool shouldWatch (casacore::Bool &conflict, const casacore::String &col, const casacore::String &uncombinable="", const casacore::Bool verbose=true) const
 Returns whether col is (not in combine_p) || in uncombinable. More...
 

Static Protected Member Functions

static casacore::uInt dataColStrToEnums (const casacore::String &col, casacore::Vector< casacore::MS::PredefinedColumns > &colvec)
 Helper function for parseColumnNames(). More...
 
static void make_map (std::map< casacore::Int, casacore::Int > &mapper, const casacore::Vector< casacore::Int > &inv)
 static void make_map(const casacore::Vector<casacore::Int>& mscol, casacore::Vector<casacore::Int>& mapper); More...
 
static void make_map2 (std::map< casacore::Int, casacore::Int > &mapper, const casacore::Vector< casacore::Int > &inv)
 Sets mapper to form a map from inv whose elements are mapped values. More...
 

Protected Attributes

casacore::MeasurementSet ms_p
 *** Member variables *** More...
 
casacore::MeasurementSet mssel_p
 
casacore::MSColumnsmsc_p
 
casacore::ROMSColumnsmscIn_p
 
casacore::Bool keepShape_p
 
casacore::Bool antennaSel_p
 same shape as the corresponding input one. More...
 
casacore::Double timeBin_p
 
casacore::String scanString_p
 
casacore::String intentString_p
 
casacore::String obsString_p
 
casacore::String uvrangeString_p
 
casacore::String taqlString_p
 
casacore::String timeRange_p
 
casacore::String arrayExpr_p
 
casacore::String corrString_p
 
casacore::String combine_p
 
casacore::Int fitorder_p
 scan #, observation, and/or state ID? Must be lowercase at all times. More...
 
casacore::String fitspw_p
 If < 0 (default), continuum subtraction is not done. More...
 
casacore::String fitoutspw_p
 
casacore::Bool fillMainTable_p
 continuum subtraction. More...
 
casacore::MeasurementSet msOut_p
 Uninitialized by ctors. More...
 
casacore::Vector< casacore::Intspw_p
 
casacore::Vector< casacore::Intspw_uniq_p
 
casacore::Vector< casacore::Intspwind_to_min_spwind_p
 
casacore::Vector< casacore::Intnchan_p
 
casacore::Vector< casacore::Inttotnchan_p
 
casacore::Vector< casacore::IntchanStart_p
 
casacore::Vector< casacore::IntchanEnd_p
 
casacore::Vector< casacore::IntchanStep_p
 
casacore::Vector< casacore::Intwidths_p
 input channel will be used. More...
 
casacore::Vector< casacore::Intncorr_p
 
casacore::Vector< casacore::IntinNumChan_p
 
casacore::Vector< casacore::IntinNumCorr_p
 
casacore::Vector< casacore::Intfieldid_p
 
casacore::Vector< casacore::IntspwRelabel_p
 
casacore::Vector< casacore::IntfieldRelabel_p
 
casacore::Vector< casacore::IntsourceRelabel_p
 
casacore::Vector< casacore::IntoldDDSpwMatch_p
 
casacore::Vector
< casacore::String
antennaSelStr_p
 
casacore::Vector< casacore::IntantennaId_p
 
casacore::Vector< casacore::IntantIndexer_p
 
casacore::Vector< casacore::IntantNewIndex_p
 
casacore::Vector< casacore::IntselObsId_p
 
casacore::Vector< casacore::IntpolID_p
 
casacore::Vector< casacore::uIntspw2ddid_p
 
casacore::Vector
< casacore::Vector
< casacore::Int > > 
inPolOutCorrToInCorrMap_p
 inCorrInd = outPolCorrToInCorrMap_p[polID_p[ddID]][outCorrInd] More...
 
std::map< casacore::Int,
casacore::Int
stateRemapper_p
 
casacore::Vector
< casacore::Vector
< casacore::Slice > > 
chanSlices_p
 
casacore::Vector< casacore::SlicecorrSlice_p
 
casacore::Vector
< casacore::Vector
< casacore::Slice > > 
corrSlices_p
 
casacore::Matrix
< casacore::Double
selTimeRanges_p
 
bool tvi_debug
 
bool want_cont_p
 

Friends

class MSTransformManager
 jagonzal: Allow TransformVisDataHandler to access protected methods and members of this class More...
 

Detailed Description

Definition at line 111 of file SubMS.h.

Member Enumeration Documentation

Enumerator
DONT 
USE_FOR_DATA 
USE_FOR_DATA_WEIGHT_SIGMA_FLAG 

Definition at line 124 of file SubMS.h.

Enumerator
useFFTShift 
useLinIntThenFFTShift 

Definition at line 119 of file SubMS.h.

Constructor & Destructor Documentation

casa::SubMS::SubMS ( casacore::String theMS,
casacore::Table::TableOption  option = casacore::Table::Old 
)
casa::SubMS::SubMS ( casacore::MeasurementSet ms)

construct from an MS

virtual casa::SubMS::~SubMS ( )
virtual

Member Function Documentation

static casacore::uInt casa::SubMS::addOptionalColumns ( const casacore::Table inTab,
casacore::Table outTab,
const casacore::Bool  beLazy = false 
)
static

Add optional columns to outTab if present in inTab and possColNames.

beLazy should only be true if outTab is in its default state. Returns the number of added columns.

casacore::Bool casa::SubMS::areDataShapesConstant ( )
protected

Returns whether or not the numbers of correlations and channels are independent of DATA_DESCRIPTION_ID, for both the input and output MSes.

static casacore::Bool casa::SubMS::calcChanFreqs ( casacore::LogIO os,
casacore::Vector< casacore::Double > &  newCHAN_FREQ,
casacore::Vector< casacore::Double > &  newCHAN_WIDTH,
const casacore::Vector< casacore::Double > &  oldCHAN_FREQ,
const casacore::Vector< casacore::Double > &  oldCHAN_WIDTH,
const casacore::MDirection  phaseCenter,
const casacore::MFrequency::Types  theOldRefFrame,
const casacore::MEpoch  theObsTime,
const casacore::MPosition  mObsPos,
const casacore::String mode,
const int  nchan,
const casacore::String start,
const casacore::String width,
const casacore::String restfreq,
const casacore::String outframe,
const casacore::String veltype,
const casacore::Bool  verbose = false,
const casacore::MRadialVelocity  mRV = casacore::MRadialVelocity() 
)
static

A wrapper for SubMS::regridChanBounds() which takes the user interface type gridding parameters The ready-made grid is returned in newCHAN_FREQ and newCHAN_WIDTH.

Parameters
newCHAN_FREQoutput
oldCHAN_FREQinput
phaseCenterthe gridding parameters
mRVused e.g. when outframe=="SOURCE"
static casacore::Bool casa::SubMS::calcChanFreqs ( casacore::LogIO os,
casacore::Vector< casacore::Double > &  newCHAN_FREQ,
casacore::Vector< casacore::Double > &  newCHAN_WIDTH,
casacore::Double weightScale,
const casacore::Vector< casacore::Double > &  oldCHAN_FREQ,
const casacore::Vector< casacore::Double > &  oldCHAN_WIDTH,
const casacore::MDirection  phaseCenter,
const casacore::MFrequency::Types  theOldRefFrame,
const casacore::MEpoch  theObsTime,
const casacore::MPosition  mObsPos,
const casacore::String mode,
const int  nchan,
const casacore::String start,
const casacore::String width,
const casacore::String restfreq,
const casacore::String outframe,
const casacore::String veltype,
const casacore::Bool  verbose = false,
const casacore::MRadialVelocity  mRV = casacore::MRadialVelocity() 
)
static

Overloaded version of the above method returning the additional value weightScale which is the factor by which WEIGHT needs to be scaled when transforming from the old grid to the new grid.

Parameters
newCHAN_FREQoutput
oldCHAN_FREQinput
phaseCenterthe gridding parameters
mRVused e.g. when outframe=="SOURCE"
casacore::Bool casa::SubMS::combineSpws ( const casacore::Vector< casacore::Int > &  spwids,
const casacore::Bool  noModify,
casacore::Vector< casacore::Double > &  newCHAN_FREQ,
casacore::Vector< casacore::Double > &  newCHAN_WIDTH,
casacore::Bool  verbose = false 
)

combineSpws(): make one spectral window from all spws given by the spwids vector

Referenced by combineSpws().

casacore::Bool casa::SubMS::combineSpws ( const casacore::Vector< casacore::Int > &  spwids = casacore::Vector<casacore::Int>(1,-1))
inline

Definition at line 501 of file SubMS.h.

References combineSpws().

static casacore::Bool casa::SubMS::convertGridPars ( casacore::LogIO os,
const casacore::String mode,
const int  nchan,
const casacore::String start,
const casacore::String width,
const casacore::String interp,
const casacore::String restfreq,
const casacore::String outframe,
const casacore::String veltype,
casacore::String t_mode,
casacore::String t_outframe,
casacore::String t_regridQuantity,
casacore::Double t_restfreq,
casacore::String t_regridInterpMeth,
casacore::Double t_cstart,
casacore::Double t_bandwidth,
casacore::Double t_cwidth,
casacore::Bool t_centerIsStart,
casacore::Bool t_startIsEnd,
casacore::Int t_nchan,
casacore::Int t_width,
casacore::Int t_start 
)
static

a helper function for handling the gridding parameter user input

casacore::Bool casa::SubMS::copyAntenna ( )
protected
static casacore::Bool casa::SubMS::copyCols ( casacore::Table out,
const casacore::Table in,
const casacore::Bool  flush = true 
)
static

Like casacore::TableCopy::copyRows, but by column.

casacore::Bool casa::SubMS::copyDataFlagsWtSp ( const casacore::Vector< casacore::MS::PredefinedColumns > &  colNames,
const casacore::Bool  writeToDataCol 
)
protected

This method uses VisIter for efficient copy mode data transfer.

casacore::Bool casa::SubMS::copyFeed ( )
protected
casacore::Bool casa::SubMS::copyFlag_Cmd ( )
protected
casacore::Bool casa::SubMS::copyGenericSubtables ( )
protected
casacore::Bool casa::SubMS::copyHistory ( )
protected
void casa::SubMS::copyMainTableKeywords ( casacore::TableRecord outKeys,
const casacore::TableRecord inKeys 
)
protected
casacore::Bool casa::SubMS::copyObservation ( )
protected
casacore::Bool casa::SubMS::copyPointing ( )
protected
casacore::Bool casa::SubMS::copyProcessor ( )
protected
casacore::Bool casa::SubMS::copySource ( )
protected
casacore::Bool casa::SubMS::copyState ( )
protected
void casa::SubMS::copySubtable ( const casacore::String tabName,
const casacore::Table inTab,
const casacore::Bool  noRows = false 
)
protected

*** Private member functions ***

Adds and copies inTab to msOut_p without any filtering. tabName is the table "type", i.e. POINTING or SYSPOWER without the preceding path.

If noRows is true, the structure will be setup but no rows will be copied. (Useful for filtering)

casacore::Bool casa::SubMS::copySyscal ( )
protected
casacore::Bool casa::SubMS::copyWeather ( )
protected
casacore::Bool casa::SubMS::createPartnerColumn ( casacore::TableDesc modMSTD,
const casacore::String oldName,
const casacore::String newName,
const casacore::Int hypercolumnDim,
const casacore::IPosition tileShape 
)

Support method for regridSpw(): results in the column oldName being renamed to newName, and a new column which is an empty copy of oldName being created together with a TileShapeStMan data manager and hypercolumn (name copied from the old hypercolumn) with given dimension, the old hypercolumn of name hypercolumnName is renamed to name+"B".

static void casa::SubMS::createSubtables ( casacore::MeasurementSet ms,
casacore::Table::TableOption  option 
)
static

A customized version of casacore::MS::createDefaultSubtables().

static casacore::uInt casa::SubMS::dataColStrToEnums ( const casacore::String col,
casacore::Vector< casacore::MS::PredefinedColumns > &  colvec 
)
staticprotected

Helper function for parseColumnNames().

Converts col to a list of casacore::MS::PredefinedColumnss, and returns the # of recognized data columns. static because parseColumnNames() is static.

casacore::Bool casa::SubMS::doChannelMods ( const casacore::Vector< casacore::MS::PredefinedColumns > &  colNames)
protected
casacore::Bool casa::SubMS::doTimeAver ( const casacore::Vector< casacore::MS::PredefinedColumns > &  dataColNames,
const VBRemapper remapper 
)
protected

Read the input, time average it to timeBin_p, and write the output.

The first version uses VisibilityIterator (much faster), but the second supports correlation selection using VisIterator. VisIterator should be sped up soon!

casacore::Bool casa::SubMS::doTimeAverVisIterator ( const casacore::Vector< casacore::MS::PredefinedColumns > &  dataColNames,
const VBRemapper remapper 
)
protected
casacore::Bool casa::SubMS::existsFlagCategory ( ) const
protected

Returns whether or not the input casacore::MS has a valid FLAG_CATEGORY, and its first row has the right number of correlations and channels.

void casa::SubMS::fill_vbmaps ( std::map< VisBufferComponents::EnumType, std::map< casacore::Int, casacore::Int > > &  vbmaps)
protected
casacore::Bool casa::SubMS::fillAccessoryMainCols ( )
protected

casacore::Bool writeDiffSpwShape(const casacore::Vector<casacore::MS::PredefinedColumns>& colNames);

casacore::Bool casa::SubMS::fillAllTables ( const casacore::Vector< casacore::MS::PredefinedColumns > &  colNames)
protected

(Sub)table fillers.

casacore::uInt casa::SubMS::fillAntIndexer ( std::map< casacore::Int, casacore::Int > &  antIndexer,
const casacore::ROMSColumns msc 
)
protected

Figures out the number, maximum, and index of the selected antennas.

casacore::Bool casa::SubMS::fillDDTables ( )
protected
casacore::Bool casa::SubMS::fillFieldTable ( )
protected
casacore::Bool casa::SubMS::filterOptSubtable ( const casacore::String subtabname)
protected

This falls between copyGenericSubtables() and the copiers for standard subtables like copyFeed().

It is for optional subtables like CALDEVICE and SYSPOWER which can be watched for by name and may need their ANTENNA_ID and SPECTRAL_WINDOW_ID columns remapped. (Technically FEED_ID, too, if split ever starts remapping feeds.)

It must be called BEFORE copyGenericSubtables()!

static std::set<casacore::Int> casa::SubMS::findBadSpws ( casacore::MeasurementSet ms,
casacore::Vector< casacore::Int spwv 
)
static

Returns the set (possibly empty) of spectral windows that are in spwv but not listed in ms's DATA_DESCRIPTION subtable.

(This happens with certain calibration/hardware setups.)

static casacore::lDouble casa::SubMS::freq_from_lambda ( const casacore::lDouble  lambda)
inlinestatic

Definition at line 340 of file SubMS.h.

References casacore::C::c.

static casacore::lDouble casa::SubMS::freq_from_vopt ( const casacore::lDouble  vopt,
const casacore::lDouble  rest 
)
inlinestatic

Definition at line 339 of file SubMS.h.

References casacore::C::c.

static casacore::lDouble casa::SubMS::freq_from_vrad ( const casacore::lDouble  vrad,
const casacore::lDouble  rest 
)
inlinestatic

Definition at line 338 of file SubMS.h.

References casacore::C::c.

static casacore::Bool casa::SubMS::getCorrMaps ( casacore::MSSelection mssel,
const casacore::MeasurementSet ms,
casacore::Vector< casacore::Vector< casacore::Int > > &  outToIn,
const casacore::Bool  areSelecting = false 
)
static

Fills outToIn[pol] with a map from output correlation index to input correlation index, for each input polID pol.

It does not yet check the appropriateness of the correlation selection string, so ignore the return value for now. outToIn[pol] defaults to an empty casacore::Vector if no correlations are selected for pol. That is not the same as the default "select everything in ms".

static void casa::SubMS::getDataColMap ( casacore::MSColumns msc,
casacore::ArrayColumn< casacore::Complex > *  mapper,
casacore::uInt  ntok,
const casacore::Vector< casacore::MS::PredefinedColumns > &  colEnums 
)
static

Fills mapper[ntok] with a map from dataColumn indices to ArrayColumns in the output.

mapper must have ntok slots!

Referenced by getDataColMap().

void casa::SubMS::getDataColMap ( casacore::ArrayColumn< casacore::Complex > *  mapper,
casacore::uInt  ntok,
const casacore::Vector< casacore::MS::PredefinedColumns > &  colEnums 
)
inlineprotected

Definition at line 638 of file SubMS.h.

References getDataColMap(), and msc_p.

casacore::Bool casa::SubMS::getDataColumn ( casacore::ArrayColumn< casacore::Complex > &  data,
const casacore::MS::PredefinedColumns  colName 
)
protected
casacore::Bool casa::SubMS::getDataColumn ( casacore::ArrayColumn< casacore::Float > &  data,
const casacore::MS::PredefinedColumns  colName 
)
protected
static casacore::lDouble casa::SubMS::lambda ( const casacore::lDouble  freq)
inlinestatic

Definition at line 337 of file SubMS.h.

References casacore::C::c.

static void casa::SubMS::make_map ( std::map< casacore::Int, casacore::Int > &  mapper,
const casacore::Vector< casacore::Int > &  inv 
)
staticprotected

static void make_map(const casacore::Vector<casacore::Int>& mscol, casacore::Vector<casacore::Int>& mapper);

Sets mapper to to a map from the distinct values of inv, in increasing order, to 0, 1, 2,..., mapper.size() - 1.

static void casa::SubMS::make_map2 ( std::map< casacore::Int, casacore::Int > &  mapper,
const casacore::Vector< casacore::Int > &  inv 
)
staticprotected

Sets mapper to form a map from inv whose elements are mapped values.

It skips to store in mapper if the value is -1

virtual casacore::MeasurementSet* casa::SubMS::makeScratchSubMS ( const casacore::Vector< casacore::MS::PredefinedColumns > &  whichDataCols,
const casacore::Bool  forceInMemory = false 
)
virtual

Method to make a scratch subMS and even in memory if posssible Useful if temporary subselection/averaging is necessary It'll be in memory if the basic output ms is less than half of memory reported by casacore::HostInfo unless forced to by user...

virtual casacore::MeasurementSet* casa::SubMS::makeScratchSubMS ( const casacore::String whichDataCol,
const casacore::Bool  forceInMemory = false 
)
virtual

In this form whichDataCol gets passed to parseColumnNames().

casacore::Bool casa::SubMS::makeSelection ( )
protected

method that returns the selected ms (?! - but it's Boolean - RR)

casacore::Bool casa::SubMS::makeSubMS ( casacore::String submsname,
casacore::String whichDataCol,
const casacore::Vector< casacore::Int > &  tileShape = casacore::Vectorcasacore::Int >(1, 0),
const casacore::String combine = "" 
)

Method to make the subMS.

TileShape of size 1 can have 2 values [0], and [1]...these are used in to determine the tileshape by using MSTileLayout. Otherwise it has to be a vector size 3 e.g [4, 15, 351] => a tile shape of 4 stokes, 15 channels 351 rows.

combine sets combine_p. (Columns to ignore while time averaging.)

static casacore::Bool casa::SubMS::mustConvertToData ( const casacore::uInt  nTok,
const casacore::Vector< casacore::MS::PredefinedColumns > &  datacols 
)
inlinestatic

The output casacore::MS must have (at least?) 1 of DATA, FLOAT_DATA, or LAG_DATA.

MODEL_DATA or CORRECTED_DATA will be converted to DATA if necessary.

Definition at line 285 of file SubMS.h.

References casacore::MSMainEnums::FLOAT_DATA, and casacore::MSMainEnums::LAG_DATA.

casacore::Double casa::SubMS::n_bytes ( )
inlineprotected

return the number of unique antennas selected

casacore::Int numOfBaselines(casacore::Vector<casacore::Int>& ant1, casacore::Vector<casacore::Int>& ant2, casacore::Bool includeAutoCorr=false);

Used in a couple of places to estimate how much memory to grab.

Definition at line 613 of file SubMS.h.

References mssel_p, nchan_p, ncorr_p, and casacore::Table::nrow().

static const casacore::Vector<casacore::MS::PredefinedColumns>& casa::SubMS::parseColumnNames ( casacore::String  colNameList)
static

Declared static because it's used in setupMS().

Therefore it can't use any member variables. It is also used in MSFixvis.cc. colNameList is internally upcased, so it is not const or passed by reference.

static const casacore::Vector<casacore::MS::PredefinedColumns>& casa::SubMS::parseColumnNames ( casacore::String  colNameList,
const casacore::MeasurementSet ms 
)
static

This version uses the casacore::MeasurementSet to check what columns are present, i.e.

it makes col=="all" smarter, and it is not necessary to call verifyColumns() after calling this. Unlike the other version, it knows about FLOAT_DATA and LAG_DATA. It throws an exception if a specifically requested column is absent.

static casacore::Bool casa::SubMS::pickAntennas ( casacore::Vector< casacore::Int > &  selected_antennaids,
casacore::Vector< casacore::String > &  selected_antenna_strs,
const casacore::Vector< casacore::Int > &  antennaids,
const casacore::Vector< casacore::String > &  antennaSel 
)
static
casacore::Bool casa::SubMS::putDataColumn ( casacore::MSColumns msc,
casacore::ArrayColumn< casacore::Complex > &  data,
const casacore::MS::PredefinedColumns  datacol,
const casacore::Bool  writeToDataCol = false 
)
protected
casacore::Bool casa::SubMS::putDataColumn ( casacore::MSColumns msc,
casacore::ArrayColumn< casacore::Float > &  data,
const casacore::MS::PredefinedColumns  datacol,
const casacore::Bool  writeToDataCol = false 
)
protected
static casacore::Bool casa::SubMS::regridChanBounds ( casacore::Vector< casacore::Double > &  newChanLoBound,
casacore::Vector< casacore::Double > &  newChanHiBound,
const casacore::Double  regridCenter,
const casacore::Double  regridBandwidth,
const casacore::Double  regridChanWidth,
const casacore::Double  regridVeloRestfrq,
const casacore::String  regridQuant,
const casacore::Vector< casacore::Double > &  transNewXin,
const casacore::Vector< casacore::Double > &  transCHAN_WIDTH,
casacore::String message,
const casacore::Bool  centerIsStart = false,
const casacore::Bool  startIsEnd = false,
const casacore::Int  nchan = 0,
const casacore::Int  width = 0,
const casacore::Int  start = -1 
)
static

Support method for regridSpw(): calculate the final new channel boundaries from the regridding parameters and the old channel boundaries (already transformed to the desired reference frame); returns false if input paramters were invalid and no useful boundaries could be created.

casacore::Int casa::SubMS::regridSpw ( casacore::String message,
const casacore::String outframe = "",
const casacore::String regridQuant = "chan",
const casacore::Double  regridVeloRestfrq = -3E30,
const casacore::String regridInterpMeth = "LINEAR",
const casacore::Double  regridCenter = -3E30,
const casacore::Double  regridBandwidth = -1.,
const casacore::Double  regridChanWidth = -1.,
const casacore::Bool  doHanningSmooth = false,
const casacore::Int  phaseCenterFieldId = -2,
casacore::MDirection  phaseCenter = casacore::MDirection(),
const casacore::Bool  centerIsStart = false,
const casacore::Bool  startIsEnd = false,
const casacore::Int  nchan = 0,
const casacore::Int  width = 0,
const casacore::Int  start = -1 
)

Transform spectral data to different reference frame, optionally regrid the frequency channels return values: -1 = casacore::MS not modified, 1 = casacore::MS modified and OK, 0 = casacore::MS modified but not OK (i.e.

casacore::MS is probably damaged)

void casa::SubMS::relabelIDs ( )
protected
void casa::SubMS::relabelSources ( )
protected

Sets up sourceRelabel_p for mapping input SourceIDs (if any) to output ones.

Must be called after fieldid_p is set and before calling fillFieldTable() or copySource().

static void casa::SubMS::remap ( casacore::Vector< casacore::Int > &  col,
const casacore::Vector< casacore::Int > &  mapper 
)
static

Replaces col[i] with mapper[col[i]] for each element of col.

Does NOT check whether mapper[col[i]] is defined, but it does return right away (i.e. a no-op) if mapper is empty.

static void casa::SubMS::remap ( casacore::Vector< casacore::Int > &  col,
const std::map< casacore::Int, casacore::Int > &  mapper 
)
static
void casa::SubMS::remapColumn ( casacore::ScalarColumn< casacore::Int > &  outcol,
const casacore::ScalarColumn< casacore::Int > &  incol,
const casacore::Vector< casacore::Int > &  selvals 
)
protected

Sets outcol to the indices of selvals that correspond to incol, i.e.

outcol(i) = j s.t. selvals[j] == incol(i).

Ideally selvals is set up so that outcol's values will be row numbers in the corresponding subtable of its ms.

Throws an exception if incol and outcol do not have the same # of rows, or incol has a value that is not in selvals.

void casa::SubMS::remapColumn ( casacore::ScalarColumn< casacore::Int > &  outcol,
const casacore::ScalarColumn< casacore::Int > &  incol 
)
protected

Equivalent to but slightly more efficient than remapColumn(outcol, incol, incol.getColumn()).

casacore::uInt casa::SubMS::remapped ( const casacore::Int  ov,
const casacore::Vector< casacore::Int > &  mapper,
casacore::uInt  i 
)
protected
const casacore::ArrayColumn<casacore::Complex>& casa::SubMS::right_column ( const casacore::ROMSColumns ms_p,
const casacore::MS::PredefinedColumns  datacol 
)
protected

Picks a reference to DATA, MODEL_DATA, CORRECTED_DATA, or LAG_DATA out of ms_p.

FLOAT_DATA is not included because it is not natively complex.

casacore::ArrayColumn<casacore::Complex>& casa::SubMS::right_column ( casacore::MSColumns msclala,
const casacore::MS::PredefinedColumns  col,
const casacore::Bool  writeToDataCol 
)
protected

The writable version of the above.

void casa::SubMS::selectAntenna ( const casacore::Vector< casacore::Int > &  antennaids,
const casacore::Vector< casacore::String > &  antennaSel 
)
inline

Select Antennas to split out.

Definition at line 185 of file SubMS.h.

References antennaId_p, antennaSel_p, antennaSelStr_p, and pickAntennas().

void casa::SubMS::selectArray ( const casacore::String subarray)
inline

Select array IDs to use.

Definition at line 197 of file SubMS.h.

References arrayExpr_p.

casacore::Bool casa::SubMS::selectCorrelations ( const casacore::String corrstr)

Setup polarization selection (for now, only from available correlations - no casacore::Stokes transformations.)

casacore::Bool casa::SubMS::selectSource ( const casacore::Vector< casacore::Int > &  fieldid)

Select source or field.

casacore::Bool casa::SubMS::selectSpw ( const casacore::String spwstr,
const casacore::Vector< casacore::Int > &  steps 
)

Select spw and channels for each spw.

This is the version used by split. It returns true on success and false on failure.

void casa::SubMS::selectSpw ( casacore::Vector< casacore::Int spw,
casacore::Vector< casacore::Int nchan,
casacore::Vector< casacore::Int start,
casacore::Vector< casacore::Int step 
)

This older version is used by the older version of setmsselect().

void casa::SubMS::selectTime ( casacore::Double  timeBin = -1.0,
casacore::String  timerng = "" 
)

select time parameters

static casacore::Bool casa::SubMS::sepFloat ( const casacore::Vector< casacore::MS::PredefinedColumns > &  anyDataCols,
casacore::Vector< casacore::MS::PredefinedColumns > &  complexDataCols 
)
static
void casa::SubMS::setFitOrder ( casacore::Int  fitorder,
casacore::Bool  advise = true 
)

void selectSource(casacore::Vector<casacore::String> sourceid);

Method to set if a phase Center rotation is needed void setPhaseCenter(casacore::Int fieldid, casacore::MDirection& newPhaseCenter);

Sets the polynomial order for continuum fitting to fitorder. If < 0, continuum subtraction is not done.

void casa::SubMS::setFitOutSpw ( const casacore::String fitoutspw)
inline

Selection string for output channels if doing continuum subtraction.

Definition at line 213 of file SubMS.h.

References fitoutspw_p.

void casa::SubMS::setFitSpw ( const casacore::String fitspw)
inline

Set the selection string for line-free channels.

Definition at line 211 of file SubMS.h.

References fitspw_p.

void casa::SubMS::setMS ( casacore::MeasurementSet ms)

Change or Set the casacore::MS this casacore::MSSelector refers to.

casacore::Bool casa::SubMS::setmsselect ( const casacore::String spw = "",
const casacore::String field = "",
const casacore::String baseline = "",
const casacore::String scan = "",
const casacore::String uvrange = "",
const casacore::String taql = "",
const casacore::Vector< casacore::Int > &  step = casacore::Vectorcasacore::Int >(1, 1),
const casacore::String subarray = "",
const casacore::String correlation = "",
const casacore::String intent = "",
const casacore::String obs = "" 
)

select casacore::Time and time averaging or regridding void selectTime();

select stuff using msselection syntax...time is left out call it separately with timebin This version returns a success value, and does not need nchan, start, and step. It is used by split.

void casa::SubMS::setmsselect ( const casacore::String spw,
const casacore::String field,
const casacore::String baseline,
const casacore::String scan,
const casacore::String obs,
const casacore::String uvrange,
const casacore::String taql,
const casacore::Vector< casacore::Int > &  nchan,
const casacore::Vector< casacore::Int > &  start,
const casacore::Vector< casacore::Int > &  step,
const casacore::String subarray,
const casacore::String intent = "" 
)

This older version does not return a success value, and does need nchan, start, and step.

It is used elsewhere (i.e. ImagerMultiMS).

casacore::Bool casa::SubMS::setRegridParameters ( std::vector< casacore::Int > &  oldSpwId,
std::vector< casacore::Int > &  oldFieldId,
std::vector< casacore::Int > &  newDataDescId,
std::vector< casacore::Bool > &  regrid,
std::vector< casacore::Bool > &  transform,
std::vector< casacore::MDirection > &  theFieldDirV,
std::vector< casacore::MPosition > &  mObsPosV,
std::vector< casacore::MFrequency::Types > &  fromFrameTypeV,
std::vector< casacore::MFrequency::Ref > &  outFrameV,
std::vector< casacore::MRadialVelocity > &  outRadVelV,
std::vector< casacore::Double > &  weightScaleV,
std::vector< casacore::Vector< casacore::Double > > &  xold,
std::vector< casacore::Vector< casacore::Double > > &  xout,
std::vector< casacore::Vector< casacore::Double > > &  xin,
vector< casacore::Int > &  method,
casacore::Bool msMod,
const casacore::String outframe,
const casacore::String regridQuant,
const casacore::Double  regridVeloRestfrq,
const casacore::String regridInterpMeth,
const casacore::Double  regridCenter,
const casacore::Double  regridBandwidth,
const casacore::Double  regridChanWidth,
const casacore::Int  regridPhaseCenterFieldId,
const casacore::MDirection  regridPhaseCenter,
const casacore::Bool  writeTables,
casacore::LogIO os,
casacore::String regridMessage,
const casacore::Bool  centerIsStart = false,
const casacore::Bool  startIsEnd = false,
const casacore::Int  nchan = 0,
const casacore::Int  width = 0,
const casacore::Int  start = -1 
)

Support method for regridSpw(): if writeTables is false, the (const) input parameters are only verified, nothing is written; return value is true if the parameters are OK.

if writeTables is true, the vectors are filled and the SPW, DD, and SOURCE tables are modified; the return value in this case is true only if a successful modification (or none) took place

casacore::Bool casa::SubMS::setSortOrder ( casacore::Block< casacore::Int > &  sort,
const casacore::String uncombinable = "",
const casacore::Bool  verbose = true 
) const
protected

Sets sort to a casacore::Block of columns that a VisibilityIterator should sort by, according to combine_p.

Columns that should never be combined in the calling function, i.e. spw for time averaging, should be listed in uncombinable.

verbose: log a message on error.

Returns whether or not there were any conflicts between combine_p and uncombinable.

void casa::SubMS::setTVIDebug ( bool  debug)
inline

Definition at line 513 of file SubMS.h.

References debug, and tvi_debug.

static casacore::MeasurementSet* casa::SubMS::setupMS ( const casacore::String msname,
const casacore::Int  nchan,
const casacore::Int  npol,
const casacore::String telescop,
const casacore::Vector< casacore::MS::PredefinedColumns > &  colNamesTok,
const casacore::Int  obstype = 0,
const casacore::Bool  compress = false,
const asdmStManUseAlternatives  asdmStManUse = DONT 
)
static

This sets up a default new ms Declared static as it can be (and is) called directly outside of SubMS.

Therefore it is not dependent on any member variable.

static casacore::MeasurementSet* casa::SubMS::setupMS ( const casacore::String msname,
const casacore::Int  nchan,
const casacore::Int  npol,
const casacore::Vector< casacore::MS::PredefinedColumns > &  colNamesTok,
const casacore::Vector< casacore::Int > &  tileShape = casacore::Vectorcasacore::Int >(1, 0),
const casacore::Bool  compress = false,
const asdmStManUseAlternatives  asdmStManUse = DONT 
)
static

Same as above except allowing manual tileshapes.

void casa::SubMS::setupNewPointing ( )
protected

Sets up the stub of a POINTING, enough to create an MSColumns.

void casa::SubMS::setWantCont ( bool  want_cont)
inline

Definition at line 514 of file SubMS.h.

References want_cont_p.

casacore::Bool casa::SubMS::shouldWatch ( casacore::Bool conflict,
const casacore::String col,
const casacore::String uncombinable = "",
const casacore::Bool  verbose = true 
) const
protected

Returns whether col is (not in combine_p) || in uncombinable.

Columns that should never be combined in the calling function, i.e. spw for time averaging, should be listed in uncombinable.

verbose: log a message on error.

conflict is set to true if there is a conflict between combine_p and uncombinable.

casacore::Bool casa::SubMS::subtractContinuum ( const casacore::Vector< casacore::MS::PredefinedColumns > &  colNames,
const VBRemapper remapper 
)
protected

Like doTimeAver(), but it subtracts the continuum instead of time averaging.

Unlike doTimeAver(), it infers writeToDataCol from colNames.nelements() (subtractContinuum is intentionally not as general as copyDataFlagsWtSp), and writes according to fitoutspw_p instead of spw_p.

void casa::SubMS::verifyColumns ( const casacore::MeasurementSet ms,
const casacore::Vector< casacore::MS::PredefinedColumns > &  colNames 
)
static casacore::lDouble casa::SubMS::vopt ( const casacore::lDouble  freq,
const casacore::lDouble  rest 
)
inlinestatic

Definition at line 336 of file SubMS.h.

References casacore::C::c.

static casacore::lDouble casa::SubMS::vrad ( const casacore::lDouble  freq,
const casacore::lDouble  rest 
)
inlinestatic

the following inline convenience methods for regridSpw bypass the whole CASA measure system because when they are used, they can assume that the frame stays the same and the units are OK

Definition at line 335 of file SubMS.h.

References casacore::C::c.

casacore::Bool casa::SubMS::writeAllMainRows ( const casacore::Vector< casacore::MS::PredefinedColumns > &  colNames)
protected

Used to be fillMainTable(colnames), but what distinguishes it from writeSomeMainRows(colnames) is that it is for cases where there is a 1-1 match between rows in mssel_p and msOut_p (including order).

casacore::Bool casa::SubMS::writeSomeMainRows ( const casacore::Vector< casacore::MS::PredefinedColumns > &  colNames)
protected

Used to be fillAverMainTable(colnames), but what distinguishes it from writeAllMainRows(colnames) is that it is for cases where there is not necessarily a 1-1 match between rows in mssel_p and msOut_p.

Friends And Related Function Documentation

friend class MSTransformManager
friend

jagonzal: Allow TransformVisDataHandler to access protected methods and members of this class

Definition at line 115 of file SubMS.h.

Member Data Documentation

casacore::Vector<casacore::Int> casa::SubMS::antennaId_p
protected

Definition at line 765 of file SubMS.h.

Referenced by selectAntenna().

casacore::Bool casa::SubMS::antennaSel_p
protected

same shape as the corresponding input one.

sameShape_p, // Iff true, the shapes of the arrays do not vary with row number.

Definition at line 721 of file SubMS.h.

Referenced by selectAntenna().

casacore::Vector<casacore::String> casa::SubMS::antennaSelStr_p
protected

Definition at line 764 of file SubMS.h.

Referenced by selectAntenna().

casacore::Vector<casacore::Int> casa::SubMS::antIndexer_p
protected

Definition at line 766 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::antNewIndex_p
protected

Definition at line 767 of file SubMS.h.

casacore::String casa::SubMS::arrayExpr_p
protected

Definition at line 732 of file SubMS.h.

Referenced by selectArray().

casacore::Vector<casacore::Int> casa::SubMS::chanEnd_p
protected

Definition at line 748 of file SubMS.h.

casacore::Vector<casacore::Vector<casacore::Slice> > casa::SubMS::chanSlices_p
protected

Definition at line 778 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::chanStart_p
protected

Definition at line 748 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::chanStep_p
protected

Definition at line 748 of file SubMS.h.

casacore::String casa::SubMS::combine_p
protected

Definition at line 733 of file SubMS.h.

casacore::Vector<casacore::Slice> casa::SubMS::corrSlice_p
protected

Definition at line 779 of file SubMS.h.

casacore::Vector<casacore::Vector<casacore::Slice> > casa::SubMS::corrSlices_p
protected

Definition at line 780 of file SubMS.h.

casacore::String casa::SubMS::corrString_p
protected

Definition at line 732 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::fieldid_p
protected

Definition at line 761 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::fieldRelabel_p
protected

Definition at line 762 of file SubMS.h.

casacore::Bool casa::SubMS::fillMainTable_p
protected

continuum subtraction.

jagonzal: Allow main table to be left empty, so that it can be filled by another layer.

Definition at line 744 of file SubMS.h.

casacore::Int casa::SubMS::fitorder_p
protected

scan #, observation, and/or state ID? Must be lowercase at all times.

Definition at line 736 of file SubMS.h.

casacore::String casa::SubMS::fitoutspw_p
protected

Definition at line 740 of file SubMS.h.

Referenced by setFitOutSpw().

casacore::String casa::SubMS::fitspw_p
protected

If < 0 (default), continuum subtraction is not done.

Definition at line 739 of file SubMS.h.

Referenced by setFitSpw().

casacore::Vector<casacore::Int> casa::SubMS::inNumChan_p
protected

Definition at line 748 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::inNumCorr_p
protected

Definition at line 748 of file SubMS.h.

casacore::Vector<casacore::Vector<casacore::Int> > casa::SubMS::inPolOutCorrToInCorrMap_p
protected

inCorrInd = outPolCorrToInCorrMap_p[polID_p[ddID]][outCorrInd]

Definition at line 774 of file SubMS.h.

casacore::String casa::SubMS::intentString_p
protected

Definition at line 727 of file SubMS.h.

casacore::Bool casa::SubMS::keepShape_p
protected

Definition at line 721 of file SubMS.h.

casacore::MeasurementSet casa::SubMS::ms_p
protected

*** Member variables ***

Initialized* by ctors. (Maintain order both here and in ctors.) not necessarily to anything useful.

Definition at line 718 of file SubMS.h.

casacore::MSColumns* casa::SubMS::msc_p
protected

Definition at line 719 of file SubMS.h.

Referenced by getDataColMap().

casacore::ROMSColumns* casa::SubMS::mscIn_p
protected

Definition at line 720 of file SubMS.h.

casacore::MeasurementSet casa::SubMS::msOut_p
protected

Uninitialized by ctors.

Definition at line 747 of file SubMS.h.

casacore::MeasurementSet casa::SubMS::mssel_p
protected

Definition at line 718 of file SubMS.h.

Referenced by n_bytes().

casacore::Vector<casacore::Int> casa::SubMS::nchan_p
protected

Definition at line 748 of file SubMS.h.

Referenced by n_bytes().

casacore::Vector<casacore::Int> casa::SubMS::ncorr_p
protected

Definition at line 748 of file SubMS.h.

Referenced by n_bytes().

casacore::String casa::SubMS::obsString_p
protected

Definition at line 727 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::oldDDSpwMatch_p
protected

Definition at line 763 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::polID_p
protected

Definition at line 770 of file SubMS.h.

casacore::String casa::SubMS::scanString_p
protected

Definition at line 727 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::selObsId_p
protected

Definition at line 769 of file SubMS.h.

casacore::Matrix<casacore::Double> casa::SubMS::selTimeRanges_p
protected

Definition at line 781 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::sourceRelabel_p
protected

Definition at line 762 of file SubMS.h.

casacore::Vector<casacore::uInt> casa::SubMS::spw2ddid_p
protected

Definition at line 771 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::spw_p
protected

Definition at line 748 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::spw_uniq_p
protected

Definition at line 748 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::spwind_to_min_spwind_p
protected

Definition at line 748 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::spwRelabel_p
protected

Definition at line 762 of file SubMS.h.

std::map<casacore::Int, casacore::Int> casa::SubMS::stateRemapper_p
protected

Definition at line 776 of file SubMS.h.

casacore::String casa::SubMS::taqlString_p
protected

Definition at line 727 of file SubMS.h.

casacore::Double casa::SubMS::timeBin_p
protected

Definition at line 726 of file SubMS.h.

casacore::String casa::SubMS::timeRange_p
protected

Definition at line 732 of file SubMS.h.

casacore::Vector<casacore::Int> casa::SubMS::totnchan_p
protected

Definition at line 748 of file SubMS.h.

bool casa::SubMS::tvi_debug
protected

Definition at line 783 of file SubMS.h.

Referenced by setTVIDebug().

casacore::String casa::SubMS::uvrangeString_p
protected

Definition at line 727 of file SubMS.h.

bool casa::SubMS::want_cont_p
protected

Definition at line 784 of file SubMS.h.

Referenced by setWantCont().

casacore::Vector<casacore::Int> casa::SubMS::widths_p
protected

input channel will be used.

Definition at line 748 of file SubMS.h.


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