casa
5.7.0-16
|
#include <VisChunkAverager.h>
Public Member Functions | |
VisChunkAverager (const casacore::Vector< casacore::MS::PredefinedColumns > &dataCols, const casacore::Bool doSpWeight, const casacore::Vector< casacore::Matrix< casacore::Int > > &chBounds=casacore::Vector< casacore::Matrix< casacore::Int > >()) | |
Construct from which *DATA column(s) to read and whether or not to use WEIGHT_SPECTRUM. More... | |
~VisChunkAverager () | |
Null destructor. More... | |
void | reset () |
Reset the averager. More... | |
VisBuffer & | average (ROVisibilityIterator &vi) |
casacore::Time average vi's current chunk, AND advance vi to the end of that chunk. More... | |
casacore::uInt | uIntMax (const casacore::uInt a, const casacore::uInt b) const |
max(a, b) in Math.h is so overloaded, and (u)casacore::Int is so promotable, that they're unusable together. More... | |
Static Public Member Functions | |
static casacore::Bool | check_chunk (ROVisibilityIterator &vi, casacore::Double &time_to_break, const casacore::Bool watch_obs, const casacore::Bool watch_scan, const casacore::Bool watch_state) |
Checks whether the interval of vi needs to be truncated in order to prevent collisions where two rows have the same casacore::MS key (ignoring TIME) but different SCAN_NUMBER, STATE_ID, and/or OBSERVATION_ID. More... | |
Private Member Functions | |
VisChunkAverager () | |
Prohibit null constructor, copy constructor and assignment for now. More... | |
VisChunkAverager & | operator= (const VisChunkAverager &) |
VisChunkAverager (const VisChunkAverager &) | |
void | initialize (VisBuffer &vb) |
Initialize the next accumulation interval. More... | |
void | normalize (const casacore::Double minTime, const casacore::Double maxTime, const casacore::Double firstinterval, const casacore::Double lastinterval) |
Normalize the accumulation (finish the average). More... | |
void | fill_vb (VisBuffer &vb) |
Force vb to read all the columns (modified by colEnums_p and doSpWeight_p). More... | |
casacore::uInt | hashFunction (const casacore::Int ant1, const casacore::Int ant2, const casacore::Int feed1, const casacore::Int feed2, const casacore::Int procid) const |
Hash function to return a unique (within the VisBuffer) key (as defined by the casacore::MS def'n) for an interferometer (ant1, ant2, feed1, feed2, processor_id). More... | |
casacore::Bool | setupHashFunction (ROVisibilityIterator &vi) |
These return their success values. More... | |
casacore::Bool | makeHashMap (ROVisibilityIterator &vi) |
casacore::Bool | findCollision (ROVisibilityIterator &vi, casacore::Double &time_to_break, const casacore::Bool watchObs, const casacore::Bool watchScan, const casacore::Bool watchState) |
Check whether any of the unflagged rows in vi's current chunk have the same casacore::MS key (not counting TIME) but different values for the columns in colsToWatch. More... | |
casacore::Bool | checkForBreak (casacore::Vector< casacore::Int > &firstVals, const casacore::Int i, const casacore::uInt slotnum, const casacore::uInt chunkletNum, const std::vector< casacore::Int > &inrows_for_slot) const |
Helper function for findCollision(). More... | |
Private Attributes | |
casacore::Vector < casacore::MS::PredefinedColumns > | colEnums_p |
Start of initialization list. More... | |
casacore::Bool | doSpWeight_p |
Use WEIGHT_SPECTRUM? More... | |
casacore::Vector < casacore::Matrix < casacore::Int > > | chanAveBounds_p |
Used for both selecting and averaging channels. More... | |
casacore::Bool | readyToHash_p |
End of initialization list. More... | |
casacore::Bool | haveHashMap_p |
Is sphash_to_inprows_p OK? More... | |
casacore::uInt | maxant1p1_p |
Maxima for hashFunction(). More... | |
casacore::uInt | maxant2p1_p |
casacore::uInt | maxfeed1p1_p |
casacore::uInt | maxfeed2p1_p |
mapuIvIType | sphash_to_inprows_p |
casacore::uInt maxprocp1_p; Not needed More... | |
casacore::Int | nCorr_p |
Number of correlations and channels. More... | |
casacore::Int | nChan_p |
casacore::Int | nCat_p |
The number of flag categories. More... | |
CalVisBuffer | avBuf_p |
Averaging buffer. More... | |
Definition at line 89 of file VisChunkAverager.h.
casa::VisChunkAverager::VisChunkAverager | ( | const casacore::Vector< casacore::MS::PredefinedColumns > & | dataCols, |
const casacore::Bool | doSpWeight, | ||
const casacore::Vector< casacore::Matrix< casacore::Int > > & | chBounds = casacore::Vector< casacore::Matrix< casacore::Int > >() |
||
) |
Construct from which *DATA column(s) to read and whether or not to use WEIGHT_SPECTRUM.
casa::VisChunkAverager::~VisChunkAverager | ( | ) |
Null destructor.
|
private |
Prohibit null constructor, copy constructor and assignment for now.
|
private |
VisBuffer& casa::VisChunkAverager::average | ( | ROVisibilityIterator & | vi | ) |
casacore::Time average vi's current chunk, AND advance vi to the end of that chunk.
casacore::Input: vi ROVisibilityIterator vi.setRowBlocking(0) will be called to ensure that ++vi advances by 1 integration at a time. Output from private data: avBuf_p CalVisBuffer Output buffer for the averaged "integration".
|
static |
Checks whether the interval of vi needs to be truncated in order to prevent collisions where two rows have the same casacore::MS key (ignoring TIME) but different SCAN_NUMBER, STATE_ID, and/or OBSERVATION_ID.
ARRAY_ID is already separated by the chunking.
time_to_break is set to the TIME of the earliest collision, or the end of the buffer if none are found.
|
private |
Helper function for findCollision().
|
private |
Force vb to read all the columns (modified by colEnums_p and doSpWeight_p).
Sets readyToHash_p to false.
|
private |
Check whether any of the unflagged rows in vi's current chunk have the same casacore::MS key (not counting TIME) but different values for the columns in colsToWatch.
time_to_break will be set to the time of the earliest collision if any are found, or the last TIME in vi's current chunk otherwise (assumes vi's current chunk is ascendingly sorted in TIME).
colsToWatch should contain casacore::MS::SCAN_NUMBER, casacore::MS::STATE_ID, casacore::MS::OBSERVATION_ID, and/or nothing. Otherwise an casacore::AipsError will be thrown. casacore::MS::ARRAY_ID is already separated by the chunking.
|
private |
Hash function to return a unique (within the VisBuffer) key (as defined by the casacore::MS def'n) for an interferometer (ant1, ant2, feed1, feed2, processor_id).
Note that a VisBuffer only contains one ddid and fieldid, and TIME is deliberately excluded this that is what will be averaged over.
Sorting a set of the returned keys is equivalent to sorting by (procid, ant1, ant2, feed1, feed2).
|
private |
Initialize the next accumulation interval.
|
private |
|
private |
Normalize the accumulation (finish the average).
|
private |
void casa::VisChunkAverager::reset | ( | ) |
Reset the averager.
|
private |
These return their success values.
(They could fail if any of ant1, ant2, feed1, feed2, or procid are < 0, but that shouldn't happen and isn't checked for.)
|
inline |
max(a, b) in Math.h is so overloaded, and (u)casacore::Int is so promotable, that they're unusable together.
Definition at line 130 of file VisChunkAverager.h.
|
private |
Averaging buffer.
Definition at line 233 of file VisChunkAverager.h.
|
private |
Used for both selecting and averaging channels.
Definition at line 199 of file VisChunkAverager.h.
|
private |
Start of initialization list.
Which of DATA, MODEL_DATA, and/or CORRECTED_DATA to use.
Definition at line 193 of file VisChunkAverager.h.
|
private |
Use WEIGHT_SPECTRUM?
Definition at line 196 of file VisChunkAverager.h.
|
private |
Is sphash_to_inprows_p OK?
Definition at line 206 of file VisChunkAverager.h.
|
private |
Maxima for hashFunction().
Definition at line 209 of file VisChunkAverager.h.
|
private |
Definition at line 210 of file VisChunkAverager.h.
|
private |
Definition at line 211 of file VisChunkAverager.h.
|
private |
Definition at line 212 of file VisChunkAverager.h.
|
private |
The number of flag categories.
0 if flagCategory() is invalid.
Definition at line 230 of file VisChunkAverager.h.
|
private |
Definition at line 227 of file VisChunkAverager.h.
|
private |
Number of correlations and channels.
Definition at line 227 of file VisChunkAverager.h.
|
private |
End of initialization list.
Is everything setup for hashFunction()?
Definition at line 203 of file VisChunkAverager.h.
|
private |
casacore::uInt maxprocp1_p; Not needed
A map from a sparse hash of "baseline" to a vector of input row numbers matching that hash.
The hash is calculated by hashFunction().
The vector has an entry, in order, for each chunklet (vb) in vi's current chunk which is either -1 (the chunklet has no row matching the hash) or the row number relative to the starting row in that chunklet's vb.
Definition at line 224 of file VisChunkAverager.h.