casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SingleDishMS.h
Go to the documentation of this file.
1 //# SingleDishMS.h: this defines a class that handles single dish MSes
2 //#
3 //# Copyright (C) 2014,2015
4 //# National Astronomical Observatory of Japan
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //# $Id$
28 #ifndef _CASA_SINGLEDISH_MS_H_
29 #define _CASA_SINGLEDISH_MS_H_
30 
31 #include <iostream>
32 #include <string>
33 
34 #include <casa/aipstype.h>
35 #include <casa/Containers/Record.h>
36 #include <libsakura/sakura.h>
38 #include <msvis/MSVis/VisBuffer2.h>
41 
42 #define SinusoidWaveNumber_kUpperLimit -999
43 
44 namespace casa { //# NAMESPACE CASA - BEGIN
45 
46 class SingleDishMS {
47 public:
48  // Default constructor
49  SingleDishMS();
50  // Construct from casacore::MS name string
51  SingleDishMS(string const& ms_name);
52 
53  // Destructor
54  ~SingleDishMS();
55 
56  /*
57  * Return the name of the MeasurementSet
58  */
59  string name() const {
60  return msname_;
61  }
62 
63  bool close();
64 
65  /*
66  * Formats selection parameters for single dish processing.
67  * @param [in] selection A casacore::Record consists of selection key and values
68  * @param [in] verbose If true, print summary of selection logger
69  */
70  void setSelection(casacore::Record const& selection, bool const verbose = true);
71 
72  /*
73  * Set time averaging parameters.
74  */
75  void setAverage(casacore::Record const& average, bool const verbose = true);
76 
77  /*
78  * Set polarization averaging parameters.
79  */
80  void setPolAverage(casacore::Record const& average, bool const verbose = true);
81 
82  // Invoke baseline subtraction
83  // (polynomial, write results in new casacore::MS)
84  void subtractBaseline(string const& in_column_name,
85  string const& out_ms_name,
86  string const& out_bloutput_name,
87  bool const& do_subtract,
88  string const& in_spw,
89  string const& blfunc,
90  int const order,
91  float const clip_threshold_sigma,
92  int const num_fitting_max,
93  bool const linefinding,
94  float const threshold,
95  int const avg_limit,
96  int const minwidth,
97  std::vector<int> const& edge);
98 
99  //Cubicspline
100  void subtractBaselineCspline(string const& in_column_name,
101  string const& out_ms_name,
102  string const& out_bloutput_name,
103  bool const& do_subtract,
104  string const& in_spw,
105  int const npiece,
106  float const clip_threshold_sigma,
107  int const num_fitting_max,
108  bool const linefinding,
109  float const threshold,
110  int const avg_limit,
111  int const minwidth,
112  std::vector<int> const& edge);
113 
114  //Sinusoid
115  void subtractBaselineSinusoid(string const& in_column_name,
116  string const& out_ms_name,
117  string const& out_bloutput_name,
118  bool const& do_subtract,
119  string const& in_spw,
120  string const& addwn0,
121  string const& rejwn0,
122  bool const applyfft,
123  string const fftmethod,
124  string const fftthresh,
125  float const clip_threshold_sigma,
126  int const num_fitting_max,
127  bool const linefinding,
128  float const threshold,
129  int const avg_limit,
130  int const minwidth,
131  std::vector<int> const& edge);
132 
133  // variable fitting parameters stored in a text file
134  void subtractBaselineVariable(string const& in_column_name,
135  string const& out_ms_name,
136  string const& out_bloutput_name,
137  bool const& do_subtract,
138  string const& in_spw,
139  string const& param_file,
140  bool const& verbose = true);
141 
142  // apply baseline table
143  void applyBaselineTable(string const& in_column_name,
144  string const& in_bltable_name, string const& in_spw,
145  string const& out_ms_name);
146 
147  // fit line profile
148  void fitLine(string const& in_column_name, string const& in_spw,
149  string const& in_pol, string const& fitfunc, string const& in_nfit,
150  bool const linefinding, float const threshold, int const avg_limit,
151  int const minwidth, std::vector<int> const& edge,
152  string const& tempfile_name, string const& temp_out_ms_name);
153 
154  // smooth data with arbitrary smoothing kernel
155  // smoothing kernels currently supported include gaussian and boxcar
156  void smooth(string const &kernelType, float const kernelWidth,
157  string const &columnName, string const&outMsName);
158 
159 private:
163  /*
164  * Initializes member variables: in_column_
165  */
166  void initialize();
167  /*
168  * Formats selection parameters for single dish processing.
169  * @param [in] selection A casacore::Record consists of selection key and values
170  */
171  void format_selection(casacore::Record &selection);
172 
173  // retrieve a field by name from casacore::Record as casa::String.
175  string const &field_name);
176 
177  bool prepare_for_process(string const &in_column_name,
178  string const&out_ms_name);
179 
180  bool prepare_for_process(string const &in_column_name,
181  string const&out_ms_name, casacore::Block<casacore::Int> const &sortColumns,
182  bool const addDefaultSortCols = false);
183  void finalize_process();
184 
185  // check column 'in' is in input casacore::MS and set to 'out' if it exists.
186  // if not, out is set to casacore::MS::UNDEFINED_COLUMN
189  // Convert a casacore::Complex casacore::Array to casacore::Float Array
191  // Split a string with given delimiter
192  std::vector<string> split_string(string const &s, char delim);
193  // examine if a file with specified name exists
194  bool file_exists(string const &filename);
195  /* Convert spw selection string to vectors of spwid and channel
196  ranges by parsing msseltoindex output. Also creates some
197  placeholder vectors to store mask and the muber of channels
198  in each selected SPW.
199  [in] in_spw: input SPW selection string
200  [out] spw : a vector of selected SPW IDs. the number of
201  elements is the number of selected SPWs
202  [out] chan : a vector of selected SPW IDs and channel ranges
203  returned by msseltoindex. [[SPWID, start, end, stride], ...]
204  [out] nchan : a vector of length spw.size() initialized by zero
205  [out] mask : an uninitialized vector of length spw.size()
206  [out] nchan_set: a vector of length spw.size() initilazed by false
207  */
208  void parse_spw(string const &in_spw, casacore::Vector<casacore::Int> &spw, casacore::Matrix<casacore::Int> &chan,
210  casacore::Vector<bool> &nchan_set);
211  /* Go through chunk and set valudes to nchan and mask selection
212  vectors of the SPW if not already done.
213  [in] rec_spw: a vector of selected SPW IDs. the number of
214  elements is the number of selected SPWs
215  [in] data_spw: a vector of SPW IDs in current chunk. the
216  number of elements is equals to the number
217  of rows in the chunk.
218  [in] rec_chan: a vector of selected SPW IDs and channel ranges
219  returned by msseltoindex. [[SPWID, start, end, stride], ...]
220  [in] num_chan: a vector of the number of channels in current chunk.
221  the number of elements is equals to the number
222  of rows in the chunk.
223  [out] nchan: a vector of length spw.size(). the number of channels
224  in the corresponding SPW is set when the loop traverses
225  the SPW for the first time.
226  [out] mask: a vector of length spw.size().
227  [in,out] nchan_set: a boolean vector of length spw.size().
228  the value indicates if nchan, and mask of
229  the corresponding SPW is already set.
230  [out] new_nchan: returns true if this is the first time finding
231  SPWs with the same number of channels.
232  */
234  casacore::Vector<casacore::Int> const &data_spw, casacore::Matrix<casacore::Int> const &rec_chan,
236  casacore::Vector<bool> &nchan_set, bool &new_nchan);
239  void get_masklist_from_mask(size_t const num_chan, bool const *mask,
241  // Create a set of baseline contexts (if necessary)
242  void get_baseline_context(size_t const bltype,
243  uint16_t order,
244  size_t num_chan,
245  casacore::Vector<size_t> const &nchan,
246  casacore::Vector<bool> const &nchan_set,
247  casacore::Vector<size_t> &ctx_indices,
248  std::vector<LIBSAKURA_SYMBOL(LSQFitContextFloat) *> &bl_contexts);
249  void get_baseline_context(size_t const bltype,
250  uint16_t order,
251  size_t num_chan,
252  size_t ispw,
253  casacore::Vector<size_t> &ctx_indices,
254  std::vector<size_t> &ctx_nchans,
255  std::vector<LIBSAKURA_SYMBOL(LSQFitContextFloat) *> &bl_contexts);
256  // Destroy a set of baseline contexts
257  void destroy_baseline_contexts(std::vector<LIBSAKURA_SYMBOL(LSQFitContextFloat) *> &bl_contexts);
258  void check_sakura_status(string const &name, LIBSAKURA_SYMBOL(Status) const status);
259  void check_baseline_status(LIBSAKURA_SYMBOL(LSQFitStatus) const bl_status);
260  template<typename T, typename U>
261  void set_matrix_for_bltable(size_t const num_pol, size_t const num_data_max,
262  std::vector<std::vector<T> > const &in_data, casacore::Array<U> &out_data) {
263  for (size_t ipol = 0; ipol < num_pol; ++ipol) {
264  for (size_t i = 0; i < num_data_max; ++i) {
265  out_data[i][ipol] = static_cast<U>(0);
266  }
267  size_t num_data = in_data[ipol].size();
268  for (size_t i = 0; i < num_data; ++i) {
269  out_data[i][ipol] = static_cast<U>(in_data[ipol][i]);
270  }
271  }
272  }
273  template<typename T, typename U>
274  void set_array_for_bltable(size_t const ipol, size_t const num_data,
275  T const *in_data, casacore::Array<U> &out_data) {
276  for (size_t i = 0; i < num_data; ++i) {
277  out_data[i][ipol] = static_cast<U>(in_data[i]);
278  }
279  }
280  size_t get_num_coeff_bloutput(size_t const bltype,
281  size_t order,
282  size_t &num_coeff_max);
283  std::vector<int> string_to_list(string const &wn_str, char const delim);
284  void get_effective_nwave(std::vector<int> const &addwn,
285  std::vector<int> const &rejwn,
286  int const wn_ulimit,
287  std::vector<int> &effwn);
288  void finalise_effective_nwave(std::vector<int> const &blparam_eff_base,
289  std::vector<int> const &blparam_exclude,
290  int const &blparam_upperlimit,
291  size_t const &num_chan,
292  float const *spec, bool const *mask,
293  bool const &applyfft,
294  string const &fftmethod, string const &fftthresh,
295  std::vector<size_t> &blparam_eff);
296  void parse_fftthresh(string const& fftthresh_str,
297  string& fftthresh_attr,
298  float& fftthresh_sigma,
299  int& fftthresh_top);
300  void select_wavenumbers_via_fft(size_t const num_chan,
301  float const *spec,
302  bool const *mask,
303  string const &fftmethod,
304  string const &fftthresh_attr,
305  float const fftthresh_sigma,
306  int const fftthresh_top,
307  int const blparam_upperlimit,
308  std::vector<int> &blparam_fft);
309  void exec_fft(size_t const num_chan,
310  float const *in_spec,
311  bool const *in_mask,
312  bool const get_real_imag,
313  bool const get_ampl_only,
314  std::vector<float> &fourier_spec);
315  void interpolate_constant(int const num_chan,
316  float const *in_spec,
317  bool const *in_mask,
319  void merge_wavenumbers(std::vector<int> const &blparam_eff_base,
320  std::vector<int> const &blparam_fft,
321  std::vector<int> const &blparam_exclude,
322  std::vector<size_t> &blparam_eff);
323 
324  list<pair<size_t, size_t>> findLineAndGetRanges(size_t const num_data,
325  float const data[/*num_data*/],
326  bool mask[/*num_data*/], float const threshold,
327  int const avg_limit, int const minwidth, std::vector<int> const& edge,
328  bool const invert);
329 
330  void findLineAndGetMask(size_t const num_data, float const data[/*num_data*/],
331  bool const in_mask[/*num_data*/], float const threshold,
332  int const avg_limit, int const minwidth, std::vector<int> const& edge,
333  bool const invert, bool out_mask[/*num_data*/]);
334 
335  template<typename Func0, typename Func1, typename Func2, typename Func3>
336  void doSubtractBaseline(string const& in_column_name,
337  string const& out_ms_name,
338  string const& out_bloutput_name,
339  bool const& do_subtract,
340  string const& in_spw,
341  LIBSAKURA_SYMBOL(Status)& status,
342  std::vector<LIBSAKURA_SYMBOL(LSQFitContextFloat) *> &bl_contexts,
343  size_t const bltype,
344  std::vector<int> const& blparam,
345  std::vector<int> const& blparam_exclude,
346  bool const& applyfft,
347  string const& fftmethod,
348  string const& fftthresh,
349  float const clip_threshold_sigma,
350  int const num_fitting_max,
351  bool const linefinding,
352  float const threshold,
353  int const avg_limit,
354  int const minwidth,
355  std::vector<int> const& edge,
356  Func0 func0,
357  Func1 func1,
358  Func2 func2,
359  Func3 func3,
360  casacore::LogIO os);
361 
365  // retrieve a spectrum at the row and plane (polarization) from data cube
366  void get_spectrum_from_cube(casacore::Cube<casacore::Float> &data_cube, size_t const row,
367  size_t const plane, size_t const num_data,
368  float out_data[/*num_data*/]);
369  // set a spectrum at the row and plane (polarization) to data cube
370  void set_spectrum_to_cube(casacore::Cube<casacore::Float> &data_cube, size_t const row,
371  size_t const plane, size_t const num_data, float in_data[/*num_data*/]);
372  // get data cube (npol*nchan*nvirow) in in_column_ from visbuffer
373  // and convert it to float cube
375  // get flag cube (npol*nchan*nvirow) from visbuffer
376  void get_flag_cube(vi::VisBuffer2 const &vb, casacore::Cube<casacore::Bool> &flag_cube);
377  // retrieve a flag at the row and plane (polarization) from flag cube
378  void get_flag_from_cube(casacore::Cube<casacore::Bool> &flag_cube, size_t const row,
379  size_t const plane, size_t const num_flag,
380  bool out_flag[/*num_flag*/]);
381  // set a flag at the row and plane (polarization) to flag cube
382  void set_flag_to_cube(casacore::Cube<casacore::Bool> &flag_cube, size_t const row,
383  size_t const plane, size_t const num_flag, bool in_flag[/*num_data*/]);
384 
385  // flag all channels in a supectrum in cube at the row and plane (polarization)
386  void flag_spectrum_in_cube(casacore::Cube<casacore::Bool> &flag_cube, size_t const row,
387  size_t const plane);
388 
389  // return true if all channels are flagged
390  bool allchannels_flagged(size_t const num_flag, bool const* flag);
391  // returns the number of channels with true in input mask
392  size_t NValidMask(size_t const num_mask, bool const* mask);
393 
397 
401  // the name of input MS
402  string msname_;
403  // columns to read and save data
405  // casacore::Record of selection
407  // casacore::Record of average
409  // Record of polarization average
411  // SDMSManager
413  // pointer to accessor function
415  // smoothing flag
417 
421 
422  //split the name
423  void split_bloutputname(string str);
424 
425  //max number of rows to get in each iteration
426  constexpr static casacore::Int kNRowBlocking = 1000;
427 
428 public:
429  static bool importAsap(string const &infile, string const &outfile, bool const parallel=false);
430  static bool importNRO(string const &infile, string const &outfile, bool const parallel=false);
431 };
432 // class SingleDishMS -END
433 
434 } //# NAMESPACE CASA - END
435 
436 #endif /* _CASA_SINGLEDISH_MS_H_ */
casacore::MSMainEnums::PredefinedColumns in_column_
columns to read and save data
Definition: SingleDishMS.h:404
casacore::Record pol_average_
Record of polarization average.
Definition: SingleDishMS.h:410
void initialize()
Utility functions ///.
int Int
Definition: aipstype.h:50
static constexpr casacore::Int kNRowBlocking
max number of rows to get in each iteration
Definition: SingleDishMS.h:426
void subtractBaselineVariable(string const &in_column_name, string const &out_ms_name, string const &out_bloutput_name, bool const &do_subtract, string const &in_spw, string const &param_file, bool const &verbose=true)
variable fitting parameters stored in a text file
void get_baseline_context(size_t const bltype, uint16_t order, size_t num_chan, casacore::Vector< size_t > const &nchan, casacore::Vector< bool > const &nchan_set, casacore::Vector< size_t > &ctx_indices, std::vector< LIBSAKURA_SYMBOL(LSQFitContextFloat)* > &bl_contexts)
Create a set of baseline contexts (if necessary)
std::vector< int > string_to_list(string const &wn_str, char const delim)
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
void get_mask_from_rec(casacore::Int spwid, casacore::Matrix< casacore::Int > const &rec_chan, casacore::Vector< casacore::Bool > &mask, bool initialize=true)
static bool importAsap(string const &infile, string const &outfile, bool const parallel=false)
void get_flag_from_cube(casacore::Cube< casacore::Bool > &flag_cube, size_t const row, size_t const plane, size_t const num_flag, bool out_flag[])
retrieve a flag at the row and plane (polarization) from flag cube
void get_effective_nwave(std::vector< int > const &addwn, std::vector< int > const &rejwn, int const wn_ulimit, std::vector< int > &effwn)
void get_nchan_and_mask(casacore::Vector< casacore::Int > const &rec_spw, casacore::Vector< casacore::Int > const &data_spw, casacore::Matrix< casacore::Int > const &rec_chan, size_t const num_chan, casacore::Vector< size_t > &nchan, casacore::Vector< casacore::Vector< casacore::Bool > > &mask, casacore::Vector< bool > &nchan_set, bool &new_nchan)
void smooth(string const &kernelType, float const kernelWidth, string const &columnName, string const &outMsName)
smooth data with arbitrary smoothing kernel smoothing kernels currently supported include gaussian an...
void convertArrayC2F(casacore::Array< casacore::Float > &from, casacore::Array< casacore::Complex > const &to)
Convert a casacore::Complex casacore::Array to casacore::Float Array.
void subtractBaseline(string const &in_column_name, string const &out_ms_name, string const &out_bloutput_name, bool const &do_subtract, string const &in_spw, string const &blfunc, int const order, float const clip_threshold_sigma, int const num_fitting_max, bool const linefinding, float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge)
Invoke baseline subtraction (polynomial, write results in new casacore::MS)
ostream-like interface to creating log messages.
Definition: LogIO.h:167
void get_data_cube_float(vi::VisBuffer2 const &vb, casacore::Cube< casacore::Float > &data_cube)
get data cube (npol*nchan*nvirow) in in_column_ from visbuffer and convert it to float cube ...
PredefinedColumns
The Main table colums with predefined meaning.
Definition: MSMainEnums.h:65
void applyBaselineTable(string const &in_column_name, string const &in_bltable_name, string const &in_spw, string const &out_ms_name)
apply baseline table
void subtractBaselineSinusoid(string const &in_column_name, string const &out_ms_name, string const &out_bloutput_name, bool const &do_subtract, string const &in_spw, string const &addwn0, string const &rejwn0, bool const applyfft, string const fftmethod, string const fftthresh, float const clip_threshold_sigma, int const num_fitting_max, bool const linefinding, float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge)
Sinusoid.
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Definition: PlotData.h:48
bool allchannels_flagged(size_t const num_flag, bool const *flag)
return true if all channels are flagged
void parse_fftthresh(string const &fftthresh_str, string &fftthresh_attr, float &fftthresh_sigma, int &fftthresh_top)
~SingleDishMS()
Destructor.
size_t get_num_coeff_bloutput(size_t const bltype, size_t order, size_t &num_coeff_max)
casacore::Record selection_
casacore::Record of selection
Definition: SingleDishMS.h:406
static bool importNRO(string const &infile, string const &outfile, bool const parallel=false)
void interpolate_constant(int const num_chan, float const *in_spec, bool const *in_mask, casacore::Vector< casacore::Float > &spec)
void fitLine(string const &in_column_name, string const &in_spw, string const &in_pol, string const &fitfunc, string const &in_nfit, bool const linefinding, float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge, string const &tempfile_name, string const &temp_out_ms_name)
fit line profile
void destroy_baseline_contexts(std::vector< LIBSAKURA_SYMBOL(LSQFitContextFloat)* > &bl_contexts)
Destroy a set of baseline contexts.
casacore::Bool doSmoothing_
smoothing flag
Definition: SingleDishMS.h:416
void exec_fft(size_t const num_chan, float const *in_spec, bool const *in_mask, bool const get_real_imag, bool const get_ampl_only, std::vector< float > &fourier_spec)
void set_flag_to_cube(casacore::Cube< casacore::Bool > &flag_cube, size_t const row, size_t const plane, size_t const num_flag, bool in_flag[])
set a flag at the row and plane (polarization) to flag cube
casacore::Record average_
casacore::Record of average
Definition: SingleDishMS.h:408
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
TableExprNode cube(const TableExprNode &node)
Definition: ExprNode.h:1308
SingleDishMS()
Default constructor.
void set_matrix_for_bltable(size_t const num_pol, size_t const num_data_max, std::vector< std::vector< T > > const &in_data, casacore::Array< U > &out_data)
Definition: SingleDishMS.h:261
std::vector< string > split_string(string const &s, char delim)
Split a string with given delimiter.
void setPolAverage(casacore::Record const &average, bool const verbose=true)
list< pair< size_t, size_t > > findLineAndGetRanges(size_t const num_data, float const data[], bool mask[], float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge, bool const invert)
string name() const
Definition: SingleDishMS.h:59
void split_bloutputname(string str)
split the name
void finalise_effective_nwave(std::vector< int > const &blparam_eff_base, std::vector< int > const &blparam_exclude, int const &blparam_upperlimit, size_t const &num_chan, float const *spec, bool const *mask, bool const &applyfft, string const &fftmethod, string const &fftthresh, std::vector< size_t > &blparam_eff)
casacore::String get_field_as_casa_string(casacore::Record const &in_data, string const &field_name)
retrieve a field by name from casacore::Record as casa::String.
void format_selection(casacore::Record &selection)
void findLineAndGetMask(size_t const num_data, float const data[], bool const in_mask[], float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge, bool const invert, bool out_mask[])
void parse_spw(string const &in_spw, casacore::Vector< casacore::Int > &spw, casacore::Matrix< casacore::Int > &chan, casacore::Vector< size_t > &nchan, casacore::Vector< casacore::Vector< casacore::Bool > > &mask, casacore::Vector< bool > &nchan_set)
void set_array_for_bltable(size_t const ipol, size_t const num_data, T const *in_data, casacore::Array< U > &out_data)
Definition: SingleDishMS.h:274
void doSubtractBaseline(string const &in_column_name, string const &out_ms_name, string const &out_bloutput_name, bool const &do_subtract, string const &in_spw, LIBSAKURA_SYMBOL(Status)&status, std::vector< LIBSAKURA_SYMBOL(LSQFitContextFloat)* > &bl_contexts, size_t const bltype, std::vector< int > const &blparam, std::vector< int > const &blparam_exclude, bool const &applyfft, string const &fftmethod, string const &fftthresh, float const clip_threshold_sigma, int const num_fitting_max, bool const linefinding, float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge, Func0 func0, Func1 func1, Func2 func2, Func3 func3, casacore::LogIO os)
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
void select_wavenumbers_via_fft(size_t const num_chan, float const *spec, bool const *mask, string const &fftmethod, string const &fftthresh_attr, float const fftthresh_sigma, int const fftthresh_top, int const blparam_upperlimit, std::vector< int > &blparam_fft)
void(* visCubeAccessor_)(vi::VisBuffer2 const &vb, casacore::Cube< casacore::Float > &cube)
pointer to accessor function
Definition: SingleDishMS.h:414
the name of input MS *string msname_
casacore::Array execution functions ///
Definition: SingleDishMS.h:402
void merge_wavenumbers(std::vector< int > const &blparam_eff_base, std::vector< int > const &blparam_fft, std::vector< int > const &blparam_exclude, std::vector< size_t > &blparam_eff)
void get_flag_cube(vi::VisBuffer2 const &vb, casacore::Cube< casacore::Bool > &flag_cube)
get flag cube (npol*nchan*nvirow) from visbuffer
bool set_column(casacore::MSMainEnums::PredefinedColumns const &in, casacore::MSMainEnums::PredefinedColumns &out)
check column &#39;in&#39; is in input casacore::MS and set to &#39;out&#39; if it exists.
void get_masklist_from_mask(size_t const num_chan, bool const *mask, casacore::Vector< casacore::uInt > &masklist)
void check_baseline_status(LIBSAKURA_SYMBOL(LSQFitStatus) const bl_status)
size_t NValidMask(size_t const num_mask, bool const *mask)
returns the number of channels with true in input mask
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void setAverage(casacore::Record const &average, bool const verbose=true)
void subtractBaselineCspline(string const &in_column_name, string const &out_ms_name, string const &out_bloutput_name, bool const &do_subtract, string const &in_spw, int const npiece, float const clip_threshold_sigma, int const num_fitting_max, bool const linefinding, float const threshold, int const avg_limit, int const minwidth, std::vector< int > const &edge)
Cubicspline.
void setSelection(casacore::Record const &selection, bool const verbose=true)
size_t size() const
Definition: ArrayBase.h:101
void check_sakura_status(string const &name, LIBSAKURA_SYMBOL(Status) const status)
void flag_spectrum_in_cube(casacore::Cube< casacore::Bool > &flag_cube, size_t const row, size_t const plane)
flag all channels in a supectrum in cube at the row and plane (polarization)
SDMSManager * sdh_
SDMSManager.
Definition: SingleDishMS.h:412
bool prepare_for_process(string const &in_column_name, string const &out_ms_name)
bool file_exists(string const &filename)
examine if a file with specified name exists