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

Partition makes a subset of an existing casacore::MS without remapping any indices or resizing any subtables (unlike SubMS). More...

#include <Partition.h>

Public Member Functions

 Partition (casacore::String &theMS, casacore::Table::TableOption option=casacore::Table::Old)
 
 Partition (casacore::MeasurementSet &ms)
 construct from an MS More...
 
virtual ~Partition ()
 
void setMS (casacore::MeasurementSet &ms)
 Change or Set the casacore::MS this casacore::MSSelector refers to. More...
 
casacore::Bool selectSpw (const casacore::String &spwstr)
 Select spw and channels for each spw. 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::String &subarray="", const casacore::String &intent="", const casacore::String &obs="")
 select casacore::Time and time averaging or regridding void selectTime(); More...
 
casacore::Bool selectSource (const casacore::Vector< casacore::Int > &fieldid)
 Select source or field. More...
 
void selectAntenna (casacore::Vector< casacore::Int > &antennaids, 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...
 
casacore::Bool makePartition (casacore::String &outname, casacore::String &whichDataCol, const casacore::Vector< casacore::Int > &tileShape=casacore::Vector< casacore::Int >(1, 0), const casacore::String &combine="")
 void selectSource(casacore::Vector<casacore::String> sourceid); More...
 
virtual casacore::MeasurementSetmakeScratchPartition (const casacore::Vector< casacore::MS::PredefinedColumns > &whichDataCols, const casacore::Bool forceInMemory=false)
 Method to make a scratch partition 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::MeasurementSetmakeScratchPartition (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)
 

Static Public Member Functions

static casacore::MeasurementSetsetupMS (const casacore::String &msname, const casacore::MeasurementSet &inms, const casacore::Int nchan, const casacore::Int npol, const casacore::String &telescop, const casacore::Vector< casacore::MS::PredefinedColumns > &colNamesTok, const casacore::Int obstype=0)
 This sets up a default new ms Declared static as it can be called directly outside of Partition. More...
 
static casacore::MeasurementSetsetupMS (const casacore::String &msname, const casacore::MeasurementSet &inms, 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))
 Same as above except allowing manual tileshapes. More...
 

Private 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 fillMainTable (const casacore::Vector< casacore::MS::PredefinedColumns > &colNames)
 
casacore::Bool fillAccessoryMainCols ()
 casacore::Bool writeDiffSpwShape(const casacore::Vector<casacore::MS::PredefinedColumns>& colNames); More...
 
casacore::Bool getDataColumn (casacore::ArrayColumn< casacore::Complex > &data, const casacore::MS::PredefinedColumns colName)
 *** Private member functions *** More...
 
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::Double n_bytes ()
 Used in a couple of places to estimate how much memory to grab. More...
 
casacore::Bool doTimeAver (const casacore::Vector< casacore::MS::PredefinedColumns > &dataColNames)
 Read the input, time average it to timeBin_p, and write the output. More...
 

Static Private Member Functions

static void getDataColMap (casacore::MSMainColumns *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...
 

Private Attributes

casacore::MeasurementSet ms_p
 *** Member variables *** More...
 
casacore::MeasurementSet mssel_p
 
casacore::MSMainColumnsmsc_p
 
casacore::ROMSColumnsmscIn_p
 
casacore::Bool antennaSel_p
 
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 maxnchan_p
 scan #, observation, and/or state ID? Must be lowercase at all times. More...
 
casacore::Int maxncorr_p
 
casacore::MeasurementSet msOut_p
 are casacore::Int instead of uInt.) More...
 
casacore::Vector< casacore::Intspw_p
 
casacore::Vector< casacore::Intfieldid_p
 
casacore::Vector
< casacore::String
antennaSelStr_p
 
casacore::Vector< casacore::IntantennaId_p
 
casacore::Vector< casacore::IntarrayId_p
 
casacore::Matrix
< casacore::Double
selTimeRanges_p
 

Detailed Description

Partition makes a subset of an existing casacore::MS without remapping any indices or resizing any subtables (unlike SubMS).

<visibility=export>

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Partition an MS.

Synopsis

The order of operations (as in ms::partition()) is: ctor setmsselect selectTime makePartition

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

Definition at line 80 of file Partition.h.

Constructor & Destructor Documentation

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

construct from an MS

virtual casa::Partition::~Partition ( )
virtual

Member Function Documentation

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

This method uses VisIter for efficient copy mode data transfer.

casacore::Bool casa::Partition::doTimeAver ( const casacore::Vector< casacore::MS::PredefinedColumns > &  dataColNames)
private

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

casacore::Bool casa::Partition::fillAccessoryMainCols ( )
private

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

casacore::Bool casa::Partition::fillAllTables ( const casacore::Vector< casacore::MS::PredefinedColumns > &  colNames)
private

(Sub)table fillers.

casacore::Bool casa::Partition::fillMainTable ( const casacore::Vector< casacore::MS::PredefinedColumns > &  colNames)
private
static void casa::Partition::getDataColMap ( casacore::MSMainColumns msc,
casacore::ArrayColumn< casacore::Complex > *  mapper,
casacore::uInt  ntok,
const casacore::Vector< casacore::MS::PredefinedColumns > &  colEnums 
)
staticprivate

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

mapper must have ntok slots!

casacore::Bool casa::Partition::getDataColumn ( casacore::ArrayColumn< casacore::Complex > &  data,
const casacore::MS::PredefinedColumns  colName 
)
private

*** Private member functions ***

casacore::Bool casa::Partition::getDataColumn ( casacore::ArrayColumn< casacore::Float > &  data,
const casacore::MS::PredefinedColumns  colName 
)
private
casacore::Bool casa::Partition::makePartition ( casacore::String outname,
casacore::String whichDataCol,
const casacore::Vector< casacore::Int > &  tileShape = casacore::Vectorcasacore::Int >(1, 0),
const casacore::String combine = "" 
)

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

Method to make the partition.

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

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

Method to make a scratch partition 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::Partition::makeScratchPartition ( const casacore::String whichDataCol,
const casacore::Bool  forceInMemory = false 
)
virtual

In this form whichDataCol gets passed to parseColumnNames().

casacore::Bool casa::Partition::makeSelection ( )
private

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

casacore::Double casa::Partition::n_bytes ( )
inlineprivate

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

Definition at line 195 of file Partition.h.

References maxnchan_p, maxncorr_p, mssel_p, and casacore::Table::nrow().

casacore::Bool casa::Partition::putDataColumn ( casacore::MSColumns msc,
casacore::ArrayColumn< casacore::Complex > &  data,
const casacore::MS::PredefinedColumns  datacol,
const casacore::Bool  writeToDataCol = false 
)
private
casacore::Bool casa::Partition::putDataColumn ( casacore::MSColumns msc,
casacore::ArrayColumn< casacore::Float > &  data,
const casacore::MS::PredefinedColumns  datacol,
const casacore::Bool  writeToDataCol = false 
)
private
void casa::Partition::selectAntenna ( casacore::Vector< casacore::Int > &  antennaids,
casacore::Vector< casacore::String > &  antennaSel 
)
inline

Select Antennas to split out.

Definition at line 112 of file Partition.h.

References antennaId_p, antennaSel_p, antennaSelStr_p, and casa::SubMS::pickAntennas().

void casa::Partition::selectArray ( const casacore::String subarray)

Select array IDs to use.

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

Select source or field.

casacore::Bool casa::Partition::selectSpw ( const casacore::String spwstr)

Select spw and channels for each spw.

It returns true on success and false on failure.

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

select time parameters

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

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

casacore::Bool casa::Partition::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::String subarray = "",
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

static casacore::MeasurementSet* casa::Partition::setupMS ( const casacore::String msname,
const casacore::MeasurementSet inms,
const casacore::Int  nchan,
const casacore::Int  npol,
const casacore::String telescop,
const casacore::Vector< casacore::MS::PredefinedColumns > &  colNamesTok,
const casacore::Int  obstype = 0 
)
static

This sets up a default new ms Declared static as it can be called directly outside of Partition.

Therefore it is not dependent on any member variable.

static casacore::MeasurementSet* casa::Partition::setupMS ( const casacore::String msname,
const casacore::MeasurementSet inms,
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) 
)
static

Same as above except allowing manual tileshapes.

void casa::Partition::verifyColumns ( const casacore::MeasurementSet ms,
const casacore::Vector< casacore::MS::PredefinedColumns > &  colNames 
)

Member Data Documentation

casacore::Vector<casacore::Int> casa::Partition::antennaId_p
private

Definition at line 233 of file Partition.h.

Referenced by selectAntenna().

casacore::Bool casa::Partition::antennaSel_p
private

Definition at line 214 of file Partition.h.

Referenced by selectAntenna().

casacore::Vector<casacore::String> casa::Partition::antennaSelStr_p
private

Definition at line 232 of file Partition.h.

Referenced by selectAntenna().

casacore::String casa::Partition::arrayExpr_p
private

Definition at line 220 of file Partition.h.

casacore::Vector<casacore::Int> casa::Partition::arrayId_p
private

Definition at line 234 of file Partition.h.

casacore::String casa::Partition::combine_p
private

Definition at line 221 of file Partition.h.

casacore::String casa::Partition::corrString_p
private

Definition at line 220 of file Partition.h.

casacore::Vector<casacore::Int> casa::Partition::fieldid_p
private

Definition at line 231 of file Partition.h.

casacore::String casa::Partition::intentString_p
private

Definition at line 216 of file Partition.h.

casacore::Int casa::Partition::maxnchan_p
private

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

Definition at line 224 of file Partition.h.

Referenced by n_bytes().

casacore::Int casa::Partition::maxncorr_p
private

Definition at line 224 of file Partition.h.

Referenced by n_bytes().

casacore::MeasurementSet casa::Partition::ms_p
private

*** Member variables ***

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

Definition at line 211 of file Partition.h.

casacore::MSMainColumns* casa::Partition::msc_p
private

Definition at line 212 of file Partition.h.

casacore::ROMSColumns* casa::Partition::mscIn_p
private

Definition at line 213 of file Partition.h.

casacore::MeasurementSet casa::Partition::msOut_p
private

are casacore::Int instead of uInt.)

Uninitialized by ctors.

Definition at line 229 of file Partition.h.

casacore::MeasurementSet casa::Partition::mssel_p
private

Definition at line 211 of file Partition.h.

Referenced by n_bytes().

casacore::String casa::Partition::obsString_p
private

Definition at line 216 of file Partition.h.

casacore::String casa::Partition::scanString_p
private

Definition at line 216 of file Partition.h.

casacore::Matrix<casacore::Double> casa::Partition::selTimeRanges_p
private

Definition at line 235 of file Partition.h.

casacore::Vector<casacore::Int> casa::Partition::spw_p
private

Definition at line 230 of file Partition.h.

casacore::String casa::Partition::taqlString_p
private

Definition at line 216 of file Partition.h.

casacore::Double casa::Partition::timeBin_p
private

Definition at line 215 of file Partition.h.

casacore::String casa::Partition::timeRange_p
private

Definition at line 220 of file Partition.h.

casacore::String casa::Partition::uvrangeString_p
private

Definition at line 216 of file Partition.h.


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