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

#include <StatWtTVI.h>

Inheritance diagram for casa::vi::StatWtTVI:
casa::vi::TransformingVi2 casa::vi::ViImplementation2

Classes

struct  BaselineChanBin
 
struct  ChanBin
 

Public Member Functions

 StatWtTVI (ViImplementation2 *inputVii, const casacore::Record &configuration)
 The following fields are supported in the input configuration record combine String, if contains "corr", data will be aggregated across correlations. More...
 
virtual ~StatWtTVI ()
 
virtual casacore::String ViiType () const
 Report the the ViImplementation type (should be specialized in child classes) More...
 
void initWeightSpectrum (const casacore::Cube< casacore::Float > &wtspec)
 Initialize the weightSpectrum. More...
 
void initSigmaSpectrum (const casacore::Cube< casacore::Float > &sigspec)
 Initialize the sigmaSpectrum. More...
 
void next ()
 
void origin ()
 +==================================+ | | | Iteration Control and Monitoring | | | +==================================+ More...
 
virtual void weightSpectrum (casacore::Cube< casacore::Float > &wtsp) const
 Return weightspectrum (a weight for each channel) More...
 
virtual void sigmaSpectrum (casacore::Cube< casacore::Float > &sigmaSp) const
 Return sgimaspectrum (a sigma for each channel) More...
 
virtual void weight (casacore::Matrix< casacore::Float > &wtmat) const
 Return weight. More...
 
virtual void sigma (casacore::Matrix< casacore::Float > &sigmaMat) const
 Return sigma. More...
 
virtual void flag (casacore::Cube< casacore::Bool > &flagCube) const
 Return flag for each polarization, channel and row. More...
 
virtual void flagRow (casacore::Vector< casacore::Bool > &flagRow) const
 Return row flag. More...
 
void summarizeFlagging () const
 
void summarizeStats (casacore::Double &mean, casacore::Double &variance) const
 
void writeBackChanges (VisBuffer2 *vb)
 Override unimplemented TransformingVi2 version. More...
 
- Public Member Functions inherited from casa::vi::TransformingVi2
virtual ~TransformingVi2 ()
 Destructor. More...
 
virtual casacore::Bool more () const override
 
virtual Subchunk getSubchunkId () const override
 
virtual casacore::Bool moreChunks () const override
 
virtual casacore::String keyChange () const override
 Report Name of slowest column that changes at end of current iteration. More...
 
virtual casacore::Bool isWritable () const override
 
virtual double getInterval () const override
 Return the time interval (in seconds) used for iteration. More...
 
virtual void setInterval (double timeInterval) override
 
virtual void setFrequencySelections (const FrequencySelections &selection) override
 Select the channels to be returned. More...
 
virtual void setRowBlocking (casacore::Int nRows) override
 Set the 'blocking' size for returning data. More...
 
virtual casacore::Bool existsColumn (VisBufferComponent2 id) const override
 
virtual const SortColumnsgetSortColumns () const override
 
virtual casacore::Bool isNewArrayId () const override
 
virtual casacore::Bool isNewFieldId () const override
 
virtual casacore::Bool isNewMs () const override
 
virtual casacore::Bool isNewSpectralWindow () const override
 
virtual casacore::Int nRows () const override
 Return the number of rows in the current iteration. More...
 
virtual void getRowIds (casacore::Vector< casacore::uInt > &rowids) const override
 Return the row ids as from the original root table. More...
 
virtual VisBuffer2getVisBuffer () const override
 
virtual void antenna1 (casacore::Vector< casacore::Int > &ant1) const override
 +=========================+ | | | Subchunk casacore::Data Accessors | | | +=========================+ More...
 
virtual void antenna2 (casacore::Vector< casacore::Int > &ant2) const override
 Return antenna2. More...
 
virtual void corrType (casacore::Vector< casacore::Int > &corrTypes) const override
 Return the correlation type (returns casacore::Stokes enums) More...
 
virtual casacore::Int dataDescriptionId () const override
 Return current DataDescription Id. More...
 
virtual void exposure (casacore::Vector< double > &expo) const override
 Return actual time interval. More...
 
virtual void feed1 (casacore::Vector< casacore::Int > &fd1) const override
 Return feed1. More...
 
virtual void feed2 (casacore::Vector< casacore::Int > &fd2) const override
 Return feed2. More...
 
virtual void fieldIds (casacore::Vector< casacore::Int > &) const override
 Return the current FieldId. More...
 
virtual void arrayIds (casacore::Vector< casacore::Int > &) const override
 Return the current ArrayId. More...
 
virtual casacore::String fieldName () const override
 Return the current Field Name. More...
 
virtual void flag (casacore::Matrix< casacore::Bool > &flags) const override
 Return flag for each channel & row. More...
 
virtual casacore::Bool flagCategoryExists () const override
 Determine whether FLAG_CATEGORY is valid. More...
 
virtual void flagCategory (casacore::Array< casacore::Bool > &flagCategories) const override
 Return flags for each polarization, channel, category, and row. More...
 
virtual void observationId (casacore::Vector< casacore::Int > &obsids) const override
 Return the OBSERVATION_IDs. More...
 
virtual casacore::Int polarizationId () const override
 Return current Polarization Id. More...
 
virtual void processorId (casacore::Vector< casacore::Int > &procids) const override
 Return the PROCESSOR_IDs. More...
 
virtual void scan (casacore::Vector< casacore::Int > &scans) const override
 Return scan number. More...
 
virtual casacore::String sourceName () const override
 Return the current Source Name. More...
 
virtual void stateId (casacore::Vector< casacore::Int > &stateids) const override
 Return the STATE_IDs. More...
 
virtual void jonesC (casacore::Vector< casacore::SquareMatrix< casacore::Complex, 2 > > &cjones) const override
 Return feed configuration matrix for specified antenna. More...
 
virtual casacore::Int polFrame () const override
 Return frame for polarization (returns PolFrame enum) More...
 
virtual casacore::Int spectralWindow () const override
 Return current SpectralWindow. More...
 
virtual void spectralWindows (casacore::Vector< casacore::Int > &spws) const override
 
virtual void time (casacore::Vector< double > &t) const override
 Return MJD midpoint of interval. More...
 
virtual void timeCentroid (casacore::Vector< double > &t) const override
 Return MJD centroid of interval. More...
 
virtual void timeInterval (casacore::Vector< double > &ti) const override
 Return nominal time interval. More...
 
virtual void uvw (casacore::Matrix< double > &uvwmat) const override
 Return u,v and w (in meters) More...
 
virtual void visibilityCorrected (casacore::Cube< casacore::Complex > &vis) const override
 Return the visibilities as found in the casacore::MS, casacore::Cube (npol,nchan,nrow). More...
 
virtual void visibilityModel (casacore::Cube< casacore::Complex > &vis) const override
 
virtual void visibilityObserved (casacore::Cube< casacore::Complex > &vis) const override
 
virtual void floatData (casacore::Cube< casacore::Float > &fcube) const override
 Return FLOAT_DATA as a casacore::Cube (npol, nchan, nrow) if found in the MS. More...
 
virtual casacore::IPosition visibilityShape () const override
 Return the visibility 4-vector of polarizations for each channel. More...
 
virtual casacore::Bool weightSpectrumExists () const override
 Determine whether WEIGHT_SPECTRUM exists. More...
 
virtual casacore::Bool sigmaSpectrumExists () const override
 Determine whether SIGMA_SPECTRUM exists. More...
 
virtual casacore::Bool allBeamOffsetsZero () const override
 Return the number of sub-intervals in the current chunk. More...
 
virtual std::pair< bool,
casacore::MDirection
getPointingAngle (int antenna, double time) const override
 
virtual casacore::MDirection azel0 (double time) const override
 Return the antenna AZ/EL casacore::Vector (nant) More...
 
virtual const casacore::Vector
< casacore::MDirection > & 
azel (double time) const override
 static void azel0Calculate (double time, MSDerivedValues & msd, MDirection & azel0, const MEpoch & mEpoch0); More...
 
virtual const casacore::Vector
< casacore::Float > & 
feed_pa (double time) const override
 static void azelCalculate (double time, MSDerivedValues & msd, Vector<MDirection> & azel, Int nAnt, const MEpoch & mEpoch0); More...
 
virtual const casacore::Cube
< casacore::RigidVector
< double, 2 > > & 
getBeamOffsets () const override
 static Vector<Float> feed_paCalculate (double time, MSDerivedValues & msd, Int nAntennas, const MEpoch & mEpoch0, const Vector<Float> & receptor0Angle); More...
 
virtual double hourang (double time) const override
 Return the hour angle for the specified time. More...
 
virtual const casacore::Floatparang0 (double time) const override
 Return nominal parallactic angle at specified time (does not include feed position angle offset–see feed_pa) A global value for all antennas (e.g., small array) More...
 
virtual const casacore::Vector
< casacore::Float > & 
parang (double time) const override
 Per antenna: More...
 
virtual const
casacore::MDirection
phaseCenter () const override
 Return the current phase center as an MDirection. More...
 
virtual const casacore::Cube
< double > & 
receptorAngles () const override
 Return receptor angles for all antennae and feeds First axis of the cube is a receptor number, 2nd is antennaId, 3rd is feedId Note: the method is intended to provide an access to MSIter::receptorAngles for VisBuffer in the multi-feed case. More...
 
virtual const casacore::Vector
< casacore::String > & 
antennaMounts () const override
 +=========================+ | | | Chunk and casacore::MS Level casacore::Data | | | +=========================+ More...
 
virtual casacore::MEpoch getEpoch () const override
 
virtual casacore::Vector<casacore::MPosition> antennaPositions () const;

casacore::MSDerivedValues makeMsd (); More...

 
virtual const VisImagingWeightgetImagingWeightGenerator () const override
 Return imaging weight (a weight for each channel) virtual casacore::Matrix<casacore::Float> & imagingWeight (casacore::Matrix<casacore::Float> & wt) const;. More...
 
virtual casacore::MFrequency::Types getObservatoryFrequencyType () const override
 
virtual casacore::MPosition getObservatoryPosition () const override
 
virtual casacore::Vector
< casacore::Float
getReceptor0Angle () override
 
virtual casacore::Int getReportingFrameOfReference () const override
 
virtual void setReportingFrameOfReference (casacore::Int frame) override
 
virtual casacore::Vector
< casacore::Int
getChannels (double time, casacore::Int frameOfReference, casacore::Int spectralWindowId, casacore::Int msId) const override
 
virtual casacore::Vector
< casacore::Int
getCorrelations () const override
 
virtual casacore::Vector
< casacore::Stokes::StokesTypes
getCorrelationTypesDefined () const override
 
virtual casacore::Vector
< casacore::Stokes::StokesTypes
getCorrelationTypesSelected () const override
 
virtual casacore::Vector< double > getFrequencies (double time, casacore::Int frameOfReference, casacore::Int spectralWindowId, casacore::Int msId) const override
 
virtual void dataDescriptionIds (casacore::Vector< casacore::Int > &) const override
 
virtual casacore::Int msId () const override
 reference to actual ms in interator More...
 
virtual const
casacore::MeasurementSet
ms () const override
 
virtual casacore::Int getNMs () const override
 
virtual casacore::String msName () const override
 Name of nominal MS (will typically be beneath several layers) More...
 
virtual void slurp () const override
 Call to use the slurp i/o method for all scalar columns. More...
 
virtual const vi::SubtableColumnssubtableColumns () const override
 Access the current casacore::ROMSColumns object in MSIter. More...
 
virtual const
SpectralWindowChannels & 
getSpectralWindowChannels (casacore::Int msId, casacore::Int spectralWindowId) const override
 get back the selected spectral windows and spectral channels for current ms More...
 
virtual void useImagingWeight (const VisImagingWeight &imWgt) override
 assign a VisImagingWeight object to this iterator More...
 
virtual casacore::Int nAntennas () const override
 Return number of antennasm spws, polids, ddids. More...
 
virtual casacore::Int nDataDescriptionIds () const override
 
virtual casacore::Int nPolarizationIds () const override
 
virtual casacore::Int nRowsInChunk () const override
 
virtual casacore::Int nRowsViWillSweep () const override
 
virtual casacore::Int nSpectralWindows () const override
 
virtual void writeFlag (const casacore::Matrix< casacore::Bool > &flag)
 Write/modify the flags in the data. More...
 
virtual void writeFlag (const casacore::Cube< casacore::Bool > &flag) override
 Write/modify the flags in the data. More...
 
virtual void writeFlagRow (const casacore::Vector< casacore::Bool > &rowflags) override
 Write/modify the flag row column; dimension casacore::Vector (nrow) More...
 
virtual void writeFlagCategory (const casacore::Array< casacore::Bool > &fc) override
 
virtual void writeVisCorrected (const casacore::Cube< casacore::Complex > &vis) override
 Write/modify the visibilities. More...
 
virtual void writeVisModel (const casacore::Cube< casacore::Complex > &vis) override
 
virtual void writeVisObserved (const casacore::Cube< casacore::Complex > &vis) override
 
virtual void writeWeight (const casacore::Matrix< casacore::Float > &wt) override
 Write/modify the weights. More...
 
virtual void writeWeightSpectrum (const casacore::Cube< casacore::Float > &wtsp) override
 
Write/modify the weightMat

virtual void writeWeightMat (const casacore::Matrix<casacore::Float> & wtmat); More...

 
virtual void writeSigmaSpectrum (const casacore::Cube< casacore::Float > &sigsp) override
 Write/modify the sigmaSpectrum. More...
 
virtual void writeSigma (const casacore::Matrix< casacore::Float > &sig) override
 Write/modify the Sigma. More...
 
virtual void writeModel (const casacore::RecordInterface &rec, casacore::Bool iscomponentlist=true, casacore::Bool incremental=false) override
 Write/modify the ncorr x nrow SigmaMat. More...
 
virtual void setWeightScaling (casacore::CountedPtr< WeightScaling > weightscaling) override
 
virtual casacore::Bool hasWeightScaling () const override
 
virtual casacore::CountedPtr
< WeightScaling
getWeightScaling () const override
 
const
casacore::ROMSAntennaColumns
antennaSubtablecols () const override
 
const
casacore::ROMSDataDescColumns
dataDescriptionSubtablecols () const override
 Access to dataDescription subtable. More...
 
const casacore::ROMSFeedColumnsfeedSubtablecols () const override
 Access to feed subtable. More...
 
const casacore::ROMSFieldColumnsfieldSubtablecols () const override
 Access to field subtable. More...
 
const
casacore::ROMSFlagCmdColumns
flagCmdSubtablecols () const override
 Access to flagCmd subtable. More...
 
const
casacore::ROMSHistoryColumns
historySubtablecols () const override
 Access to history subtable. More...
 
const
casacore::ROMSObservationColumns
observationSubtablecols () const override
 Access to observation subtable. More...
 
const
casacore::ROMSPointingColumns
pointingSubtablecols () const override
 Access to pointing subtable. More...
 
const
casacore::ROMSPolarizationColumns
polarizationSubtablecols () const override
 Access to polarization subtable. More...
 
const
casacore::ROMSProcessorColumns
processorSubtablecols () const override
 Access to processor subtable. More...
 
const
casacore::ROMSSpWindowColumns
spectralWindowSubtablecols () const override
 Access to spectralWindow subtable. More...
 
const casacore::ROMSStateColumnsstateSubtablecols () const override
 Access to state subtable. More...
 
const
casacore::ROMSDopplerColumns
dopplerSubtablecols () const override
 Access to doppler subtable. More...
 
const
casacore::ROMSFreqOffsetColumns
freqOffsetSubtablecols () const override
 Access to freqOffset subtable. More...
 
const casacore::ROMSSourceColumnssourceSubtablecols () const override
 Access to source subtable. More...
 
const casacore::ROMSSysCalColumnssysCalSubtablecols () const override
 Access to sysCal subtable. More...
 
const
casacore::ROMSWeatherColumns
weatherSubtablecols () const override
 Access to weather subtable. More...
 
- Public Member Functions inherited from casa::vi::ViImplementation2
 ViImplementation2 (const ViImplementation2 &)=delete
 make noncopyable... More...
 
ViImplementation2operator= (const ViImplementation2 &)=delete
 
 ViImplementation2 ()
 
virtual ~ViImplementation2 ()
 Destructor. More...
 

Static Public Member Functions

static casacore::Double getTimeBinWidthInSec (const casacore::Quantity &binWidth)
 these are public so that class StatWt can call them. More...
 
static void checkTimeBinWidth (casacore::Double binWidth)
 
static casacore::Double getTimeBinWidthUsingInterval (const casacore::MeasurementSet *const ms, casacore::Int n)
 
- Static Public Member Functions inherited from casa::vi::TransformingVi2
static double hourangCalculate (double time, casacore::MSDerivedValues &msd, const casacore::MEpoch &mEpoch0)
 
static casacore::Float parang0Calculate (double time, casacore::MSDerivedValues &msd, const casacore::MEpoch &epoch0)
 
static casacore::Vector
< casacore::Float
parangCalculate (double time, casacore::MSDerivedValues &msd, int nAntennas, const casacore::MEpoch mEpoch0)
 
static void calculateFlagRowFromFlagCube (const casacore::Cube< casacore::Bool > &flagCube, casacore::Vector< casacore::Bool > &flagRow)
 Library of static transformations available for all TVIs. More...
 
- Static Public Member Functions inherited from casa::vi::ViImplementation2
static void azel0Calculate (casacore::Double time, casacore::MSDerivedValues &msd, casacore::MDirection &azel0, const casacore::MEpoch &mEpoch0)
 
static void azelCalculate (casacore::Double time, casacore::MSDerivedValues &msd, casacore::Vector< casacore::MDirection > &azel, casacore::Int nAnt, const casacore::MEpoch &mEpoch0)
 
static casacore::Vector
< casacore::Float
feed_paCalculate (casacore::Double time, casacore::MSDerivedValues &msd, casacore::Int nAntennas, const casacore::MEpoch &mEpoch0, const casacore::Vector< casacore::Float > &receptor0Angle)
 
static casacore::Double hourangCalculate (casacore::Double time, casacore::MSDerivedValues &msd, const casacore::MEpoch &mEpoch0)
 
static casacore::Float parang0Calculate (casacore::Double time, casacore::MSDerivedValues &msd, const casacore::MEpoch &epoch0)
 
static casacore::Vector
< casacore::Float
parangCalculate (casacore::Double time, casacore::MSDerivedValues &msd, int nAntennas, const casacore::MEpoch mEpoch0)
 

Static Public Attributes

static const casacore::String CHANBIN
 

Protected Member Functions

void originChunks (casacore::Bool forceRewind)
 Methods to control chunk iterator. More...
 
void nextChunk ()
 
- Protected Member Functions inherited from casa::vi::TransformingVi2
 TransformingVi2 (ViImplementation2 *inputVi)
 
void configureNewSubchunk ()
 
void configureNewSubchunk (casacore::Int msId, const casacore::String &msName, casacore::Bool isNewMs, casacore::Bool isNewArrayId, casacore::Bool isNewFieldId, casacore::Bool isNewSpectralWindow, const Subchunk &subchunk, casacore::Int nRows, casacore::Int nChannels, casacore::Int nCorrelations, const casacore::Vector< casacore::Int > &correlations, const casacore::Vector< casacore::Stokes::StokesTypes > &correlationsDefined, const casacore::Vector< casacore::Stokes::StokesTypes > &correlationsSelected, casacore::CountedPtr< WeightScaling > weightScaling)
 
VisibilityIterator2getVi () const
 
ViImplementation2getVii () const
 
void setVisBuffer (VisBuffer2 *vb)
 
- Protected Member Functions inherited from casa::vi::ViImplementation2
virtual VisBuffer2createAttachedVisBuffer (VisBufferOptions options)
 
VisBuffer2getVisBuffer (const VisibilityIterator2 *) const
 

Private Types

enum  Column {
  DATA,
  CORRECTED,
  RESIDUAL,
  RESIDUAL_DATA
}
 
using Baseline = std::pair< casacore::uInt, casacore::uInt >
 

Private Member Functions

casacore::Bool _checkFirsSubChunk (casacore::Int &spw, casacore::Bool &firstTime, const VisBuffer2 *const vb) const
 returns True if this chunk has already been processed. More...
 
void _computeWeightSpectrumAndFlags () const
 
const casacore::Cube
< casacore::Complex > 
_dataCube (const VisBuffer2 *const vb) const
 
void _gatherAndComputeWeights () const
 
void _gatherAndComputeWeightsSlidingTimeWindow () const
 
void _gatherAndComputeWeightsTimeBlockProcessing () const
 
casacore::Cube< casacore::Bool_getResultantFlags (casacore::Cube< casacore::Bool > &chanSelFlagTemplate, casacore::Cube< casacore::Bool > &chanSelFlags, casacore::Bool &initChanSelFlags, casacore::Int spw, const casacore::Cube< casacore::Bool > &flagCube) const
 combines the flag cube with the channel selection flags (if any) More...
 
void _logUsedChannels () const
 CAS-12358. More...
 
casacore::Double _computeWeight (const casacore::Cube< casacore::Complex > &data, const casacore::Cube< casacore::Bool > &flags, casacore::uInt spw) const
 multi-threaded case More...
 
void _computeWeightsTimeBlockProcessing (const std::map< BaselineChanBin, casacore::Cube< casacore::Complex >> &data, const std::map< BaselineChanBin, casacore::Cube< casacore::Bool >> &flags) const
 
void _computeWeightsSlidingTimeWindow (const casacore::Cube< casacore::Complex > &data, const casacore::Cube< casacore::Bool > &flags, const std::vector< std::set< casacore::uInt >> &rowMap, casacore::uInt spw) const
 
casacore::Bool _parseConfiguration (const casacore::Record &configuration)
 
std::pair< casacore::Cube
< casacore::Float >
, casacore::Cube
< casacore::Bool > > 
_getLowerLayerWtSpFlags (size_t &nOrigFlagged) const
 
void _setChanBinMap (casacore::Int binWidth)
 
void _setChanBinMap (const casacore::Quantity &binWidth)
 
void _setDefaultChanBinMap ()
 
void _clearCache ()
 
void _updateWtSpFlags (casacore::Cube< casacore::Float > &wtsp, casacore::Cube< casacore::Bool > &flags, casacore::Bool &checkFlags, const casacore::Slicer &slice, casacore::Float wt) const
 
void _configureStatAlg (const casacore::Record &config)
 
void _weightSpectrumFlagsTimeBlockProcessing (casacore::Cube< casacore::Float > &wtsp, casacore::Cube< casacore::Bool > &flagCube, casacore::Bool &checkFlags) const
 
void _weightSpectrumFlagsSlidingTimeWindow (casacore::Cube< casacore::Float > &wtsp, casacore::Cube< casacore::Bool > &flagCube, casacore::Bool &checkFlags) const
 
void _weightSingleChanBinBlockTimeProcessing (casacore::Matrix< casacore::Float > &wtmat, casacore::Int nrows) const
 
void _weightSingleChanBinSlidingTimeWindow (casacore::Matrix< casacore::Float > &wtmat, casacore::Int nrows) const
 

Static Private Member Functions

static Baseline _baseline (casacore::uInt ant1, casacore::uInt ant2)
 void _initialize(); More...
 

Private Attributes

casacore::Bool _weightsComputed
 
std::unique_ptr< casacore::Bool_mustComputeWtSp
 
casacore::Cube< casacore::Float_newWtSp
 
casacore::Matrix< casacore::Float_newWt
 
casacore::Cube< casacore::Bool_newFlag
 
casacore::Vector< casacore::Bool_newFlagRow
 
std::map< BaselineChanBin,
std::vector< casacore::Double > > 
_weights
 the vector represents separate correlations, there will be only one element in the vector if _combineCorr is true More...
 
std::map< casacore::Int,
std::vector< ChanBin > > 
_chanBins
 The key refers to the spw, the value vector refers to the channel numbers within that spw that are the first, last channel pair in their respective bins. More...
 
casacore::Int _minSamp
 
casacore::Bool _combineCorr
 
casacore::CountedPtr
< casacore::StatisticsAlgorithm
< casacore::Double,
casacore::Array
< casacore::Float >
::const_iterator,
casacore::Array
< casacore::Bool >
::const_iterator > > 
_statAlg
 
std::unique_ptr< std::pair
< casacore::Double,
casacore::Double > > 
_wtrange
 
std::map< casacore::uInt,
casacore::Cube< casacore::Bool > > 
_chanSelFlags
 The _chanSelFlags key is the spw. More...
 
size_t _nTotalPts
 
size_t _nNewFlaggedPts
 
size_t _nOrigFlaggedPts
 
Column _column
 
std::map< casacore::uInt,
std::pair< casacore::uInt,
casacore::uInt > > 
_samples
 
std::set< casacore::uInt_processedRowIDs
 
std::vector< std::vector
< casacore::Double > > 
_timeWindowWts
 
casacore::Cube< casacore::Double_slidingTimeWindowWeights
 
casacore::Bool _timeBlockProcessing
 if False, the a sliding time window is being used More...
 
std::map< casacore::uInt,
casacore::uInt
_rowIDInMSTorowIndexInChunk
 for running time window, for each subchunk, map the rowID (in the MS) to the row index in the chunk More...
 
casacore::Double _slidingTimeWindowWidth
 
casacore::Bool _mustComputeSigma
 
casacore::Bool _updateWeight
 
casacore::Bool _noModel
 
std::shared_ptr
< casacore::ClassicalStatistics
< casacore::Double,
casacore::Array
< casacore::Float >
::const_iterator,
casacore::Array
< casacore::Bool >
::const_iterator > > 
_wtStats
 

Additional Inherited Members

- Static Protected Member Functions inherited from casa::vi::ViImplementation2
static void doWeightScaling (casacore::Bool hasWeightScaling, WeightScaling *scaling, const casacore::Array< casacore::Float > &unscaled, casacore::Array< casacore::Float > &scaled)
 
- Protected Attributes inherited from casa::vi::TransformingVi2
ViImplementation2inputVii_p
 jagonzal (to be reviewed by jjacobs): I need to set inputVii_p to NULL from MSTransformIterator destructor because MSTransformIteratorFactory is borrowing the ViImplementation2 from the input iterator, which is deleted in the first steps of the MSTransformIterator destructor. More...
 

Detailed Description

Definition at line 39 of file StatWtTVI.h.

Member Typedef Documentation

Definition at line 140 of file StatWtTVI.h.

Member Enumeration Documentation

Enumerator
DATA 

column(s) to use DATA

CORRECTED 

CORRECTED_DATA.

RESIDUAL 

CORRECTED_DATA - MODEL_DATA.

RESIDUAL_DATA 

DATA - MODEL_DATA.

Definition at line 173 of file StatWtTVI.h.

Constructor & Destructor Documentation

casa::vi::StatWtTVI::StatWtTVI ( ViImplementation2 inputVii,
const casacore::Record configuration 
)

The following fields are supported in the input configuration record combine String, if contains "corr", data will be aggregated across correlations.

value in CHANBIN: Int or Quantity String, describes channel bin widths in which to aggregate data within spectral windows (spw boundaries are not crossed). If not supplied, data for all channels in each spectral window are aggregated. minsamp: Int, minimum number of samples required in an aggregated set, if less than that, stats are not computed and the data in the sample are flagged. If not supplied, 2 is used. statalg String representing what statistics algorithm to use. "cl", "ch", "f", "h". maxiter Int max number of iterations for Chauvenet algorithm zscore Double zscore for Chauvenet algorithm center String center for FitToHalf algorithm, "mean", "median", or "zero" lside Bool side to use for FitToHalf algorithm, True means <= center side. fence Double fence value for HingesFences algorithm wtrange Zero or two element Array<Double>. Specifies the range of "good" weight values. Data with weights computed to be outside this range will be flagged. Both elements must be non-negative. If zero length, all weights are acceptable. fitspw String. MSSelection string representing channels to exclude from weight computation. datacolumn String. Data column to use for computing weights. Supports 'data' or 'corrected'. Minimum match, case insensitive. If not provided. 'corrected' is used. slidetimebin Bool. If true, use a sliding window for binning in time. timebin Double. Width of sliding time window. Not used if doslidetime is not supplied or if doslidetime = false;

virtual casa::vi::StatWtTVI::~StatWtTVI ( )
virtual

Member Function Documentation

static Baseline casa::vi::StatWtTVI::_baseline ( casacore::uInt  ant1,
casacore::uInt  ant2 
)
staticprivate

void _initialize();

swaps ant1/ant2 if necessary

casacore::Bool casa::vi::StatWtTVI::_checkFirsSubChunk ( casacore::Int spw,
casacore::Bool firstTime,
const VisBuffer2 *const  vb 
) const
private

returns True if this chunk has already been processed.

This can happen for the last chunk.

void casa::vi::StatWtTVI::_clearCache ( )
private
casacore::Double casa::vi::StatWtTVI::_computeWeight ( const casacore::Cube< casacore::Complex > &  data,
const casacore::Cube< casacore::Bool > &  flags,
casacore::uInt  spw 
) const
private

multi-threaded case

void casa::vi::StatWtTVI::_computeWeightSpectrumAndFlags ( ) const
private
void casa::vi::StatWtTVI::_computeWeightsSlidingTimeWindow ( const casacore::Cube< casacore::Complex > &  data,
const casacore::Cube< casacore::Bool > &  flags,
const std::vector< std::set< casacore::uInt >> &  rowMap,
casacore::uInt  spw 
) const
private
void casa::vi::StatWtTVI::_computeWeightsTimeBlockProcessing ( const std::map< BaselineChanBin, casacore::Cube< casacore::Complex >> &  data,
const std::map< BaselineChanBin, casacore::Cube< casacore::Bool >> &  flags 
) const
private
void casa::vi::StatWtTVI::_configureStatAlg ( const casacore::Record config)
private
const casacore::Cube<casacore::Complex> casa::vi::StatWtTVI::_dataCube ( const VisBuffer2 *const  vb) const
private
void casa::vi::StatWtTVI::_gatherAndComputeWeights ( ) const
private
void casa::vi::StatWtTVI::_gatherAndComputeWeightsSlidingTimeWindow ( ) const
private
void casa::vi::StatWtTVI::_gatherAndComputeWeightsTimeBlockProcessing ( ) const
private
std::pair< casacore::Cube<casacore::Float>, casacore::Cube<casacore::Bool> > casa::vi::StatWtTVI::_getLowerLayerWtSpFlags ( size_t &  nOrigFlagged) const
private
casacore::Cube<casacore::Bool> casa::vi::StatWtTVI::_getResultantFlags ( casacore::Cube< casacore::Bool > &  chanSelFlagTemplate,
casacore::Cube< casacore::Bool > &  chanSelFlags,
casacore::Bool initChanSelFlags,
casacore::Int  spw,
const casacore::Cube< casacore::Bool > &  flagCube 
) const
private

combines the flag cube with the channel selection flags (if any)

void casa::vi::StatWtTVI::_logUsedChannels ( ) const
private

CAS-12358.

casacore::Bool casa::vi::StatWtTVI::_parseConfiguration ( const casacore::Record configuration)
private
void casa::vi::StatWtTVI::_setChanBinMap ( casacore::Int  binWidth)
private
void casa::vi::StatWtTVI::_setChanBinMap ( const casacore::Quantity binWidth)
private
void casa::vi::StatWtTVI::_setDefaultChanBinMap ( )
private
void casa::vi::StatWtTVI::_updateWtSpFlags ( casacore::Cube< casacore::Float > &  wtsp,
casacore::Cube< casacore::Bool > &  flags,
casacore::Bool checkFlags,
const casacore::Slicer slice,
casacore::Float  wt 
) const
private
void casa::vi::StatWtTVI::_weightSingleChanBinBlockTimeProcessing ( casacore::Matrix< casacore::Float > &  wtmat,
casacore::Int  nrows 
) const
private
void casa::vi::StatWtTVI::_weightSingleChanBinSlidingTimeWindow ( casacore::Matrix< casacore::Float > &  wtmat,
casacore::Int  nrows 
) const
private
void casa::vi::StatWtTVI::_weightSpectrumFlagsSlidingTimeWindow ( casacore::Cube< casacore::Float > &  wtsp,
casacore::Cube< casacore::Bool > &  flagCube,
casacore::Bool checkFlags 
) const
private
void casa::vi::StatWtTVI::_weightSpectrumFlagsTimeBlockProcessing ( casacore::Cube< casacore::Float > &  wtsp,
casacore::Cube< casacore::Bool > &  flagCube,
casacore::Bool checkFlags 
) const
private
static void casa::vi::StatWtTVI::checkTimeBinWidth ( casacore::Double  binWidth)
static
virtual void casa::vi::StatWtTVI::flag ( casacore::Cube< casacore::Bool > &  flags) const
virtual

Return flag for each polarization, channel and row.

Reimplemented from casa::vi::TransformingVi2.

virtual void casa::vi::StatWtTVI::flagRow ( casacore::Vector< casacore::Bool > &  rowflags) const
virtual

Return row flag.

Reimplemented from casa::vi::TransformingVi2.

static casacore::Double casa::vi::StatWtTVI::getTimeBinWidthInSec ( const casacore::Quantity binWidth)
static

these are public so that class StatWt can call them.

In general, other clients shouldn't call them.

static casacore::Double casa::vi::StatWtTVI::getTimeBinWidthUsingInterval ( const casacore::MeasurementSet *const  ms,
casacore::Int  n 
)
static
void casa::vi::StatWtTVI::initSigmaSpectrum ( const casacore::Cube< casacore::Float > &  )
virtual

Initialize the sigmaSpectrum.

Reimplemented from casa::vi::ViImplementation2.

void casa::vi::StatWtTVI::initWeightSpectrum ( const casacore::Cube< casacore::Float > &  )
virtual

Initialize the weightSpectrum.

Reimplemented from casa::vi::ViImplementation2.

void casa::vi::StatWtTVI::next ( )
virtual

Reimplemented from casa::vi::TransformingVi2.

void casa::vi::StatWtTVI::nextChunk ( )
protectedvirtual

Reimplemented from casa::vi::TransformingVi2.

void casa::vi::StatWtTVI::origin ( )
virtual

+==================================+ | | | Iteration Control and Monitoring | | | +==================================+

Methods to control and monitor subchunk iteration

Reimplemented from casa::vi::TransformingVi2.

void casa::vi::StatWtTVI::originChunks ( casacore::Bool  forceRewind)
protectedvirtual

Methods to control chunk iterator.

Reimplemented from casa::vi::TransformingVi2.

virtual void casa::vi::StatWtTVI::sigma ( casacore::Matrix< casacore::Float > &  sigmat) const
virtual

Return sigma.

Reimplemented from casa::vi::TransformingVi2.

virtual void casa::vi::StatWtTVI::sigmaSpectrum ( casacore::Cube< casacore::Float > &  wtsp) const
virtual

Return sgimaspectrum (a sigma for each channel)

Reimplemented from casa::vi::TransformingVi2.

void casa::vi::StatWtTVI::summarizeFlagging ( ) const
void casa::vi::StatWtTVI::summarizeStats ( casacore::Double mean,
casacore::Double variance 
) const
virtual casacore::String casa::vi::StatWtTVI::ViiType ( ) const
inlinevirtual

Report the the ViImplementation type (should be specialized in child classes)

Reimplemented from casa::vi::TransformingVi2.

Definition at line 87 of file StatWtTVI.h.

References casa::vi::TransformingVi2::getVii(), and casa::vi::ViImplementation2::ViiType().

virtual void casa::vi::StatWtTVI::weight ( casacore::Matrix< casacore::Float > &  wtmat) const
virtual

Return weight.

Reimplemented from casa::vi::TransformingVi2.

virtual void casa::vi::StatWtTVI::weightSpectrum ( casacore::Cube< casacore::Float > &  wtsp) const
virtual

Return weightspectrum (a weight for each channel)

Reimplemented from casa::vi::TransformingVi2.

void casa::vi::StatWtTVI::writeBackChanges ( VisBuffer2 vb)
virtual

Override unimplemented TransformingVi2 version.

Reimplemented from casa::vi::TransformingVi2.

Member Data Documentation

std::map<casacore::Int, std::vector<ChanBin> > casa::vi::StatWtTVI::_chanBins
private

The key refers to the spw, the value vector refers to the channel numbers within that spw that are the first, last channel pair in their respective bins.

Definition at line 198 of file StatWtTVI.h.

std::map<casacore::uInt, casacore::Cube<casacore::Bool> > casa::vi::StatWtTVI::_chanSelFlags
private

The _chanSelFlags key is the spw.

The value is a Cube for convenience for subchunk computations that require the same shaped cube of flags to be applied. The dimension that counts is the second (zero-based 1) as it has length equal to the number of channels in the spw. A value of True indicates that the channel is "flagged", ie should not be used.

Definition at line 212 of file StatWtTVI.h.

Column casa::vi::StatWtTVI::_column
mutableprivate

Definition at line 217 of file StatWtTVI.h.

casacore::Bool casa::vi::StatWtTVI::_combineCorr
private

Definition at line 200 of file StatWtTVI.h.

casacore::Int casa::vi::StatWtTVI::_minSamp
private

Definition at line 199 of file StatWtTVI.h.

casacore::Bool casa::vi::StatWtTVI::_mustComputeSigma
private

Definition at line 231 of file StatWtTVI.h.

std::unique_ptr<casacore::Bool> casa::vi::StatWtTVI::_mustComputeWtSp
mutableprivate

Definition at line 186 of file StatWtTVI.h.

casacore::Cube<casacore::Bool> casa::vi::StatWtTVI::_newFlag
mutableprivate

Definition at line 189 of file StatWtTVI.h.

casacore::Vector<casacore::Bool> casa::vi::StatWtTVI::_newFlagRow
mutableprivate

Definition at line 190 of file StatWtTVI.h.

casacore::Matrix<casacore::Float> casa::vi::StatWtTVI::_newWt
mutableprivate

Definition at line 188 of file StatWtTVI.h.

casacore::Cube<casacore::Float> casa::vi::StatWtTVI::_newWtSp
mutableprivate

Definition at line 187 of file StatWtTVI.h.

size_t casa::vi::StatWtTVI::_nNewFlaggedPts
mutableprivate

Definition at line 215 of file StatWtTVI.h.

casacore::Bool casa::vi::StatWtTVI::_noModel
private

Definition at line 233 of file StatWtTVI.h.

size_t casa::vi::StatWtTVI::_nOrigFlaggedPts
mutableprivate

Definition at line 216 of file StatWtTVI.h.

size_t casa::vi::StatWtTVI::_nTotalPts
mutableprivate

Definition at line 214 of file StatWtTVI.h.

std::set<casacore::uInt> casa::vi::StatWtTVI::_processedRowIDs
mutableprivate

Definition at line 220 of file StatWtTVI.h.

std::map<casacore::uInt, casacore::uInt> casa::vi::StatWtTVI::_rowIDInMSTorowIndexInChunk
mutableprivate

for running time window, for each subchunk, map the rowID (in the MS) to the row index in the chunk

Definition at line 228 of file StatWtTVI.h.

std::map<casacore::uInt, std::pair<casacore::uInt, casacore::uInt> > casa::vi::StatWtTVI::_samples
mutableprivate

Definition at line 219 of file StatWtTVI.h.

casacore::Cube<casacore::Double> casa::vi::StatWtTVI::_slidingTimeWindowWeights
mutableprivate

Definition at line 222 of file StatWtTVI.h.

casacore::Double casa::vi::StatWtTVI::_slidingTimeWindowWidth
private

Definition at line 229 of file StatWtTVI.h.

Definition at line 205 of file StatWtTVI.h.

casacore::Bool casa::vi::StatWtTVI::_timeBlockProcessing
private

if False, the a sliding time window is being used

Definition at line 224 of file StatWtTVI.h.

std::vector<std::vector<casacore::Double> > casa::vi::StatWtTVI::_timeWindowWts
mutableprivate

Definition at line 221 of file StatWtTVI.h.

casacore::Bool casa::vi::StatWtTVI::_updateWeight
private

Definition at line 232 of file StatWtTVI.h.

std::map<BaselineChanBin, std::vector<casacore::Double> > casa::vi::StatWtTVI::_weights
mutableprivate

the vector represents separate correlations, there will be only one element in the vector if _combineCorr is true

Definition at line 194 of file StatWtTVI.h.

casacore::Bool casa::vi::StatWtTVI::_weightsComputed
mutableprivate

Definition at line 185 of file StatWtTVI.h.

std::unique_ptr<std::pair<casacore::Double, casacore::Double> > casa::vi::StatWtTVI::_wtrange
private

Definition at line 206 of file StatWtTVI.h.

Definition at line 239 of file StatWtTVI.h.

const casacore::String casa::vi::StatWtTVI::CHANBIN
static

Definition at line 43 of file StatWtTVI.h.


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