29 #ifndef MS_MSSELECTOR_H
30 #define MS_MSSELECTOR_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Arrays/Vector.h>
34 #include <casacore/casa/Arrays/Slice.h>
35 #include <casacore/casa/Arrays/Slicer.h>
36 #include <casacore/ms/MeasurementSets/MeasurementSet.h>
37 #include <casacore/ms/MeasurementSets/StokesConverter.h>
38 #include <casacore/ms/MSOper/MSDerivedValues.h>
39 #include <casacore/ms/MSSel/MSSelectionKeywords.h>
43 template <
class T>
class ArrayColumn;
194 Int ifrAxisGap=0,
Int inc=1,
246 const Slicer & rowSlicer)
const;
251 const Slicer & rowSlicer)
const;
261 const Slicer& rowSlicer)
const;
An iterator class for MeasurementSets.
void reorderFlagRow(Array< Bool > &flagRow)
reorder from 2d to 1d (removing ifr axis)
void getAveragedData(Array< Complex > &avData, const Array< Bool > &flag, const ArrayColumn< Complex > &col) const
average and convert data
Array< Bool > getAveragedFlag(Array< Bool > &avFlag, const ArrayColumn< Bool > &col) const
"average" flag, at present all output which has a flagged input is flagged
rownr_t nrow() const
Number of rows in selected table.
Matrix< Double > bandwidth_p
MSSelector & operator=(const MSSelector &other)
Assignment, this will initialize the MS with other's MS.
Bool checkSelection()
check if the data description selection has been done & do default selection if not.
void getAveragedData(Array< Complex > &avData, const Array< Bool > &flag, const ArrayColumn< Complex > &col, const Slicer &rowSlicer) const
average and convert data, with row Slicer
void timeAverage(Array< Bool > &dataFlags, Array< Complex > &data, const Array< Bool > &flags, const Array< Float > &weights)
time average the input data, return new flags
Array< Float > getWeight(const ArrayColumn< Float > &wtCol, Bool sigma=False) const
get the weight, set sigma=True when retrieving sigma's
Bool putData(const Record &items)
Put the data for the items provided.
Vector< Int > ifrSelection_p
Vector< String > polSelection_p
Bool selectChannel(Int nChan, Int start, Int width, Int incr)
Set the mapping from input channels in the DATA column to output channels.
Vector< Int > dataDescId() const
Return the data desc IDs selected
void makeSlicer(Int start, Int nCorr) const
make the data slicer, pass in the first and the number of correlations to select
void reorderWeight(Array< Float > &weight)
reorder from 2d to 1d (removing ifr axis)
Bool iterNext()
Step the iterator, sets the selection to the current table iteration.
Bool selected() const
Return the selection status of the table.
Record getData(const Vector< String > &items, Bool ifrAxis, Int ifrAxisGap=0, Int inc=1, Bool average=False, Bool oneBased=False)
Return the data for the items requested, all returned values will be arrays, the last dimension of th...
Bool iterOrigin()
(Re)Set the iterator to the first iteration, call this after iterInit.
void getAveragedData(Array< Float > &avData, const Array< Bool > &flag, const ArrayColumn< Float > &col, const Slicer &rowSlicer) const
average and convert float data, with row Slicer
Bool select(const String &msSelect)
Select the MS based on the TaQL selection string.
Bool selectPolarization(const Vector< String > &wantedPol)
Specify the output polarization.
Bool iterInit(const Vector< String > &columns, Double interval, rownr_t maxRows=0, Bool addDefaultSortColumns=True)
Set up an iterator, iterating over the specified columns, with optional time interval and maximum num...
void putAveragedFlag(const Array< Bool > &avFlag, ArrayColumn< Bool > &col)
"unaverage" flag, distribute the flags back to the channels that went into the average
Vector< Int > dataDescId_p
Vector< Int > lastDataDescId_p
void setMS(MeasurementSet &ms)
Change or Set the MS this MSSelector refers to.
StokesConverter stokesConverter_p
Array< Bool > getAveragedFlag(Array< Bool > &avFlag, const ArrayColumn< Bool > &col, const Slicer &rowSlicer) const
"average" flag, at present all output which has a flagged input is flagged, with row Slicer
MSSelector(MeasurementSet &ms)
construct from an MS, the MS will supply the range of the various parameters that can be selected on.
Matrix< Int64 > rowIndex_p
MSSelector(const MSSelector &other)
Copy constructor, this will initialize the MS with other's MS.
void getAveragedData(Array< Float > &avData, const Array< Bool > &flag, const ArrayColumn< Float > &col) const
average and convert float data
Matrix< Double > chanFreq_p
Bool initSelection(const Vector< Int > &dataDescIds, Bool reset=False)
initialize the selection by specifying, optionally, the DATA_DESC_IDs.
Bool select(const Record &items, Bool oneBased=False)
Select the MS based on the selections present in the input record.
Table selectedTable() const
Return the selected table.
Bool iterEnd()
End the iteration (before reaching the last iteration) and set the selection back to the state before...
Bool initSelection(Bool reset=False)
As above without the data desc id argument.
String: the storage and methods of handling collections of characters.
rownr_t nrow() const
Get the number of rows.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
uInt64 rownr_t
Define the type of a row number in a table.