casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FlagMSHandler.h
Go to the documentation of this file.
1 //# FlagMSHandler.h: This file contains the interface definition of the FlagMSHandler class.
2 //#
3 //# CASA - Common Astronomy Software Applications (http://casa.nrao.edu/)
4 //# Copyright (C) Associated Universities, Inc. Washington DC, USA 2011, All rights reserved.
5 //# Copyright (C) European Southern Observatory, 2011, All rights reserved.
6 //#
7 //# This library is free software; you can redistribute it and/or
8 //# modify it under the terms of the GNU Lesser General Public
9 //# License as published by the Free software Foundation; either
10 //# version 2.1 of the License, or (at your option) any later version.
11 //#
12 //# This library is distributed in the hope that it will be useful,
13 //# but WITHOUT ANY WARRANTY, without even the implied warranty of
14 //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 //# Lesser General Public License for more details.
16 //#
17 //# You should have received a copy of the GNU Lesser General Public
18 //# License along with this library; if not, write to the Free Software
19 //# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 //# MA 02111-1307 USA
21 //# $Id: $
22 
23 #ifndef FlagMSHandler_H_
24 #define FlagMSHandler_H_
25 
27 
28 namespace casa { //# NAMESPACE CASA - BEGIN
29 
30 namespace vi {
32  class VisIterImpl2LayerFactory;
33 }
34 
35 // Flag casacore::Data Handler class definition
37 {
38 
39 public:
40 
41  // Default constructor
42  // NOTE: casacore::Time interval 0 groups all time steps together in one chunk.
43  FlagMSHandler(string msname, casacore::uShort iterationApproach = SUB_INTEGRATION, casacore::Double timeInterval = 0);
44 
45  // Default destructor
47 
48  // Open Measurement Set
49  bool open();
50 
51  // Close Measurement Set
52  bool close();
53 
54  // Generate selected Measurement Set
55  bool selectData();
56 
57  // Parse casacore::MSSelection expression
59 
60  // Generate Visibility Iterator
61  bool generateIterator();
62 
63  // Move to next chunk
64  bool nextChunk();
65 
66  // Move to next buffer
67  bool nextBuffer();
68 
69  // Write flag cube into MS
70  bool flushFlags();
71 
72  // Provide table name (for flag version)
74 
75  // Check if a given column is available in the MS
76  // (typically for checking existence of CORRECTED_DATA
78 
79  // Signal true when a progress summary has to be printed
80  bool summarySignal();
81 
82  // Get the casacore::MS PROCESSOR sub-table
83  bool processorTable();
84 
85  // Check if SOURCE_MODEL column exists (Virtual MODEL column)
87 
88  // Get a casacore::Float visCube and return a casacore::Complex one
90 
92 
93 private:
94 
95  // Mapping functions
96  virtual void generateScanStartStopMap();
97 
98  // Swap casacore::MS to check what is the maximum RAM memory needed
99  void preSweep();
100 
101  // Apply channel selection for asyn or normal iterator
102  // NOTE: We always have to do this, even if there is no SPW:channel selection
103  void applyChannelSelection(vi::VisIterImpl2LayerFactory *viFactory);
104 
105 
106  // Measurement set section
109 
110  // RO Visibility Iterator
114 
115 };
116 
117 } //# NAMESPACE CASA - END
118 
119 #endif /* FlagMSHandler_H_ */
bool summarySignal()
Signal true when a progress summary has to be printed.
bool checkIfSourceModelColumnExists()
Check if SOURCE_MODEL column exists (Virtual MODEL column)
casacore::String getTableName()
Provide table name (for flag version)
vi::FrequencySelectionUsingChannels * channelSelector_p
A top level class defining the data handling interface for the flagging module.
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
void preSweep()
Swap casacore::MS to check what is the maximum RAM memory needed.
bool checkIfColumnExists(casacore::String column)
Check if a given column is available in the MS (typically for checking existence of CORRECTED_DATA...
FrequencySelectionUsingChannels()
~FlagMSHandler()
Default destructor.
Flag casacore::Data Handler class definition.
Definition: FlagMSHandler.h:36
bool nextChunk()
Move to next chunk.
void applyChannelSelection(vi::VisIterImpl2LayerFactory *viFactory)
Apply channel selection for asyn or normal iterator NOTE: We always have to do this, even if there is no SPW:channel selection.
bool generateIterator()
Generate Visibility Iterator.
FlagMSHandler(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::Cube< casacore::Complex > weight_spectrum_p
Definition: FlagMSHandler.h:91
bool selectData()
Generate selected Measurement Set.
bool nextBuffer()
Move to next buffer.
double Double
Definition: aipstype.h:55
bool flushFlags()
Write flag cube into MS.
MSSelection: Class to represent a selection on an MS.
Definition: MSSelection.h:118
casacore::MeasurementSet * selectedMeasurementSet_p
Measurement set section.
bool parseExpression(casacore::MSSelection &parser)
Parse casacore::MSSelection expression.
vi::VisibilityIterator2 * visibilityIterator_p
casacore::Cube< casacore::Complex > & weightVisCube()
Get a casacore::Float visCube and return a casacore::Complex one.
virtual void generateScanStartStopMap()
Mapping functions.
A Table intended to hold astronomical data (a set of Measurements).
bool close()
Close Measurement Set.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::MeasurementSet * originalMeasurementSet_p
bool open()
Open Measurement Set.
bool processorTable()
Get the casacore::MS PROCESSOR sub-table.
vi::VisibilityIterator2 * preAveragingVI_p
RO Visibility Iterator.
unsigned short uShort
Definition: aipstype.h:49