casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StatWt.h
Go to the documentation of this file.
1 //# StatWt.h: Class which implements statistical reweighting
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 STATWT_H_
24 #define STATWT_H_
25 
28 
30 
31 #include <memory>
32 
33 namespace casacore {
34  class LogIO;
35  class MeasurementSet;
36 }
37 
38 namespace casa {
39 
40 class StatWtColConfig;
41 
42 namespace vi {
43  class StatWtTVILayerFactory;
44  class VisibilityIterator2;
45 }
46 
47 // This class implements reweighting of visibilities based on the statwt
48 // algorithm.
49 
50 class StatWt {
51 
52 public:
53 
54  StatWt(
56  const StatWtColConfig* const statwtColConfig
57  );
58 
59  ~StatWt();
60 
61  // set columns for which to ignore changes when aggregating data
62  void setCombine(const casacore::String& combine);
63 
64  void setOutputMS(const casacore::String& outname);
65 
66  // set preview mode (True) or not (False)
67  void setPreview(casacore::Bool preview);
68 
69  void setTimeBinWidth(const casacore::Quantity& binWidth);
70 
71  // binWidth must be in seconds
72  void setTimeBinWidth(casacore::Double binWidth);
73 
74  // set the time bin width using an integral number of integration time.
75  // For this purpose, the integration time is defined as the median value
76  // of the INTERVAL column. If either extrema in this column is more than
77  // 25% different from the median, an exception will be thrown because
78  // there is no single representative value of the integration time.
80 
81  // set the StatWtTVI config record
82  void setTVIConfig(const casacore::Record& config);
83 
85 
86 private:
89  // time bin width in seconds
92  std::unique_ptr<casacore::Int> _chanBinWidthInt = nullptr;
93  std::unique_ptr<casacore::Record> _chanBinWidthQ = nullptr;
98  > _saf;
99  std::unique_ptr<std::pair<casacore::Double, casacore::Double>> _wtrange = nullptr;
103 
104  // Construct the iterator
105  void _constructVi(
106  std::shared_ptr<vi::VisibilityIterator2>& vi,
107  std::shared_ptr<vi::StatWtTVILayerFactory>& factory
108  ) const;
109 
110 };
111 
112 }
113 
114 #endif
115 
void setTimeBinWidth(const casacore::Quantity &binWidth)
casacore::Record _tviConfig
Definition: StatWt.h:100
This class is necessary to ensure partial initialization of SIGMA_SPECTRUM and WEIGHT_SPECTRUM in the...
void _constructVi(std::shared_ptr< vi::VisibilityIterator2 > &vi, std::shared_ptr< vi::StatWtTVILayerFactory > &factory) const
Construct the iterator.
This class implements reweighting of visibilities based on the statwt algorithm.
Definition: StatWt.h:50
ostream-like interface to creating log messages.
Definition: LogIO.h:167
casacore::LogIO _log
Definition: StatWt.h:91
casacore::Record writeWeights()
casacore::String _outname
Definition: StatWt.h:88
void setTimeBinWidthUsingInterval(casacore::uInt n)
set the time bin width using an integral number of integration time.
std::unique_ptr< std::pair< casacore::Double, casacore::Double > > _wtrange
Definition: StatWt.h:99
casacore::StatisticsAlgorithmFactory< casacore::Double, casacore::Array< casacore::Float >::const_iterator, casacore::Array< casacore::Bool >::const_iterator > _saf
Definition: StatWt.h:98
double Double
Definition: aipstype.h:55
StatWt(casacore::MeasurementSet *ms, const StatWtColConfig *const statwtColConfig)
std::unique_ptr< casacore::Int > _chanBinWidthInt
Definition: StatWt.h:92
casacore::Bool _preview
Definition: StatWt.h:101
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
Provides a single interface for creation of stats algorithm objects.
std::unique_ptr< casacore::Record > _chanBinWidthQ
Definition: StatWt.h:93
A Table intended to hold astronomical data (a set of Measurements).
casacore::Double _timeBinWidth
time bin width in seconds
Definition: StatWt.h:90
void setPreview(casacore::Bool preview)
set preview mode (True) or not (False)
casacore::String _combine
Definition: StatWt.h:94
void setTVIConfig(const casacore::Record &config)
set the StatWtTVI config record
void setOutputMS(const casacore::String &outname)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void setCombine(const casacore::String &combine)
set columns for which to ignore changes when aggregating data
casacore::MeasurementSet * _ms
Definition: StatWt.h:87
const StatWtColConfig * _statwtColConfig
Definition: StatWt.h:102
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42