23 #ifndef FLAGDATAHANDLER_H_
24 #define FLAGDATAHANDLER_H_
47 template <
class M>
class ScalarMeasColumn;
53 typedef std::map< std::pair<casacore::Int,casacore::Int>,std::vector<casacore::uInt> >::iterator
antennaPairMapIterator;
56 typedef std::map< std::pair<casacore::Int,casacore::Int>,std::vector<casacore::uInt> >
antennaPairMap;
62 typedef std::map< casacore::Int,casacore::Double >
lambdaMap;
72 CubeView(
casacore::Cube<T> *parentCube, std::vector<casacore::uInt> *rows = NULL, std::vector<casacore::uInt> *channels = NULL, std::vector<casacore::uInt> *polarizations = NULL)
78 if (((polarizations != NULL) and (polarizations->size() > 0)) and
79 ((channels != NULL) and (channels->size() > 0)) and
80 ((rows != NULL) and (rows->size() > 0)))
84 else if (((polarizations != NULL) and (polarizations->size() > 0)) and
85 ((channels != NULL) and (channels->size() > 0)))
89 else if (((polarizations != NULL) and (polarizations->size() > 0)) and
90 ((rows != NULL) and (rows->size() > 0)))
94 else if (((channels != NULL) and (channels->size() > 0)) and
95 ((rows != NULL) and (rows->size() > 0)))
99 else if ((polarizations != NULL) and (polarizations->size() > 0))
103 else if ((channels != NULL) and (channels->size() > 0))
107 else if ((rows != NULL) and (rows->size() > 0))
116 if ((polarizations != NULL) and (polarizations->size() > 0))
127 if ((channels != NULL) and (channels->size() > 0))
138 if ((rows != NULL) and (rows->size() > 0))
172 std::vector<casacore::uInt> *index =
new std::vector<casacore::uInt>(
size);
252 if ((rows != NULL) and (rows->size() > 0))
261 if ((rows != NULL) and (rows->size() > 0))
293 std::vector<casacore::uInt> *index =
new std::vector<casacore::uInt>(
size);
825 virtual bool open() {
return false;}
826 virtual bool close() {
return false;}
void setTimeInterval(casacore::Double timeInterval)
Set time interval (also known as ntime)
void setScanStartStopFlaggedMap(bool activated)
A Vector of integers, for indexing into Array<T> objects.
casacore::uLong processedRows
Iteration counters.
virtual bool generateIterator()
casacore::String scanIntentSelection_p
virtual bool selectData()
casacore::Complex calsol4(casacore::uInt chan, casacore::uInt row)
std::map< casacore::uInt, casacore::String > polarizationIndexMap
A 1-D Specialization of the Array class.
casacore::uInt nSelectedCorrelations_p
casacore::String dataColumnType_p
T & operator()(casacore::uInt i1)
void applyFlagInRow(casacore::uInt row)
T & accessUnmapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
casacore::Record chanAvgOptions_p
LatticeExprNode arg(const LatticeExprNode &expr)
casacore::String scanSelection_p
virtual bool checkIfSourceModelColumnExists()
std::vector< casacore::uInt > * polarizations_p
void setProfiling(casacore::Bool value)
casacore::String fieldSelection_p
const casacore::IPosition & shape() const
NOTE: reducedLength_p is defined as [chan,row,pol].
casacore::Complex diffVis(casacore::uInt pol, casacore::uInt chan, casacore::uInt row)
bool buffersInitialized_p
bool profiling_p
Profiling.
std::complex< Float > Complex
A top level class defining the data handling interface for the flagging module.
casacore::Complex leftVis(casacore::uInt pol, casacore::uInt chan, casacore::uInt row)
casacore::Vector< casacore::Bool > modifiedFlagRow_p
void setExpressionMapping(casacore::String expression, polarizationMap *polMap)
casacore::String expression_p
casacore::Complex stokes_q_from_linear(casacore::uInt chan, casacore::uInt row)
casacore::Float imag(casacore::Complex val)
void setExpressionMapping(std::vector< std::vector< casacore::uInt > > selectedCorrelations)
casacore::Complex calsol1(casacore::uInt chan, casacore::uInt row)
virtual void generateScanStartStopMap()
casacore::IPosition reducedLength_p
bool stats_p
Stats members.
void shape(casacore::Int &chan, casacore::Int &row) const
casacore::Bool getModifiedFlags(casacore::uInt chan, casacore::uInt row)
const casacore::Complex ImaginaryUnit
casacore::Cube< casacore::Complex > & weightVisCube()
Get a casacore::Float visCube and return a casacore::Complex one.
void setParentFlagRow(VectorView< casacore::Bool > *commonFlagRowView, VectorView< casacore::Bool > *originalFlagRowView, VectorView< casacore::Bool > *privateFlagRowView=NULL)
void(casa::FlagMapper::* applyFlagRow_p)(casacore::uInt)
polarizationIndexMap * getPolarizationIndexMap()
casacore::Bool getPrivateFlags(casacore::uInt chan, casacore::uInt row)
T & accessIndex1Mapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
casacore::IPosition reducedLength_p
casacore::Vector< casacore::Int > chanAverageBin_p
casacore::Vector< casacore::Bool > * getModifiedFlagRow()
unsigned long long uInt64
casacore::Bool enableTimeAvg_p
casacore::Time average iterator parameters
The number of StokesTypes.
casacore::Double timeInterval_p
casacore::LogIO * logger_p
Make the logger public to that we can use it from FlagAgentBase::create.
void shape(casacore::Int &pol, casacore::Int &chan, casacore::Int &row) const
casacore::Float arg(casacore::Complex val)
casacore::uLong cubeAccessCounter_p
std::vector< casacore::uInt > * createIndex(casacore::uInt size)
T & accessIndex12Mapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
casacore::Bool getOriginalFlagRow(casacore::uInt row)
A 3-D Specialization of the Array class.
void shape(casacore::Int &s1) const
void setTimeAverageIter(bool activated)
VectorView< casacore::Bool > * privateFlagRowView_p
scanStartStopMap * getMapScanStartStop()
T & accessMapped(casacore::uInt i1)
virtual casacore::String getTableName()
casacore::Vector< T > * parentVector_p
CubeView< casacore::Complex > * rightVis_p
casacore::uInt64 progressCounts_p
void stopIteration()
Stop iterating.
std::map< casacore::Int, std::vector< casacore::Double > > scanStartStopMap
casacore::Complex correlationProduct(casacore::uInt pol, casacore::uInt chan, casacore::uInt row)
Direct access to the complex correlation product.
antennaPairMap * getAntennaPairMap()
Accessors for the mapping functions.
std::map< casacore::uShort, casacore::uShort > polarizationMap
casacore::Cube< casacore::Bool > * getModifiedFlagCube()
As requested by Urvashi R.V.
std::vector< casacore::String > * corrProducts_p
virtual ~FlagDataHandler()
Default destructor.
ostream-like interface to creating log messages.
CubeView< casacore::Complex > * leftVis_p
casacore::Vector< casacore::Bool > * getOriginalFlagRow()
std::map< casacore::Double, std::vector< casacore::uInt > > subIntegrationMap
void setParentCubes(CubeView< casacore::Complex > *leftVis, CubeView< casacore::Complex > *rightVis=NULL)
T norm(const casacore::Vector< T > &x)
The magnitude/norm of a vector.
casacore::uShort bufferNo
VisBufferComponents2 * prefetchColumns_p
RO Visibility Iterator.
FlagMapper(casacore::Bool flag, std::vector< std::vector< casacore::uInt > > selectedCorrelations, CubeView< casacore::Bool > *commonFlagsView, CubeView< casacore::Bool > *originalFlagsView, CubeView< casacore::Bool > *privateFlagsView=NULL, VectorView< casacore::Bool > *commonFlagRowView=NULL, VectorView< casacore::Bool > *originalFlagRowView=NULL, VectorView< casacore::Bool > *privateFlagRowView=NULL)
casacore::String timeSelection_p
T & accessIndex2Mapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
void applyPrivateFlagRow(casacore::uInt row)
Apply flags to common and private flag rows.
casacore::Float norm(casacore::Complex val)
casacore::Complex calsol2(casacore::uInt chan, casacore::uInt row)
const casacore::IPosition & shape() const
casacore::Vector< bool > isCorrelatorType_p
PROCESSOR sub-table section.
std::vector< std::vector< casacore::Double > > antennaPointingMap
bool mapSubIntegrations_p
T &(casa::CubeView< T >::* access_p)(casacore::uInt, casacore::uInt, casacore::uInt)
casacore::Complex stokes_i(casacore::uInt pol, casacore::uInt chan)
casacore::uShort tableTye_p
VectorView(casacore::Vector< T > *parentVector, std::vector< casacore::uInt > *rows=NULL)
std::map< std::pair< casacore::Int, casacore::Int >, std::vector< casacore::uInt > > antennaPairMap
casacore::Cube< T > * parentCube_p
void checkCommonFlags(casacore::uInt pol, casacore::uInt channel, casacore::uInt row)
Apply flags to common and private flag cubes.
std::map< casacore::Int, casacore::Double > lambdaMap
casacore::uInt flagsPerRow_p
casacore::Cube< casacore::Bool > originalFlagCube_p
Flag Cubes.
casacore::IPosition reducedLength_p
casacore::Complex stokes_u_from_circular(casacore::uInt chan, casacore::uInt row)
double cubeAccessTimeTotal_p
T &(casa::VectorView< T >::* access_p)(casacore::uInt)
VectorView< casacore::Bool > * commonFlagRowView_p
void setMapSubIntegrations(bool activated)
casacore::MSSelection * measurementSetSelection_p
casacore::Complex linear_yy(casacore::uInt pol, casacore::uInt chan)
casacore::Cube< casacore::Complex > weight_spectrum_p
std::map< std::pair< casacore::Int, casacore::Int >, std::vector< casacore::uInt > >::iterator antennaPairMapIterator
Type definitions.
polarizationMap * getPolarizationMap()
void setMapAntennaPairs(bool activated)
Functions to switch on/off mapping functions.
casacore::Complex circular_ll(casacore::uInt pol, casacore::uInt chan)
std::vector< casacore::uInt > * createIndex(casacore::uInt size)
virtual bool checkIfColumnExists(casacore::String)
casacore::Complex stokes_i_from_circular(casacore::uInt chan, casacore::uInt row)
casacore::String observationSelection_p
void setChanAverageIter(casacore::Vector< casacore::Int > chanbin)
const casacore::IPosition & shape() const
T & accessIndex23Mapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
void setMapPolarizations(bool activated)
void setPrivateFlags(casacore::uInt pol, casacore::uInt channel, casacore::uInt row)
std::map< casacore::uShort, casacore::uShort >::iterator polartizationMapIterator
VectorView< casacore::Bool > * originalFlagRowView_p
antennaPointingMap * getMapAntennaPointing()
casacore::Bool loadProcessorTable_p
std::vector< casacore::uInt > * rows_p
bool setDataSelection(casacore::Record record)
Set casacore::Data Selection parameters.
std::vector< std::vector< casacore::uInt > > selectedCorrelations_p
casacore::Vector< casacore::Bool > originalFlagRow_p
FlagRows.
casacore::String uvwSelection_p
casacore::Complex stokes_i_from_linear(casacore::uInt chan, casacore::uInt row)
std::vector< casacore::uInt > * channels_p
scanStartStopMap * scanStartStopMap_p
LatticeExprNode abs(const LatticeExprNode &expr)
Numerical 1-argument functions which result in a real number regardless of input expression type...
casacore::Vector< casacore::Double > * antennaDiameters_p
antennaPointingMap * antennaPointingMap_p
void applyCommonFlags(casacore::uInt pol, casacore::uInt channel, casacore::uInt row)
Apply flags to common flag cube.
const IPosition & shape() const
The length of the Vector.
casacore::Cube< casacore::Bool > modifiedFlagCube_p
casacore::Complex linear_xx(casacore::uInt pol, casacore::uInt chan)
casacore::Complex(casa::VisMapper::* corrProduct)(casacore::uInt, casacore::uInt)
casacore::Float(casa::VisMapper::* applyVisExpr_p)(casacore::Complex)
casacore::Complex stokes_u(casacore::uInt pol, casacore::uInt chan)
void setScanStartStopMap(bool activated)
casacore::Vector< casacore::String > * fieldNames_p
casacore::String arraySelection_p
casacore::Bool getModifiedFlagRow(casacore::uInt row)
antennaPairMap * antennaPairMap_p
Mapping members.
bool groupTimeSteps_p
Vis buffer characteristics (constant values)
casacore::uShort summaryThreshold_p
lambdaMap * getLambdaMap()
MSSelection: Class to represent a selection on an MS.
casacore::Complex stokes_v_from_linear(casacore::uInt chan, casacore::uInt row)
void(casa::FlagMapper::* applyFlag_p)(casacore::uInt, casacore::uInt, casacore::uInt)
A hierarchical collection of named fields of various types.
bool Bool
Define the standard types used by Casacore.
bool processorTableExist_p
virtual void generateSubIntegrationMap()
const casacore::IPosition & shape() const
casacore::uInt flagsPerRow()
casacore::uInt nSelectedCorrelations()
FlagDataHandler(string msname, casacore::uShort iterationApproach=SUB_INTEGRATION, casacore::Double timeInterval=0)
Default constructor NOTE: casacore::Time interval 0 groups all time steps together in one chunk...
casacore::Float operator()(casacore::uInt chan, casacore::uInt row)
casacore::Float real(casacore::Complex val)
casacore::Cube< casacore::Bool > * getOriginalFlagCube()
bool chunksInitialized_p
Iteration initialization parameters.
casacore::String baselineSelection_p
CubeView< casacore::Bool > * privateFlagsView_p
casacore::Float abs(casacore::Complex val)
T & operator()(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
casacore::Complex stokes_v_from_circular(casacore::uInt chan, casacore::uInt row)
vi::AveragingOptions timeAvgOptions_p
VisMapper(casacore::String expression, polarizationMap *polMap, CubeView< casacore::Complex > *leftVis, CubeView< casacore::Complex > *rightVis=NULL)
casacore::Complex(casa::VisMapper::* getVis_p)(casacore::uInt, casacore::uInt, casacore::uInt)
casacore::uShort iterationApproach_p
Iteration parameters.
void preLoadColumn(VisBufferComponent2 column)
Pre-Load columns (in order to avoid parallelism problems when not using async i/o, and also to know what columns to pre-fetch in async i/o mode)
bool asyncio_enabled_p
Async I/O stuff.
bool mapScanStartStopFlagged_p
bool mapAntennaPointing_p
virtual bool open()
Common casacore::MS/CalTables public interface.
void setIterationApproach(casacore::uShort iterationApproach)
Set the iteration approach.
std::vector< VisBufferComponent2 > preLoadColumns_p
Pre-Load columns (in order to avoid parallelism problems when not using async i/o, and also to know what columns to pre-fetch in async i/o mode)
std::vector< string > selectedCorrelationStrings_p
casacore::Complex linear_yx(casacore::uInt pol, casacore::uInt chan)
polarizationMap * polarizationMap_p
std::vector< std::vector< casacore::uInt > > getSelectedCorrelations()
std::vector< casacore::uInt > * rows_p
casacore::uLong cubeAccessCounterTotal_p
void enableAsyncIO(casacore::Bool enable)
Methods to switch on/off async i/o.
casacore::Vector< casacore::String > * antennaNames_p
casacore::Complex calsol3(casacore::uInt chan, casacore::uInt row)
bool flushFlags_p
FlagDataHanler-FlagAgents interaction.
CubeView< casacore::Bool > * originalFlagsView_p
casacore::Block< int > sortOrder_p
We need to have the CubeView definition here because its type is used by FlagDataHandler class...
subIntegrationMap * getSubIntegrationMap()
casacore::IPosition reducedLength_p
void shape(casacore::Int &s1, casacore::Int &s2, casacore::Int &s3) const
VisBuffer2s encapsulate one chunk of visibility data for processing.
void applyPrivateFlags(casacore::uInt pol, casacore::uInt channel, casacore::uInt row)
Apply flags to common and private flag cubes.
virtual bool summarySignal()
std::vector< std::vector< casacore::uInt > > selectedCorrelations_p
void setMapAntennaPointing(bool activated)
casacore::String spwSelection_p
casacore::Complex circular_rl(casacore::uInt pol, casacore::uInt chan)
void shape(casacore::Int &chan, casacore::Int &row) const
CubeView(casacore::Cube< T > *parentCube, std::vector< casacore::uInt > *rows=NULL, std::vector< casacore::uInt > *channels=NULL, std::vector< casacore::uInt > *polarizations=NULL)
CubeView< casacore::Bool > * commonFlagsView_p
void setModifiedFlags(casacore::uInt pol, casacore::uInt channel, casacore::uInt row)
These methods are needed for flag extension.
virtual bool parseExpression(casacore::MSSelection &)
casacore::Complex linear_xy(casacore::uInt pol, casacore::uInt chan)
casacore::Complex stokes_q_from_circular(casacore::uInt chan, casacore::uInt row)
virtual void generateAntennaPairMap()
Common casacore::MS/CalTables private interface.
std::vector< std::vector< casacore::uInt > > getSelectedCorrelations()
T & accessIndex13Mapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
String: the storage and methods of handling collections of characters.
std::vector< corrProduct > selectedCorrelationProducts_p
casacore::Complex (casa::VisMapper::*getCorr_p)(casacore::uInt,casacore::uInt);
T & accessIndex3Mapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
vi::VisBuffer2 * visibilityBuffer_p
Visibility Buffer WARNING: The attach mechanism only works with pointers or referenced variables...
virtual bool nextBuffer()
std::vector< string > getSelectedCorrelationStrings()
std::map< casacore::Double, std::vector< casacore::uInt > >::iterator subIntegrationMapIterator
virtual bool flushFlags()
std::map< std::pair< casacore::Int, casacore::Int >, string > Ant1Ant2ToBaseline_p
casacore::uInt64 chunkCounts_p
virtual void generatePolarizationsMap()
casacore::Double timeAverageBin_p
casacore::Bool getPrivateFlagRow(casacore::uInt row)
This class encapsulates an enum with values corresponding to the various data components accessible v...
subIntegrationMap * subIntegrationMap_p
casacore::Bool enableChanAvg_p
bool anySelection_p
casacore::Data Selection ranges
casacore::Complex circular_lr(casacore::uInt pol, casacore::uInt chan)
casacore::Complex circular_rr(casacore::uInt pol, casacore::uInt chan)
polarizationIndexMap * polarizationIndexMap_p
void shape(casacore::Int &pol, casacore::Int &chan, casacore::Int &row) const
void applyFlagRow(casacore::uInt row)
casacore::ScalarMeasColumn< casacore::MPosition > * antennaPositions_p
T & accessMapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
casacore::String polarizationSelection_p
void setParentCubes(CubeView< casacore::Bool > *commonFlagsView, CubeView< casacore::Bool > *originalFlagsView, CubeView< casacore::Bool > *privateFlagsView=NULL)
casacore::String tablename_p
Measurement set section.
std::map< string, std::pair< casacore::Int, casacore::Int > > baselineToAnt1Ant2_p
T & accessUnmapped(casacore::uInt i1)
casacore::Complex stokes_q(casacore::uInt pol, casacore::uInt chan)
void applyCommonFlagRow(casacore::uInt row)
Apply flags to common flag rows.
casacore::Complex stokes_u_from_linear(casacore::uInt chan, casacore::uInt row)
void applyFlag(casacore::uInt chan, casacore::uInt row)
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
polarizationMap * polMap_p
casacore::Bool getOriginalFlags(casacore::uInt chan, casacore::uInt row)
virtual void generateAntennaPointingMap()
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.
casacore::Complex stokes_v(casacore::uInt pol, casacore::uInt chan)
casacore::uInt64 msCounts_p