casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Calibrater.h
Go to the documentation of this file.
1 //# Calibrater.h: High-level calibrator object; controls calibration overall
2 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //#
25 //# $Id: Calibrater.h,v 19.16 2006/02/14 19:46:23 gmoellen Exp $
26 
27 #ifndef SYNTHESIS_CALIBRATER_H
28 #define SYNTHESIS_CALIBRATER_H
29 
30 #include <casa/aips.h>
31 #include <casa/OS/Timer.h>
32 #include <casa/Containers/Record.h>
39 #include <casa/Logging/LogIO.h>
40 #include <casa/Logging/LogSink.h>
42 #include <ms/MSSel/MSSelection.h>
46 
47 
48 namespace casa { //# NAMESPACE CASA - BEGIN
49 
50 // <summary>Controls the solution of calibration components (Jones Matrices)</summary>
51 
52 // Forward declarations
53 class MSMetaInfoForCal;
54 
55 class Calibrater
56 {
57 
58  public:
59  // Default constructor
60  Calibrater();
61 
62 
63  // Simple MS-only ctor
65 
66  // Simple simulated-data Calibrater
68 
69  // Destructor
70  virtual ~Calibrater();
71 
72  // Calibrater factories
73  static Calibrater* factory(casacore::Bool old=true);
74  static Calibrater* factory(casacore::String msname,casacore::Bool old=true);
75 
76  // Set uv-data selection via MSSelection
77  virtual void selectvis(const casacore::String& time="",
78  const casacore::String& spw="",
79  const casacore::String& scan="",
80  const casacore::String& field="",
81  const casacore::String& intent="",
82  const casacore::String& obsIDs="",
83  const casacore::String& baseline="",
84  const casacore::String& uvrange="",
85  const casacore::String& chanmode="none",
86  const casacore::Int& nchan=1,
87  const casacore::Int& start=0,
88  const casacore::Int& step=1,
91  const casacore::String& msSelect="");
92 
93  // Set up to apply calibration (using casacore::MSSelection syntax)
95  const casacore::Double& t,
96  const casacore::String& table,
97  const casacore::String& spw,
98  const casacore::String& field,
99  const casacore::String& interp,
100  const casacore::Bool& calwt,
101  const casacore::Vector<casacore::Int>& spwmap,
102  const casacore::Vector<casacore::Double>& opacity);
103 
104  virtual casacore::Bool setapply (const casacore::String& type,
105  const casacore::Record& applypar);
106 
107  // Set up apply-able calibration via a Cal Library
108  virtual casacore::Bool setcallib(casacore::Record /*callib*/) { throw(casacore::AipsError("Calibrater::setcallib not implemented")); };
111 
112  casacore::Bool setmodel(const casacore::String& modelImage);
114 
115  // Arrange to solve (using casacore::MSSelection syntax)
117  const casacore::String& solint,
118  const casacore::String& table,
119  const casacore::Bool append,
120  const casacore::Double preavg,
121  const casacore::String& apmode="AP",
122  const casacore::Int minblperant=4,
123  const casacore::String& refant="",
124  const casacore::String& refantmode="flex",
125  const casacore::Bool solnorm=false,
126  const casacore::String& normtype="mean",
127  const casacore::Float minsnr=0.0f,
128  const casacore::String& combine="",
129  const casacore::Int fillgaps=0,
130  const casacore::String& cfcache="",
131  const casacore::Double painc=360.0,
132  const casacore::Int fitorder=0,
133  const casacore::Float fraction=0.1,
134  const casacore::Int numedge=-1,
135  const casacore::String& radius="",
136  const casacore::Bool smooth=true,
137  const casacore::Bool zerorates=false,
138  const casacore::Bool globalsolve=true,
139  const casacore::Int niter=100,
142  const casacore::String& solmode="",
144 );
145 
146  // Arrange to solve for BPOLY (using casacore::MSSelection syntax)
148  const casacore::Bool& append,
149  const casacore::String& solint,
150  const casacore::String& combine,
152  const casacore::Bool& visnorm,
153  const casacore::Bool& solnorm,
154  const casacore::Int& maskcenter,
155  const casacore::Float& maskedge,
156  const casacore::String& refant);
157 
158  // Arrange to solve for GSPLINE (using casacore::MSSelection syntax)
160  const casacore::Bool& append,
161  const casacore::String& mode,
162  const casacore::Double& splinetime,
163  const casacore::Double& preavg,
164  const casacore::Int& numpoint,
165  const casacore::Double& phasewrap,
166  const casacore::String& refant);
167 
168  virtual casacore::Bool setsolve (const casacore::String& type,
169  const casacore::Record& solvepar);
170 
171  // Unset all (default) or one apply calibration component
172  casacore::Bool unsetapply(const casacore::Int& which=-1);
173  // TBD: casacore::Bool unsetapply(const casacore::String& type); // by type?
174 
175  // Unset the solved-for calibration component
177 
178  // Reset the VisCal lists in the Calibrator object
180  const casacore::Bool& solve=true);
181 
182  // Apply all setapply'd calibration components to DATA and
183  // deposit in the CORRECTED_DATA column
184  virtual casacore::Bool correct(casacore::String /* mode="calflag"*/) { throw(casacore::AipsError("Calibrater::correct not implemented")); };
185  casacore::Bool correct2(casacore::String mode="calflag");
186 
187  // Apply all setapply'd calibration components to MODEL_DATA and
188  // deposit in the MODEL_DATA column
189  virtual casacore::Bool corrupt() { return this->corrupt2(); };
191 
192  // Initialize sigma/weight, and possibly weight_spectrum
194  casacore::Bool initWeights(casacore::Bool doBT=true, casacore::Bool dowtsp=false);
195  virtual casacore::Bool initWeightsWithTsys(casacore::String wtmode, casacore::Bool dowtsp=false, casacore::String tsystable="",
196  casacore::String gainfield="", casacore::String interp="linear",
198 
199  // Solve for a given calibration component
200  virtual casacore::Bool solve();
201 
202  // Modelfit
204  const casacore::String& /*stype*/,
205  const casacore::Vector<casacore::Double>& /*par*/,
206  const casacore::Vector<casacore::Bool>& /*vary*/,
207  const casacore::String& /*file*/) { throw(casacore::AipsError("Calibrater::modelfit not implemented")); };
208 
209  // Fluxscale (using casacore::MSSelection syntax for fields)
210  void fluxscale(const casacore::String& infile,
211  const casacore::String& outfile,
212  const casacore::String& refFields,
213  const casacore::Vector<casacore::Int>& refSpwMap,
214  const casacore::String& tranFields,
215  const casacore::Bool& append,
216  const casacore::Float& inGainThres,
217  const casacore::String& antSel,
218  const casacore::String& timerangeSel,
219  const casacore::String& scanSel,
220  SolvableVisCal::fluxScaleStruct& oFluxScaleFactor,
222  const casacore::String& oListFile,
223  const casacore::Bool& incremental,
224  const casacore::Int& fitorder,
225  const casacore::Bool& display);
226 
227  // Fluxscale (via field indices)
228  virtual void fluxscale(const casacore::String& infile,
229  const casacore::String& outfile,
230  const casacore::Vector<casacore::Int>& refField,
231  const casacore::Vector<casacore::Int>& refSpwMap,
232  const casacore::Vector<casacore::Int>& tranField,
233  const casacore::Bool& append,
234  const casacore::Float& inGainThres,
235  const casacore::String& antSel,
236  const casacore::String& timerangeSel,
237  const casacore::String& scanSel,
238  SolvableVisCal::fluxScaleStruct& oFluxScaleFactor,
239  const casacore::String& oListFile,
240  const casacore::Bool& incremental,
241  const casacore::Int& fitorder,
242  const casacore::Bool& display);
243 
244  // Accumulate (using casacore::MSSelection syntax)
245  virtual void accumulate(const casacore::String& /*intab*/,
246  const casacore::String& /*incrtab*/,
247  const casacore::String& /*outtab*/,
248  const casacore::String& /*fields*/,
249  const casacore::String& /*calFields*/,
250  const casacore::String& /*interp="linear"*/,
251  const casacore::Double& /*t=-1.0*/,
252  const casacore::Vector<casacore::Int>& /*spwmap=casacore::Vector<casacore::Int>(1,-1)*/) { throw(casacore::AipsError("Calibrater::accumulate not implemented")); };
253 
254  // Generate cal table from specified values
255  virtual void specifycal(const casacore::String& type,
256  const casacore::String& caltable,
257  const casacore::String& time,
258  const casacore::String& spw,
259  const casacore::String& antenna,
260  const casacore::String& pol,
261  const casacore::Vector<casacore::Double>& parameter,
262  const casacore::String& infile,
263  const casacore::Bool& uniform);
264 
265  // casacore::Smooth calibration (using casacore::MSSelection syntax
266  virtual casacore::Bool smooth(const casacore::String& infile,
267  casacore::String& outfile,
268  const casacore::String& smoothtype,
269  const casacore::Double& smoothtime,
270  const casacore::String& fields);
271 
272 
273  // Apply new reference antenna to calibration
274  virtual casacore::Bool reRefant(const casacore::String& infile,
275  casacore::String& outfile,
276  const casacore::String& refantmode,
277  const casacore::String& refant);
278 
279 
280  // casacore::List a calibration table
281  virtual casacore::Bool listCal(const casacore::String& infile,
282  const casacore::String& field,
283  const casacore::String& antenna,
284  const casacore::String& spw,
285  const casacore::String& listfile="",
286  const casacore::Int& pagerows=50);
287 
288  // Initialize the calibrator object from an input MeasurementSet.
289  // Optional compression of the calibration columns (MODEL_DATA,
290  // and CORRECTED_DATA) is supported.
291  //if addScratch=true, optionally one can just add CORRECTED_DATA by
292  //setting addModel to false
294  casacore::Bool compress=true,
295  casacore::Bool addScratch=true, casacore::Bool addModel=true);
296 
297  // Re-initialize the calibration scratch columns
298  virtual casacore::Bool initCalSet(const casacore::Int& /*calSet*/) { throw(casacore::AipsError("Calibrater::initCalSet not implemented")); };;
299 
300  // Report apply/solve state
304 
306 
307 
308  // Handle caltable backward compatibility
309  static casacore::Bool updateCalTable(const casacore::String& caltable);
310 
311  // Return access to the VisEquation
312  VisEquation* ve() { return ve_p; };
313 
314  // Returns true if calibrator object is in a valid state
315  virtual casacore::Bool ok();
316 
317  protected:
318 
320 
321  // Log functions and variables
324 
325  // Method to update casacore::MS HISTORY Table
326  void writeHistory(casacore::LogIO& os,
327  casacore::Bool cliCommand=false);
328 
329  // casacore::Time functions and variables
332 
333  // Select on channel using MSSelection
334  virtual void selectChannel(const casacore::String& spw);
335 
336  // Interpret refant index
338 
340 
341  // Interpret field indices (casacore::MSSelection)
343 
344  // Interpret spw indices (casacore::MSSelection)
346 
347  // Interpret spw indices (casacore::MSSelection)
349 
350  // Query apply types to see if we need to calibrate the weights
352 
353  // Given a (supplied) list of uncalibrated spws, determines and returns if there were
354  // any, and if so sends them as a warning message to the logger.
356  casacore::Bool strictflag=false);
357 
358  // Create a VisSet for raw phase transfer if needed
360 
361  // The standard solving mechanism (VI2/SDB version)
363 
364  // casacore::Input casacore::MeasurementSet and derived selected MeasurementSet
369 
370  // casacore::MSSelection object
372  std::shared_ptr<vi::FrequencySelections> frequencySelections_p;
373 
374  // Meta-info server for calibration
376 
377  // VisEquation derived from the input MeasurementSet
379 
380  // VisCals for applying and solving:
383 
384  // casacore::MeasurementSet selection parameters
388 
389  //Spline phase wrapping helper params
392 
393  //Used to update the casacore::MS HISTORY Table
397 
399 
400  // Activity record
402 
403  private:
404  // Copy constructor and assignment operator are forbidden
405  Calibrater(const Calibrater&);
407 
408  // Simulated-data/testing context info
409  const bool simdata_p;
411 
412  // configuration for calibration dependent data filter
415  casacore::Record const &config);
416 
417 };
418 
419 // Preserve old-fashioned Calibrater here:
420 
421 class OldCalibrater : public Calibrater
422 {
423 
424  public:
425  // Default constructor
426  OldCalibrater();
427 
428 
429  // Simple casacore::MS-only ctor
431 
432  // Destructor
433  virtual ~OldCalibrater();
434 
435 
436  // Set uv-data selection via MSSelection
437  virtual void selectvis(const casacore::String& time="",
438  const casacore::String& spw="",
439  const casacore::String& scan="",
440  const casacore::String& field="",
441  const casacore::String& intent="",
442  const casacore::String& obsIDs="",
443  const casacore::String& baseline="",
444  const casacore::String& uvrange="",
445  const casacore::String& chanmode="none",
446  const casacore::Int& nchan=1,
447  const casacore::Int& start=0,
448  const casacore::Int& step=1,
451  const casacore::String& msSelect="");
452 
453  // Uses *vs_p to ctor VisCals
454  using Calibrater::setapply;
455  virtual casacore::Bool setapply (const casacore::String& type,
456  const casacore::Record& applypar);
457 
458 
459  // Set up apply-able calibration via a Cal Library
460  virtual casacore::Bool setcallib(casacore::Record callib);
462 
463  // Uses *vs_p to ctor the SolvableVisCal
464  virtual casacore::Bool setsolve (const casacore::String& type,
465  const casacore::Record& solvepar);
466 
467  // Apply all setapply'd calibration components to DATA and
468  // deposit in the CORRECTED_DATA column
469  virtual casacore::Bool correct(casacore::String mode="calflag");
470 
471  // Apply all setapply'd calibration components to MODEL_DATA and
472  // deposit in the MODEL_DATA column
473  virtual casacore::Bool corrupt();
474 
475  // Initialize sigma/weight, and possibly weight_spectrum
476  // Tsys-specific version (SD)
477  virtual casacore::Bool initWeightsWithTsys(casacore::String wtmode, casacore::Bool dowtsp=false, casacore::String tsystable="",
478  casacore::String gainfield="", casacore::String interp="linear",
480 
481 
482  // Solve for a given calibration component
483  virtual casacore::Bool solve();
484 
485 
486  // Modelfit
488  const casacore::String& stype,
491  const casacore::String& file);
492 
493  // Fluxscale (via field indices)
494  // NB: uses *vs_p to make SVCs
495  virtual void fluxscale(const casacore::String& infile,
496  const casacore::String& outfile,
497  const casacore::Vector<casacore::Int>& refField,
498  const casacore::Vector<casacore::Int>& refSpwMap,
499  const casacore::Vector<casacore::Int>& tranField,
500  const casacore::Bool& append,
501  const casacore::Float& inGainThres,
502  const casacore::String& antSel,
503  const casacore::String& timerangeSel,
504  const casacore::String& scanSel,
505  SolvableVisCal::fluxScaleStruct& oFluxScaleFactor,
506  const casacore::String& oListFile,
507  const casacore::Bool& incremental,
508  const casacore::Int& fitorder,
509  const casacore::Bool& display);
510 
511  // Accumulate (using casacore::MSSelection syntax)
512  virtual void accumulate(const casacore::String& intab,
513  const casacore::String& incrtab,
514  const casacore::String& outtab,
515  const casacore::String& fields,
516  const casacore::String& calFields,
517  const casacore::String& interp="linear",
518  const casacore::Double& t=-1.0,
520 
521  // Generate cal table from specified values
522  // NB: creates VCs with *vs_p
523  virtual void specifycal(const casacore::String& type,
524  const casacore::String& caltable,
525  const casacore::String& time,
526  const casacore::String& spw,
527  const casacore::String& antenna,
528  const casacore::String& pol,
529  const casacore::Vector<casacore::Double>& parameter,
530  const casacore::String& infile,
531  const casacore::Bool& uniform);
532 
533  // casacore::Smooth calibration (using casacore::MSSelection syntax
534  // NB: uses *vs_p to create SVC
535  virtual casacore::Bool smooth(const casacore::String& infile,
536  casacore::String& outfile,
537  const casacore::String& smoothtype,
538  const casacore::Double& smoothtime,
539  const casacore::String& fields);
540 
541  // casacore::List a calibration table
542  virtual casacore::Bool listCal(const casacore::String& infile,
543  const casacore::String& field,
544  const casacore::String& antenna,
545  const casacore::String& spw,
546  const casacore::String& listfile="",
547  const casacore::Int& pagerows=50);
548 
549 
550  // Initialize the calibrator object from an input MeasurementSet.
551  // Optional compression of the calibration columns (MODEL_DATA,
552  // and CORRECTED_DATA) is supported.
553  //if addScratch=true, optionally one can just add CORRECTED_DATA by
554  //setting addModel to false
556  casacore::Bool compress=true,
557  casacore::Bool addScratch=true,
558  casacore::Bool addModel=true);
559 
560  // Re-initialize the calibration scratch columns
561  virtual casacore::Bool initCalSet(const casacore::Int& calSet);
562 
564 
565  protected:
566 
567  // Organize sort columns for correction
569 
570  // Select on channel using MSSelection
571  virtual void selectChannel(const casacore::String& spw);
572 
573  // Channel mask services
574  virtual void initChanMask();
575 
576  // Select on channel in the VisSet
577  virtual void selectChannel(const casacore::String& mode,
578  const casacore::Int& nchan, const casacore::Int& start, const casacore::Int& step,
579  const casacore::MRadialVelocity& mStart,
580  const casacore::MRadialVelocity& mStep);
581 
582 
583  // Returns true if calibrator object is in a valid state
584  virtual casacore::Bool ok();
585 
586  // The standard solving mechanism
588 
589  // VisSet that hosts an old VI
592 
593  // channel masking
595 
596  private:
597  // Copy constructor and assignment operator are forbidden
600 
601 
602 };
603 
604 
605 
606 
607 
608 } //# NAMESPACE CASA - END
609 
610 #endif
OldCalibrater & operator=(const OldCalibrater &)
virtual casacore::Bool genericGatherAndSolve()
The standard solving mechanism.
Calibrater & operator=(const Calibrater &)
void fluxscale(const casacore::String &infile, const casacore::String &outfile, const casacore::String &refFields, const casacore::Vector< casacore::Int > &refSpwMap, const casacore::String &tranFields, const casacore::Bool &append, const casacore::Float &inGainThres, const casacore::String &antSel, const casacore::String &timerangeSel, const casacore::String &scanSel, SolvableVisCal::fluxScaleStruct &oFluxScaleFactor, casacore::Vector< casacore::Int > &tranidx, const casacore::String &oListFile, const casacore::Bool &incremental, const casacore::Int &fitorder, const casacore::Bool &display)
Fluxscale (using casacore::MSSelection syntax for fields)
virtual casacore::Bool ok()
Returns true if calibrator object is in a valid state.
virtual casacore::Bool initCalSet(const casacore::Int &)
Re-initialize the calibration scratch columns.
Definition: Calibrater.h:298
int Int
Definition: aipstype.h:50
MSMetaInfoForCal * msmc_p
Meta-info server for calibration.
Definition: Calibrater.h:375
Calibrater()
Default constructor.
virtual void fluxscale(const casacore::String &infile, const casacore::String &outfile, const casacore::Vector< casacore::Int > &refField, const casacore::Vector< casacore::Int > &refSpwMap, const casacore::Vector< casacore::Int > &tranField, const casacore::Bool &append, const casacore::Float &inGainThres, const casacore::String &antSel, const casacore::String &timerangeSel, const casacore::String &scanSel, SolvableVisCal::fluxScaleStruct &oFluxScaleFactor, const casacore::String &oListFile, const casacore::Bool &incremental, const casacore::Int &fitorder, const casacore::Bool &display)
Fluxscale (via field indices) NB: uses *vs_p to make SVCs.
virtual void selectvis(const casacore::String &time="", const casacore::String &spw="", const casacore::String &scan="", const casacore::String &field="", const casacore::String &intent="", const casacore::String &obsIDs="", const casacore::String &baseline="", const casacore::String &uvrange="", const casacore::String &chanmode="none", const casacore::Int &nchan=1, const casacore::Int &start=0, const casacore::Int &step=1, const casacore::MRadialVelocity &mStart=casacore::MRadialVelocity(), const casacore::MRadialVelocity &mStep=casacore::MRadialVelocity(), const casacore::String &msSelect="")
Set uv-data selection via MSSelection.
casacore::Bool setmodel(const casacore::String &modelImage)
casacore::Bool state()
Report apply/solve state.
virtual void specifycal(const casacore::String &type, const casacore::String &caltable, const casacore::String &time, const casacore::String &spw, const casacore::String &antenna, const casacore::String &pol, const casacore::Vector< casacore::Double > &parameter, const casacore::String &infile, const casacore::Bool &uniform)
Generate cal table from specified values.
virtual casacore::Bool reRefant(const casacore::String &infile, casacore::String &outfile, const casacore::String &refantmode, const casacore::String &refant)
Apply new reference antenna to calibration.
Main interface class to a read/write table.
Definition: Table.h:153
casacore::Bool unsetsolve()
TBD: casacore::Bool unsetapply(const casacore::String&amp; type); // by type?
virtual casacore::Bool genericGatherAndSolve()
The standard solving mechanism (VI2/SDB version)
void getRawPhaseVisSet(casacore::Vector< casacore::Int > &spwid)
Create a VisSet for raw phase transfer if needed.
casacore::Bool unsetapply(const casacore::Int &which=-1)
Unset all (default) or one apply calibration component.
casacore::Vector< casacore::Int > getRefantIdxList(const casacore::String &refant)
Interpret refant index.
const Double degree
degree
casacore::Bool cleanupVisSet()
void apply(const Jones &j1, VisVector &v, const Jones &j2)
Apply a pair of Jones to a VisVector:
casacore::Record calFilterConfig_p
configuration for calibration dependent data filter
Definition: Calibrater.h:413
virtual casacore::Bool listCal(const casacore::String &infile, const casacore::String &field, const casacore::String &antenna, const casacore::String &spw, const casacore::String &listfile="", const casacore::Int &pagerows=50)
casacore::List a calibration table
virtual void selectvis(const casacore::String &time="", const casacore::String &spw="", const casacore::String &scan="", const casacore::String &field="", const casacore::String &intent="", const casacore::String &obsIDs="", const casacore::String &baseline="", const casacore::String &uvrange="", const casacore::String &chanmode="none", const casacore::Int &nchan=1, const casacore::Int &start=0, const casacore::Int &step=1, const casacore::MRadialVelocity &mStart=casacore::MRadialVelocity(), const casacore::MRadialVelocity &mStep=casacore::MRadialVelocity(), const casacore::String &msSelect="")
Set uv-data selection via MSSelection.
virtual Type type()
Return the type enum.
virtual ~Calibrater()
Destructor.
std::shared_ptr< vi::FrequencySelections > frequencySelections_p
Definition: Calibrater.h:372
casacore::Bool setsolve(const casacore::String &type, const casacore::String &solint, const casacore::String &table, const casacore::Bool append, const casacore::Double preavg, const casacore::String &apmode="AP", const casacore::Int minblperant=4, const casacore::String &refant="", const casacore::String &refantmode="flex", const casacore::Bool solnorm=false, const casacore::String &normtype="mean", const casacore::Float minsnr=0.0f, const casacore::String &combine="", const casacore::Int fillgaps=0, const casacore::String &cfcache="", const casacore::Double painc=360.0, const casacore::Int fitorder=0, const casacore::Float fraction=0.1, const casacore::Int numedge=-1, const casacore::String &radius="", const casacore::Bool smooth=true, const casacore::Bool zerorates=false, const casacore::Bool globalsolve=true, const casacore::Int niter=100, const casacore::Vector< casacore::Double > &delaywindow=casacore::Vector< casacore::Double >(), const casacore::Vector< casacore::Double > &ratewindow=casacore::Vector< casacore::Double >(), const casacore::String &solmode="", const casacore::Vector< casacore::Double > &rmsthresh=casacore::Vector< casacore::Double >())
Arrange to solve (using casacore::MSSelection syntax)
virtual casacore::Bool correct(casacore::String)
Apply all setapply&#39;d calibration components to DATA and deposit in the CORRECTED_DATA column...
Definition: Calibrater.h:184
casacore::Bool usingCalLibrary_
Definition: Calibrater.h:398
ABSTRACT TOOL CLASSES A PlotTool is a higher level event handler for a PlotCanvas The idea is to take common tasks which may require multiple events and put them in one place PlotTools also provide additional functionality in that they can be active and blocking non blocking The PlotCanvas will only send events to active and will not send events to later tools or event handlers if the latest tool was blocking In this way a single tool can be used to handle ALL user interaction via the GUI at one time
Definition: PlotTool.h:43
VisEquation * ve_p
VisEquation derived from the input MeasurementSet.
Definition: Calibrater.h:378
casacore::Bool initWeights(casacore::String wtmode, casacore::Bool dowtsp=false)
Initialize sigma/weight, and possibly weight_spectrum.
SolvableVisCal * svc_p
Definition: Calibrater.h:382
virtual void specifycal(const casacore::String &type, const casacore::String &caltable, const casacore::String &time, const casacore::String &spw, const casacore::String &antenna, const casacore::String &pol, const casacore::Vector< casacore::Double > &parameter, const casacore::String &infile, const casacore::Bool &uniform)
Generate cal table from specified values NB: creates VCs with *vs_p.
casacore::Timer timer_p
Definition: Calibrater.h:331
ostream-like interface to creating log messages.
Definition: LogIO.h:167
A Measure: radial velocity.
casacore::MSHistoryHandler * hist_p
Definition: Calibrater.h:395
virtual casacore::Bool ok()
Returns true if calibrator object is in a valid state.
virtual casacore::Vector< casacore::Double > modelfit(const casacore::Int &iter, const casacore::String &stype, const casacore::Vector< casacore::Double > &par, const casacore::Vector< casacore::Bool > &vary, const casacore::String &file)
Modelfit.
virtual void selectChannel(const casacore::String &spw)
Select on channel using MSSelection.
virtual casacore::Bool initCalSet(const casacore::Int &calSet)
Re-initialize the calibration scratch columns.
casacore::Int dataStart_p
Definition: Calibrater.h:386
casacore::LogIO & logSink()
casacore::Bool setapply(const casacore::String &type, const casacore::Double &t, const casacore::String &table, const casacore::String &spw, const casacore::String &field, const casacore::String &interp, const casacore::Bool &calwt, const casacore::Vector< casacore::Int > &spwmap, const casacore::Vector< casacore::Double > &opacity)
Set up to apply calibration (using casacore::MSSelection syntax)
const vi::SimpleSimVi2Parameters ssvp_p
Definition: Calibrater.h:410
casacore::Vector< casacore::Int > getFieldIdx(const casacore::String &fields)
Interpret field indices (casacore::MSSelection)
virtual casacore::Bool solve()
Solve for a given calibration component.
virtual casacore::Bool solve()
Solve for a given calibration component.
casacore::Int histLockCounter_p
Used to update the casacore::MS HISTORY Table.
Definition: Calibrater.h:394
virtual casacore::Bool setcallib2(casacore::Record callib, const casacore::MeasurementSet *ms=0)
casacore::PtrBlock< VisCal * > vc_p
VisCals for applying and solving:
Definition: Calibrater.h:381
casacore::Bool setsolvebandpoly(const casacore::String &table, const casacore::Bool &append, const casacore::String &solint, const casacore::String &combine, const casacore::Vector< casacore::Int > &degree, const casacore::Bool &visnorm, const casacore::Bool &solnorm, const casacore::Int &maskcenter, const casacore::Float &maskedge, const casacore::String &refant)
Arrange to solve for BPOLY (using casacore::MSSelection syntax)
casacore::Record & getActRec()
Definition: Calibrater.h:305
casacore::Int dataNchan_p
Definition: Calibrater.h:386
casacore::Double phasewrap_p
Spline phase wrapping helper params.
Definition: Calibrater.h:390
virtual casacore::Bool setapply(const casacore::String &type, const casacore::Record &applypar)
casacore::Int splinepoint_p
Definition: Calibrater.h:391
casacore::MeasurementSet * mssel_p
Definition: Calibrater.h:367
virtual casacore::Bool setcallib2(casacore::Record callib, const casacore::MeasurementSet *ms=0)
casacore::MeasurementSet * ms_p
Definition: Calibrater.h:366
void setCalFilterConfiguration(casacore::String const &type, casacore::Record const &config)
casacore::MRadialVelocity mDataStart_p
Definition: Calibrater.h:387
virtual casacore::Bool initWeightsWithTsys(casacore::String wtmode, casacore::Bool dowtsp=false, casacore::String tsystable="", casacore::String gainfield="", casacore::String interp="linear", casacore::Vector< casacore::Int > spwmap=casacore::Vector< casacore::Int >())
VisEquation * ve()
Return access to the VisEquation.
Definition: Calibrater.h:312
casacore::Int dataStep_p
Definition: Calibrater.h:386
double Double
Definition: aipstype.h:55
casacore::Record actRec_
Activity record.
Definition: Calibrater.h:401
virtual void selectChannel(const casacore::String &spw)
Select on channel using MSSelection.
casacore::Bool setModel(const casacore::Vector< casacore::Double > &stokes)
virtual casacore::Bool initialize(casacore::MeasurementSet &inputMS, casacore::Bool compress=true, casacore::Bool addScratch=true, casacore::Bool addModel=true)
Initialize the calibrator object from an input MeasurementSet.
OldCalibrater()
Default constructor.
MSSelection: Class to represent a selection on an MS.
Definition: MSSelection.h:118
casacore::Bool setsolvegainspline(const casacore::String &table, const casacore::Bool &append, const casacore::String &mode, const casacore::Double &splinetime, const casacore::Double &preavg, const casacore::Int &numpoint, const casacore::Double &phasewrap, const casacore::String &refant)
Arrange to solve for GSPLINE (using casacore::MSSelection syntax)
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
virtual casacore::Bool setsolve(const casacore::String &type, const casacore::Record &solvepar)
Uses *vs_p to ctor the SolvableVisCal.
virtual ~OldCalibrater()
Destructor.
casacore::Bool calWt()
Query apply types to see if we need to calibrate the weights.
casacore::Vector< casacore::Int > getSpwIdx(const casacore::String &spws)
Interpret spw indices (casacore::MSSelection)
virtual casacore::Bool setcallib(casacore::Record)
Set up apply-able calibration via a Cal Library.
Definition: Calibrater.h:108
measure the time it takes to execute parts of a program
Definition: Timer.h:127
static casacore::Bool updateCalTable(const casacore::String &caltable)
Handle caltable backward compatibility.
casacore::LogIO sink_p
Log functions and variables.
Definition: Calibrater.h:322
casacore::String msname_p
casacore::Input casacore::MeasurementSet and derived selected MeasurementSet
Definition: Calibrater.h:365
float Float
Definition: aipstype.h:54
const bool simdata_p
Simulated-data/testing context info.
Definition: Calibrater.h:409
virtual casacore::Vector< casacore::Double > modelfit(const casacore::Int &, const casacore::String &, const casacore::Vector< casacore::Double > &, const casacore::Vector< casacore::Bool > &, const casacore::String &)
Modelfit.
Definition: Calibrater.h:203
casacore::PtrBlock< casacore::Vector< casacore::Bool > * > chanmask_
channel masking
Definition: Calibrater.h:594
casacore::Bool cleanup()
casacore::MRadialVelocity mDataStep_p
Definition: Calibrater.h:387
A drop-in replacement for Block&lt;T*&gt;.
Definition: WProjectFT.h:54
virtual casacore::Bool correct(casacore::String mode="calflag")
Apply all setapply&#39;d calibration components to DATA and deposit in the CORRECTED_DATA column...
virtual void initChanMask()
Channel mask services.
virtual Origin origin() const =0
ABSTRACT METHODS //.
A Table intended to hold astronomical data (a set of Measurements).
casacore::Bool correct2(casacore::String mode="calflag")
virtual casacore::Bool setcallib(casacore::Record callib)
Set up apply-able calibration via a Cal Library.
casacore::String timerString()
casacore::Time functions and variables
A class to provide a simple interface to history writing.
casacore::Bool validatecallib(casacore::Record callib)
virtual casacore::Bool initWeightsWithTsys(casacore::String wtmode, casacore::Bool dowtsp=false, casacore::String tsystable="", casacore::String gainfield="", casacore::String interp="linear", casacore::Vector< casacore::Int > spwmap=casacore::Vector< casacore::Int >())
Initialize sigma/weight, and possibly weight_spectrum Tsys-specific version (SD)
virtual void accumulate(const casacore::String &, const casacore::String &, const casacore::String &, const casacore::String &, const casacore::String &, const casacore::String &, const casacore::Double &, const casacore::Vector< casacore::Int > &)
Accumulate (using casacore::MSSelection syntax)
Definition: Calibrater.h:245
Base class for all Casacore library errors.
Definition: Error.h:134
casacore::Bool solvestate()
void writeHistory(casacore::LogIO &os, casacore::Bool cliCommand=false)
Method to update casacore::MS HISTORY Table.
virtual casacore::Bool smooth(const casacore::String &infile, casacore::String &outfile, const casacore::String &smoothtype, const casacore::Double &smoothtime, const casacore::String &fields)
casacore::Smooth calibration (using casacore::MSSelection syntax NB: uses *vs_p to create SVC ...
casacore::String dataMode_p
casacore::MeasurementSet selection parameters
Definition: Calibrater.h:385
casacore::Bool reset(const casacore::Bool &apply=true, const casacore::Bool &solve=true)
Reset the VisCal lists in the Calibrator object.
casacore::Bool summarize_uncalspws(const casacore::Vector< casacore::Bool > &uncalspw, const casacore::String &origin, casacore::Bool strictflag=false)
Given a (supplied) list of uncalibrated spws, determines and returns if there were any...
casacore::MSSelection * mss_p
casacore::MSSelection object
Definition: Calibrater.h:371
VisSet * vs_p
VisSet that hosts an old VI.
Definition: Calibrater.h:590
casacore::Vector< casacore::Int > getAntIdx(const casacore::String &antenna)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual VisibilityIterator::DataColumn configureForCorrection()
Organize sort columns for correction.
casacore::MeasurementSet * msselRaw_p
Definition: Calibrater.h:368
virtual casacore::Bool initialize(casacore::MeasurementSet &inputMS, casacore::Bool compress=true, casacore::Bool addScratch=true, casacore::Bool addModel=true)
Initialize the calibrator object from an input MeasurementSet.
virtual casacore::Bool listCal(const casacore::String &infile, const casacore::String &field, const casacore::String &antenna, const casacore::String &spw, const casacore::String &listfile="", const casacore::Int &pagerows=50)
casacore::List a calibration table
Preserve old-fashioned Calibrater here:
Definition: Calibrater.h:421
virtual casacore::Bool corrupt()
Apply all setapply&#39;d calibration components to MODEL_DATA and deposit in the MODEL_DATA column...
Definition: Calibrater.h:189
virtual void accumulate(const casacore::String &intab, const casacore::String &incrtab, const casacore::String &outtab, const casacore::String &fields, const casacore::String &calFields, const casacore::String &interp="linear", const casacore::Double &t=-1.0, const casacore::Vector< casacore::Int > &spwmap=casacore::Vector< casacore::Int >(1,-1))
Accumulate (using casacore::MSSelection syntax)
casacore::Table historytab_p
Definition: Calibrater.h:396
casacore::Matrix< casacore::Int > getChanIdx(const casacore::String &spws)
Interpret spw indices (casacore::MSSelection)
virtual casacore::Bool corrupt()
Apply all setapply&#39;d calibration components to MODEL_DATA and deposit in the MODEL_DATA column...
casacore::Bool corrupt2()
virtual casacore::Bool smooth(const casacore::String &infile, casacore::String &outfile, const casacore::String &smoothtype, const casacore::Double &smoothtime, const casacore::String &fields)
casacore::Smooth calibration (using casacore::MSSelection syntax
casacore::Bool applystate()
static Calibrater * factory(casacore::Bool old=true)
Calibrater factories.
Defines nreal time structures used by the VLA table filler.
Definition: nreal.h:100