casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FlagDataHandler.h
Go to the documentation of this file.
1 //# FlagDataHandler.h: This file contains the interface definition of the FlagDataHandler 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 FLAGDATAHANDLER_H_
24 #define FLAGDATAHANDLER_H_
25 
26 // VI/VB infrastructure
28 
29 // TVI framework
31 
32 // Records interface
33 #include <casa/Containers/Record.h>
34 
35 // casacore::Data mapping
36 #include <map>
37 
38 namespace casa {
39  namespace vi {
40  enum class VisBufferComponent2;
41  }
42 }
43 
44 namespace casacore {
45 
46  class MSSelection;
47  template <class M> class ScalarMeasColumn;
48 }
49 
50 namespace casa { //# NAMESPACE CASA - BEGIN
51 
52 // Type definitions
53 typedef std::map< std::pair<casacore::Int,casacore::Int>,std::vector<casacore::uInt> >::iterator antennaPairMapIterator;
54 typedef std::map< casacore::Double,std::vector<casacore::uInt> >::iterator subIntegrationMapIterator;
55 typedef std::map< casacore::uShort,casacore::uShort >::iterator polartizationMapIterator;
56 typedef std::map< std::pair<casacore::Int,casacore::Int>,std::vector<casacore::uInt> > antennaPairMap;
57 typedef std::map< casacore::Double,std::vector<casacore::uInt> > subIntegrationMap;
58 typedef std::map< casacore::uShort,casacore::uShort > polarizationMap;
59 typedef std::map< casacore::uInt,casacore::String > polarizationIndexMap;
60 typedef std::vector< std::vector<casacore::Double> > antennaPointingMap;
61 typedef std::map< casacore::Int,std::vector<casacore::Double> > scanStartStopMap;
62 typedef std::map< casacore::Int,casacore::Double > lambdaMap;
63 
65 
66 // We need to have the CubeView definition here because its type is used by FlagDataHandler class
67 template<class T> class CubeView
68 {
69 
70 public:
71 
72  CubeView(casacore::Cube<T> *parentCube, std::vector<casacore::uInt> *rows = NULL, std::vector<casacore::uInt> *channels = NULL, std::vector<casacore::uInt> *polarizations = NULL)
73  {
74  parentCube_p = parentCube;
75  casacore::IPosition baseCubeShape = parentCube_p->shape();
77 
78  if (((polarizations != NULL) and (polarizations->size() > 0)) and
79  ((channels != NULL) and (channels->size() > 0)) and
80  ((rows != NULL) and (rows->size() > 0)))
81  {
83  }
84  else if (((polarizations != NULL) and (polarizations->size() > 0)) and
85  ((channels != NULL) and (channels->size() > 0)))
86  {
88  }
89  else if (((polarizations != NULL) and (polarizations->size() > 0)) and
90  ((rows != NULL) and (rows->size() > 0)))
91  {
93  }
94  else if (((channels != NULL) and (channels->size() > 0)) and
95  ((rows != NULL) and (rows->size() > 0)))
96  {
98  }
99  else if ((polarizations != NULL) and (polarizations->size() > 0))
100  {
102  }
103  else if ((channels != NULL) and (channels->size() > 0))
104  {
106  }
107  else if ((rows != NULL) and (rows->size() > 0))
108  {
110  }
111  else
112  {
114  }
115 
116  if ((polarizations != NULL) and (polarizations->size() > 0))
117  {
118  polarizations_p = polarizations;
119  reducedLength_p(0) = polarizations_p->size();
120  }
121  else
122  {
123  polarizations_p = NULL;
124  reducedLength_p(0) = baseCubeShape(0);
125  }
126 
127  if ((channels != NULL) and (channels->size() > 0))
128  {
129  channels_p = channels;
130  reducedLength_p(1) = channels_p->size();
131  }
132  else
133  {
134  channels_p = NULL;
135  reducedLength_p(1) = baseCubeShape(1);
136  }
137 
138  if ((rows != NULL) and (rows->size() > 0))
139  {
140  rows_p = rows;
141  reducedLength_p(2) = rows_p->size();
142  }
143  else
144  {
145  rows_p = NULL;
146  reducedLength_p(2) = baseCubeShape(2);
147  }
148  }
149 
151  {
152  return (*this.*access_p)(i1,i2,i3);
153  }
154 
155  const casacore::IPosition &shape() const
156  {
157  return reducedLength_p;
158  }
159 
160  void shape(casacore::Int &s1, casacore::Int &s2, casacore::Int &s3) const
161  {
162  s1 = reducedLength_p(0);
163  s2 = reducedLength_p(1);
164  s3 = reducedLength_p(2);
165  return;
166  }
167 
168 protected:
169 
170  std::vector<casacore::uInt> *createIndex(casacore::uInt size)
171  {
172  std::vector<casacore::uInt> *index = new std::vector<casacore::uInt>(size);
173  index->clear();
174  for (casacore::uInt i=0; i<size; i++ )
175  {
176  index->push_back(i);
177  }
178  return index;
179  }
180 
182  {
183  return parentCube_p->at(i1,i2,i3);
184  }
185 
187  {
188  casacore::uInt i1_index = polarizations_p->at(i1);
189  casacore::uInt i2_index = channels_p->at(i2);
190  casacore::uInt i3_index = rows_p->at(i3);
191  return parentCube_p->at(i1_index,i2_index,i3_index);
192  }
193 
195  {
196  casacore::uInt i1_index = polarizations_p->at(i1);
197  return parentCube_p->at(i1_index,i2,i3);
198  }
199 
201  {
202  casacore::uInt i2_index = channels_p->at(i2);
203  return parentCube_p->at(i1,i2_index,i3);
204  }
205 
207  {
208  casacore::uInt i3_index = rows_p->at(i3);
209  return parentCube_p->at(i1,i2,i3_index);
210  }
211 
213  {
214  casacore::uInt i1_index = polarizations_p->at(i1);
215  casacore::uInt i2_index = channels_p->at(i2);
216  return parentCube_p->at(i1_index,i2_index,i3);
217  }
218 
220  {
221  casacore::uInt i1_index = polarizations_p->at(i1);
222  casacore::uInt i3_index = rows_p->at(i3);
223  return parentCube_p->at(i1_index,i2,i3_index);
224  }
225 
227  {
228  casacore::uInt i2_index = channels_p->at(i2);
229  casacore::uInt i3_index = rows_p->at(i3);
230  return parentCube_p->at(i1,i2_index,i3_index);
231  }
232 
233 private:
235  std::vector<casacore::uInt> *rows_p;
236  std::vector<casacore::uInt> *channels_p;
237  std::vector<casacore::uInt> *polarizations_p;
240 };
241 
242 template<class T> class VectorView
243 {
244 
245 public:
246  VectorView(casacore::Vector<T> *parentVector, std::vector<casacore::uInt> *rows = NULL)
247  {
248  casacore::IPosition parentVectorShape = parentVector->shape();
249  parentVector_p = parentVector;
251 
252  if ((rows != NULL) and (rows->size() > 0))
253  {
255  }
256  else
257  {
259  }
260 
261  if ((rows != NULL) and (rows->size() > 0))
262  {
263  rows_p = rows;
264  reducedLength_p(0) = rows_p->size();
265  }
266  else
267  {
268  rows_p = NULL;
269  reducedLength_p(0) = parentVectorShape(0);
270  }
271  }
272 
274  {
275  return (*this.*access_p)(i1);
276  }
277 
278  const casacore::IPosition &shape() const
279  {
280  return reducedLength_p;
281  }
282 
283  void shape(casacore::Int &s1) const
284  {
285  s1 = reducedLength_p(0);
286  return;
287  }
288 
289 protected:
290 
291  std::vector<casacore::uInt> *createIndex(casacore::uInt size)
292  {
293  std::vector<casacore::uInt> *index = new std::vector<casacore::uInt>(size);
294  index->clear();
295  for (casacore::uInt i=0; i<size; i++ )
296  {
297  index->push_back(i);
298  }
299  return index;
300  }
301 
303  {
304  return parentVector_p->operator()(i1);
305  }
306 
308  {
309  casacore::uInt i1_index = rows_p->at(i1);
310  return parentVector_p->operator()(i1_index);
311  }
312 
313 private:
315  std::vector<casacore::uInt> *rows_p;
318 };
319 
321 {
323 
324 public:
325 
327 
332  };
333 
335  VisMapper(casacore::String expression,polarizationMap *polMap);
336  ~VisMapper();
337 
339 
340  std::vector< std::vector<casacore::uInt> > getSelectedCorrelations() { return selectedCorrelations_p;}
342 
345 
346  // Direct access to the complex correlation product
348 
349  // NOTE: reducedLength_p is defined as [chan,row,pol]
350  const casacore::IPosition &shape() const
351  {
352  return reducedLength_p;
353  }
354 
355  void shape(casacore::Int &chan, casacore::Int &row) const
356  {
357  chan = reducedLength_p(0);
358  row = reducedLength_p(1);
359  return;
360  }
361 
362  void shape(casacore::Int &pol, casacore::Int &chan, casacore::Int &row) const
363  {
364  chan = reducedLength_p(0);
365  row = reducedLength_p(1);
366  pol = reducedLength_p(2);
367  return;
368  }
369 
370 
371 protected:
372  void setExpressionMapping(casacore::String expression,polarizationMap *polMap);
373  casacore::Float real(casacore::Complex val) {return val.real();}
374  casacore::Float imag(casacore::Complex val) {return val.imag();}
404 
405 
406 private:
409  // casacore::Complex (casa::VisMapper::*getCorr_p)(casacore::uInt,casacore::uInt);
410  std::vector<corrProduct> selectedCorrelationProducts_p;
411  std::vector< std::vector<casacore::uInt> > selectedCorrelations_p;
412  std::vector<string> selectedCorrelationStrings_p;
418 };
419 
421 {
422 
423 public:
424 
425  FlagMapper(casacore::Bool flag, std::vector < std::vector<casacore::uInt> > selectedCorrelations,
426  CubeView<casacore::Bool> *commonFlagsView,
427  CubeView<casacore::Bool> *originalFlagsView,
428  CubeView<casacore::Bool> *privateFlagsView=NULL,
429  VectorView<casacore::Bool> *commonFlagRowView=NULL,
430  VectorView<casacore::Bool> *originalFlagRowView=NULL,
431  VectorView<casacore::Bool> *privateFlagRowView=NULL);
432  FlagMapper(casacore::Bool flag,std::vector< std::vector<casacore::uInt> > selectedCorrelations);
433  ~FlagMapper();
434 
435  void setParentCubes(CubeView<casacore::Bool> *commonFlagsView,CubeView<casacore::Bool> *originalFlagsView,CubeView<casacore::Bool> *privateFlagsView=NULL);
436  void setParentFlagRow(VectorView<casacore::Bool> *commonFlagRowView,VectorView<casacore::Bool> *originalFlagRowView,VectorView<casacore::Bool> *privateFlagRowView=NULL);
437 
438  void applyFlag(casacore::uInt chan, casacore::uInt row);
439  void applyFlag(casacore::uInt pol, casacore::uInt channel, casacore::uInt row);
440  void applyFlagRow(casacore::uInt row);
441  void applyFlagInRow(casacore::uInt row);
442 
446 
450 
451  // These methods are needed for flag extension
454 
458 
459  const casacore::IPosition &shape() const
460  {
461  return reducedLength_p;
462  }
463 
464  void shape(casacore::Int &chan, casacore::Int &row) const
465  {
466  chan = reducedLength_p(0);
467  row = reducedLength_p(1);
468  return;
469  }
470 
471  void shape(casacore::Int &pol, casacore::Int &chan, casacore::Int &row) const
472  {
473  chan = reducedLength_p(0);
474  row = reducedLength_p(1);
475  pol = reducedLength_p(2);
476  return;
477  }
478 
479  std::vector< std::vector<casacore::uInt> > getSelectedCorrelations() {return selectedCorrelations_p;}
480 
482 
485 
486 protected:
487 
488  void setExpressionMapping(std::vector< std::vector<casacore::uInt> > selectedCorrelations);
489 
490  // Apply flags to common flag cube
492  // Apply flags to common and private flag cubes
494  // Apply flags to common and private flag cubes
496 
497  // Apply flags to common flag rows
499  // Apply flags to common and private flag rows
501 
502 private:
503 
512  std::vector< std::vector<casacore::uInt> > selectedCorrelations_p;
517 };
518 
519 // <summary>
520 // A top level class defining the data handling interface for the flagging module
521 // </summary>
522 //
523 // <use visibility=export>
524 //
525 // <prerequisite>
526 // <li> <linkto class="VisBuffer:description">VisBuffer</linkto>
527 // <li> <linkto class="FlagMapper:description">FlagMapper</linkto>
528 // <li> <linkto class="VisMapper:description">VisMapper</linkto>
529 // </prerequisite>
530 //
531 // <etymology>
532 // FlagDataHandler stands for generic data handling (i.e. MSs, CalTables, ...) specific to the flagging module
533 // </etymology>
534 //
535 // <synopsis>
536 //
537 // This is a top-level class defining the data handling interface for the flagging module.
538 // There are various methods (virtual) that must be re-implemented by the specific derived
539 // classes (e.g. FlagMSHandler, FlagCalTableHandler). These methods essentially cover:
540 //
541 // - casacore::Table access (i.e. open/close/iteration/rw)
542 //
543 // - casacore::Table selection (i.e. expression parsing, sub-table selection)
544 //
545 // Additionally there are public non-virtual methods to:
546 //
547 // - Set configuration parameters (pre-sort columns, data selection, time interval, async I/O)
548 //
549 // - Enable and access different kinds of mapping (baselines, correlation products, antenna pointing)
550 //
551 // Also at this top level there are public members which are used by the FlagAgent classes,
552 // so that there is no dependency with the specific implementation classes (e.g. FlagMsHandler,
553 // FlagCalTableHandler), and thus no re-implementation is required at the FlagAgent level.
554 //
555 // - VisBuffer (for accessing the data and meta data columns)
556 //
557 // - Chunk and casacore::Table flag counters (for statistics)
558 //
559 // </synopsis>
560 //
561 // <motivation>
562 // The motivation for the FlagDataHandler class is having all the data operations encapsulated
563 // in one single class, with a common interface for all types of tables (MSs, CalTables, SingleDish),
564 // so that no specific specific table type implementation has to be done at the FlagAgent level.
565 // </motivation>
566 //
567 // <example>
568 // <srcblock>
569 //
570 // // The following code sets up a FlagDataHandler with either CalTable or casacore::MS implementation and
571 // // iterates through the table applying a clip agent, flushing the flags, and extracting summaries.
572 //
573 // // IMPORTANT NOTE:
574 // // The order of FlagDataHandler and FlagAgent initialization is critical to have everything right,
575 // // in particular data selection must happen before initializing FlagAgents, and iterator generation
576 // // must be done after initializing FlagAgents, so that each agent can communicate to the FlagDataHandler
577 // // which columns have to be pre-fetched (async i/o or parallel mode), and what mapping options are necessary.
578 //
579 // // NOTE ON ASYNC I/O:
580 // // Asyncnronous I/O is only enabled for casacore::MS-type tables, but not for CalTables, and it is necessary to switch
581 // // it on before generating the iterators. Something else to take into account, is that there are 2 global
582 // // switches at .casarc level which invalidate the application code selection:
583 // //
584 // // VisibilityIterator.async.enabled rules over
585 // // |-> FlagDataHandler.asyncio, and in turns rules over
586 // // |-> FlagDataHandler.enableAsyncIO(true)
587 //
588 // // Identify table type
589 // casacore::Table table(msname_p,casacore::TableLock(TableLock::AutoNoReadLocking));
590 // casacore::TableInfo& info = table.tableInfo();
591 // casacore::String type=info.type();
592 //
593 // // Create derived FlagDataHandler object with corresponding implementation
594 // FlagDataHandler *fdh_p = NULL;
595 // if (type == "Measurement Set")
596 // {
597 // fdh_p = new FlagMSHandler(msname_p, FlagDataHandler::COMPLETE_SCAN_UNMAPPED, timeInterval_p);
598 // }
599 // else
600 // {
601 // fdh_p = new FlagCalTableHandler(msname_p, FlagDataHandler::COMPLETE_SCAN_UNMAPPED, timeInterval_p);
602 // }
603 //
604 // // NOTE: It is also possible to independently set the iteration approach via the setIterationApproach
605 // // method which accepts the following modes, defined in the FlagDataHandler iteration enumeration
606 // //
607 // // COMPLETE_SCAN_MAPPED:
608 // // - casacore::Sort by OBSERVATION_ID, ARRAY_ID, SCAN_NUMBER, FIELD_ID, DATA_DESC_ID and TIME
609 // // - Group all time steps together, so that there is no sub-chunk iteration
610 // // - Generate baseline maps (to iterate trough rows with the same antenna1, antenna2)
611 // // - Generate sub-integration maps (to iterate trough rows with the same timestamp)
612 // // COMPLETE_SCAN_MAP_SUB_INTEGRATIONS_ONLY:
613 // // - casacore::Sort by OBSERVATION_ID, ARRAY_ID, SCAN_NUMBER, FIELD_ID, DATA_DESC_ID and TIME
614 // // - Group all time steps together, so that there is no sub-chunk iteration
615 // // * Don't generate baseline maps
616 // // - Generate sub-integration maps (to iterate trough rows with the same timestamp)
617 // // COMPLETE_SCAN_MAP_ANTENNA_PAIRS_ONLY:
618 // // - casacore::Sort by OBSERVATION_ID, ARRAY_ID, SCAN_NUMBER, FIELD_ID, DATA_DESC_ID and TIME
619 // // - Group all time steps together, so that there is no sub-chunk iteration
620 // // - Generate baseline maps (to iterate trough rows with the same antenna1, antenna2)
621 // // * Don't generate sub-integration maps
622 // // COMPLETE_SCAN_UNMAPPED:
623 // // - casacore::Sort by OBSERVATION_ID, ARRAY_ID, SCAN_NUMBER, FIELD_ID, DATA_DESC_ID and TIME
624 // // - Group all time steps together, so that there is no sub-chunk iteration
625 // // * Don't generate baseline maps
626 // // * Don't generate sub-integration maps
627 // // COMBINE_SCANS_MAPPED:
628 // // - casacore::Sort by OBSERVATION_ID, ARRAY_ID, FIELD_ID, DATA_DESC_ID and TIME
629 // // - Group all time steps together, so that there is no sub-chunk iteration
630 // // - Generate baseline maps (to iterate trough rows with the same antenna1, antenna2)
631 // // - Generate sub-integration maps (to iterate trough rows with the same timestamp)
632 // // COMBINE_SCANS_MAP_SUB_INTEGRATIONS_ONLY:
633 // // - casacore::Sort by OBSERVATION_ID, ARRAY_ID, FIELD_ID, DATA_DESC_ID and TIME
634 // // - Group all time steps together, so that there is no sub-chunk iteration
635 // // * Don't generate baseline maps
636 // // - Generate sub-integration maps (to iterate trough rows with the same timestamp)
637 // // COMBINE_SCANS_MAP_ANTENNA_PAIRS_ONLY:
638 // // - casacore::Sort by OBSERVATION_ID, ARRAY_ID, FIELD_ID, DATA_DESC_ID and TIME
639 // // - Group all time steps together, so that there is no sub-chunk iteration
640 // // - Generate baseline maps (to iterate trough rows with the same antenna1, antenna2)
641 // // * Don't generate sub-integration maps
642 // // COMBINE_SCANS_UNMAPPED:
643 // // - casacore::Sort by OBSERVATION_ID, ARRAY_ID, FIELD_ID, DATA_DESC_ID and TIME
644 // // - Group all time steps together, so that there is no sub-chunk iteration
645 // // * Don't generate baseline maps
646 // // * Don't generate sub-integration maps
647 // // ANTENNA_PAIR:
648 // // - casacore::Sort by OBSERVATION_ID, ARRAY_ID, FIELD_ID, ANTENNA1, ANTENNA2, DATA_DESC_ID and TIME
649 // // - Group all time steps together, so that there is no sub-chunk iteration
650 // // * Don't generate baseline maps (they are not necessary because the chunks have constant ANTENNA1,ANTENNA2)
651 // // * Don't generate sub-integration maps
652 // // SUB_INTEGRATION:
653 // // - casacore::Sort by OBSERVATION_ID, ARRAY_ID, SCAN_NUMBER, FIELD_ID, DATA_DESC_ID and TIME
654 // // - Don't group all time steps together, so it is necessary to add an inner sub-chunk iteration loop
655 // // * Don't generate baseline maps (it is not possible because not all the rows corresponding to a given baseline are available)
656 // // * Don't generate sub-integration maps (they are not necessary because the sub-chunks have constant TIME)
657 // // ARRAY_FIELD:
658 // // - casacore::Sort by OBSERVATION_ID, ARRAY_ID, FIELD_ID, DATA_DESC_ID and TIME
659 // // - Don't group all time steps together, so it is necessary to add an inner sub-chunk iteration loop
660 // // * Don't generate baseline maps (it is not possible because not all the rows corresponding to a given baseline are available)
661 // // * Don't generate sub-integration maps (they are not necessary because the sub-chunks have constant TIME)
662 // // * NOTE: This is the iteration approach used by the old flagger framework
663 //
664 // // Open table
665 // fdh_p->open();
666 //
667 // // Parse data selection to Flag casacore::Data Handler
668 // fdh_p->setDataSelection(dataSelection);
669 //
670 // // Select data (thus creating selected table)
671 // fdh_p->selectData();
672 //
673 // // Create flagging agent and list
674 // casacore::Record agentConfig;
675 // agentConfig.define("mode","clip")
676 // FlagAgentBase *agent = FlagAgentBase::create(fdh_p,agentConfig);
677 // FlagAgentList agentList;
678 // agentList.push_back(agent);
679 //
680 // // Switch on/off async i/p
681 // fdh_p->enableAsyncIO(true);
682 //
683 // // Generate table iterator
684 // fdh_p->generateIterator();
685 //
686 // // Start Flag Agent
687 // agentList.start();
688 //
689 // // Iterates over chunks (constant column values)
690 // while (fdh_p->nextChunk())
691 // {
692 // // Iterates over buffers (time steps)
693 // while (fdh_p->nextBuffer())
694 // {
695 // // Apply flags
696 // agentList.apply();
697 // // Flush flag cube
698 // fdh_p->flushFlags();
699 // }
700 //
701 // // Print end-of-chunk statistics
702 // agentList.chunkSummary();
703 // }
704 //
705 // // Print total stats from each agent
706 // agentList.msSummary();
707 //
708 // // Stop Flag Agent
709 // agentList.terminate();
710 // agentList.join();
711 //
712 // // Close MS
713 // fdh_p->close();
714 //
715 // // Clear Flag Agent List
716 // agentList.clear();
717 //
718 // </srcblock>
719 // </example>
720 //
721 // <example>
722 // <srcblock>
723 //
724 // // The following code shows the FlagAgent-FlagDataHandler interaction works internally:
725 //
726 // // First of all, at construction time, each agent has to communicate to the FlagDataHandler
727 // // which columns have to be pre-fetched (for async i/o or parallel mode) and what mapping
728 // // options are necessary
729 
730 // // ...for instance in the case of FlagAgentShadow we need Ant1,Ant2,UVW,TimeCentroid and PhaseCenter:
731 // flagDataHandler_p->preLoadColumn(vi::Antenna1);
732 // flagDataHandler_p->preLoadColumn(vi::Antenna2);
733 // flagDataHandler_p->preLoadColumn(vi::uvw);
734 // flagDataHandler_p->preLoadColumn(vi::TimeCentroid);
735 // flagDataHandler_p->preLoadColumn(vi::PhaseCenter);
736 //
737 // // ...and FlagAgentElevation needs to have the antenna pointing information globally available for each chunk:
738 // flagDataHandler_p->setMapAntennaPointing(true);
739 //
740 // // Then, at iteration time, the FlagAgentBase class has access to the VisBuffer held
741 // // in the FlagDataHandler, in order to retrieve the meta-data columns needed for the
742 // // data selection engine (agent-level row filtering).
743 // // NOTE: The VisBuffer is actually held within an auto-pointer wrapper,
744 // // thus there is an additional get() involved when accessing it.
745 //
746 // if (spwList_p.size())
747 // {
748 // if (!find(spwList_p,visibilityBuffer_p->get()->spectralWindow())) return false;
749 // }
750 //
751 // // The sorting columns used for the iteration are also accessible to optimize the selection engine:
752 // // (e.g.: If scan is constant check only 1st row)
753 // if ( (scanList_p.size()>0) and (find(flagDataHandler_p->sortOrder_p,casacore::MS::SCAN_NUMBER)==true) )
754 // {
755 // if (!find(scanList_p,visibilityBuffer_p->get()->scan()[0])) return false;
756 // }
757 //
758 // // Once that chunk/rows are evaluated as eligible for the flagging process
759 // // by the data selection engine, the previously booked maps at construction
760 // // time can be access in order to iterate trough the data as desired:
761 // // e.g.: Baseline (antenna pairs) iteration
762 // for (myAntennaPairMapIterator=flagDataHandler_p->getAntennaPairMap()->begin();
763 // myAntennaPairMapIterator != flagDataHandler_p->getAntennaPairMap()->end();
764 // ++myAntennaPairMapIterator)
765 // {
766 // // NOTE: The following code is also encapsulated in the FlagAgentBase::processAntennaPair(casacore::Int antenna1,casacore::Int antenna2) code
767 //
768 // // From the antenna map we can retrieve the rows corresponding to the baseline defined by the antenna pair
769 // std::vector<casacore::uInt> baselineRows = (*flagDataHandler_p->getAntennaPairMap())[std::make_pair(antennaPair.first,antennaPair.second)];
770 //
771 // // This rows can be now inserted in the mapper classes (VisMapper and FlagMapper using the CubeView<T> template class)
772 // VisMapper visibilitiesMap = VisMapper(expression_p,flagDataHandler_p->getPolarizationMap());
773 // FlagMapper flagsMap = FlagMapper(flag_p,visibilitiesMap.getSelectedCorrelations());
774 // setVisibilitiesMap(antennaRows,&visibilitiesMap);
775 // setFlagsMap(antennaRows,&flagsMap);
776 // }
777 //
778 // // Finally, after flagging time, the FlagAgent can communicate to the FlagDataHandler
779 // // that the modified FlagCube has to be flushed to disk, this is a small but very important
780 // // step in order to avoid unnecessary I/O activity when a chunk is not eligible for flagging
781 // // or the auto-flagging algorithms don't produce any flags.
782 //
783 // // If any row was flag, then we have to flush the flagRow
784 // if (flagRow_p) flagDataHandler_p->flushFlagRow_p = true;
785 // // If any flag was raised, then we have to flush the flagCube
786 // if (visBufferFlags_p>0) flagDataHandler_p->flushFlags_p = true;
787 //
788 // </srcblock>
789 // </example>
790 
792 {
793 
794 public:
795 
796  enum iteration {
797 
809  };
810 
811  enum tableType {
812 
815  };
816 
817  // Default constructor
818  // NOTE: casacore::Time interval 0 groups all time steps together in one chunk.
819  FlagDataHandler(string msname, casacore::uShort iterationApproach = SUB_INTEGRATION, casacore::Double timeInterval = 0);
820 
821  // Default destructor
822  virtual ~FlagDataHandler();
823 
824  // Common casacore::MS/CalTables public interface
825  virtual bool open() {return false;}
826  virtual bool close() {return false;}
827  virtual bool selectData() {return false;}
828  virtual bool generateIterator() {return false;}
829  virtual bool nextChunk() {return false;}
830  virtual bool nextBuffer() {return false;}
831  virtual bool flushFlags() {return false;}
832  virtual casacore::String getTableName() {return casacore::String("none");}
833  virtual bool parseExpression(casacore::MSSelection &/*parser*/) {return true;}
834  virtual bool checkIfColumnExists(casacore::String /*column*/) {return true;}
835  virtual bool checkIfSourceModelColumnExists() {return false;}
836  virtual bool summarySignal() {return true;}
837 
838  // Set the iteration approach
839  void setIterationApproach(casacore::uShort iterationApproach);
840 
841  // Set casacore::Data Selection parameters
842  bool setDataSelection(casacore::Record record);
843 
844  // Set time interval (also known as ntime)
845  void setTimeInterval(casacore::Double timeInterval);
846 
847  // Methods to switch on/off async i/o
848  void enableAsyncIO(casacore::Bool enable);
849 
850  // Pre-Load columns (in order to avoid parallelism problems when not using
851  // async i/o, and also to know what columns to pre-fetch in async i/o mode)
852  void preLoadColumn(VisBufferComponent2 column);
853  void preFetchColumns();
854 
855  // Stop iterating
856  void stopIteration() {stopIteration_p = true;};
857 
858  // As requested by Urvashi R.V. provide access to the original and modified flag cubes
863 
864  // Functions to switch on/off mapping functions
865  void setMapAntennaPairs(bool activated);
866  void setMapSubIntegrations(bool activated);
867  void setMapPolarizations(bool activated);
868  void setMapAntennaPointing(bool activated);
869  void setScanStartStopMap(bool activated);
870  void setScanStartStopFlaggedMap(bool activated);
871  void setTimeAverageIter(bool activated);
873 
874  // Accessors for the mapping functions
882 
884 
885  // Get a casacore::Float visCube and return a casacore::Complex one
888 
889  // Make the logger public to that we can use it from FlagAgentBase::create
891 
892  // Measurement set section
896  std::map< string, std::pair<casacore::Int,casacore::Int> > baselineToAnt1Ant2_p;
897  std::map< std::pair<casacore::Int,casacore::Int>, string > Ant1Ant2ToBaseline_p;
901  std::vector<casacore::String> *corrProducts_p;
902 
903  // RO Visibility Iterator
905  // Iteration counters
909 
910  // FlagDataHanler-FlagAgents interaction
920 
921  // PROCESSOR sub-table section
924 
925 
926  // Visibility Buffer
927  // WARNING: The attach mechanism only works with pointers or
928  // referenced variables. Otherwise the VisBuffer is created
929  // and attached, but when it is assigned to the member it is
930  // detached because of the dynamically called destructor
932 
933  // Vis buffer characteristics (constant values)
936 
937  // casacore::Time average iterator parameters
945 
946 protected:
947 
948  // Common casacore::MS/CalTables private interface
949  virtual void generateAntennaPairMap();
950  virtual void generateSubIntegrationMap();
951  virtual void generatePolarizationsMap();
952  virtual void generateAntennaPointingMap();
953  virtual void generateScanStartStopMap();
954 
955  // casacore::Data Selection ranges
968 
969  // Async I/O stuff
971  // Pre-Load columns (in order to avoid parallelism problems when not using
972  // async i/o, and also to know what columns to pre-fetch in async i/o mode)
973  std::vector<VisBufferComponent2> preLoadColumns_p;
974 
975  // Iteration parameters
978  // Slurp flag
979  bool slurp_p;
980  // Iteration initialization parameters
985 
986  // Flag Cubes
989 
990  // FlagRows
993 
994  // Mapping members
1008 
1009  // Stats members
1010  bool stats_p;
1015 
1016  // Profiling
1018 };
1019 
1020 } //# NAMESPACE CASA - END
1021 
1022 #endif /* FLAGDATAHANDLER_H_ */
void setTimeInterval(casacore::Double timeInterval)
Set time interval (also known as ntime)
void setScanStartStopFlaggedMap(bool activated)
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
casacore::uLong processedRows
Iteration counters.
virtual bool generateIterator()
casacore::String scanIntentSelection_p
virtual bool selectData()
casacore::Complex calsol4(casacore::uInt chan, casacore::uInt row)
std::map< casacore::uInt, casacore::String > polarizationIndexMap
A 1-D Specialization of the Array class.
int Int
Definition: aipstype.h:50
casacore::uInt nSelectedCorrelations_p
casacore::String dataColumnType_p
T & operator()(casacore::uInt i1)
void applyFlagInRow(casacore::uInt row)
T & accessUnmapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
casacore::Record chanAvgOptions_p
LatticeExprNode arg(const LatticeExprNode &expr)
casacore::String scanSelection_p
virtual bool checkIfSourceModelColumnExists()
std::vector< casacore::uInt > * polarizations_p
void setProfiling(casacore::Bool value)
casacore::String fieldSelection_p
const casacore::IPosition & shape() const
NOTE: reducedLength_p is defined as [chan,row,pol].
casacore::Complex diffVis(casacore::uInt pol, casacore::uInt chan, casacore::uInt row)
bool profiling_p
Profiling.
A top level class defining the data handling interface for the flagging module.
casacore::Complex leftVis(casacore::uInt pol, casacore::uInt chan, casacore::uInt row)
casacore::Vector< casacore::Bool > modifiedFlagRow_p
void setExpressionMapping(casacore::String expression, polarizationMap *polMap)
casacore::String expression_p
casacore::Complex stokes_q_from_linear(casacore::uInt chan, casacore::uInt row)
casacore::Float imag(casacore::Complex val)
void setExpressionMapping(std::vector< std::vector< casacore::uInt > > selectedCorrelations)
casacore::Complex calsol1(casacore::uInt chan, casacore::uInt row)
virtual void generateScanStartStopMap()
casacore::IPosition reducedLength_p
bool stats_p
Stats members.
void shape(casacore::Int &chan, casacore::Int &row) const
casacore::Bool getModifiedFlags(casacore::uInt chan, casacore::uInt row)
const casacore::Complex ImaginaryUnit
casacore::Cube< casacore::Complex > & weightVisCube()
Get a casacore::Float visCube and return a casacore::Complex one.
void setParentFlagRow(VectorView< casacore::Bool > *commonFlagRowView, VectorView< casacore::Bool > *originalFlagRowView, VectorView< casacore::Bool > *privateFlagRowView=NULL)
void(casa::FlagMapper::* applyFlagRow_p)(casacore::uInt)
polarizationIndexMap * getPolarizationIndexMap()
casacore::Bool getPrivateFlags(casacore::uInt chan, casacore::uInt row)
T & accessIndex1Mapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
casacore::IPosition reducedLength_p
casacore::Vector< casacore::Int > chanAverageBin_p
casacore::Vector< casacore::Bool > * getModifiedFlagRow()
unsigned long long uInt64
Definition: aipsxtype.h:39
casacore::Bool enableTimeAvg_p
casacore::Time average iterator parameters
The number of StokesTypes.
Definition: Stokes.h:125
casacore::Double timeInterval_p
casacore::LogIO * logger_p
Make the logger public to that we can use it from FlagAgentBase::create.
void shape(casacore::Int &pol, casacore::Int &chan, casacore::Int &row) const
casacore::Float arg(casacore::Complex val)
casacore::uLong cubeAccessCounter_p
std::vector< casacore::uInt > * createIndex(casacore::uInt size)
T & accessIndex12Mapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
casacore::Bool getOriginalFlagRow(casacore::uInt row)
A 3-D Specialization of the Array class.
void shape(casacore::Int &s1) const
void setTimeAverageIter(bool activated)
VectorView< casacore::Bool > * privateFlagRowView_p
scanStartStopMap * getMapScanStartStop()
T & accessMapped(casacore::uInt i1)
virtual casacore::String getTableName()
casacore::Vector< T > * parentVector_p
CubeView< casacore::Complex > * rightVis_p
casacore::uInt64 progressCounts_p
void stopIteration()
Stop iterating.
std::map< casacore::Int, std::vector< casacore::Double > > scanStartStopMap
casacore::Complex correlationProduct(casacore::uInt pol, casacore::uInt chan, casacore::uInt row)
Direct access to the complex correlation product.
antennaPairMap * getAntennaPairMap()
Accessors for the mapping functions.
std::map< casacore::uShort, casacore::uShort > polarizationMap
casacore::Cube< casacore::Bool > * getModifiedFlagCube()
As requested by Urvashi R.V.
std::vector< casacore::String > * corrProducts_p
virtual ~FlagDataHandler()
Default destructor.
ostream-like interface to creating log messages.
Definition: LogIO.h:167
CubeView< casacore::Complex > * leftVis_p
casacore::Bool flag_p
casacore::Vector< casacore::Bool > * getOriginalFlagRow()
std::map< casacore::Double, std::vector< casacore::uInt > > subIntegrationMap
void setParentCubes(CubeView< casacore::Complex > *leftVis, CubeView< casacore::Complex > *rightVis=NULL)
T norm(const casacore::Vector< T > &x)
The magnitude/norm of a vector.
casacore::uShort bufferNo
VisBufferComponents2 * prefetchColumns_p
RO Visibility Iterator.
FlagMapper(casacore::Bool flag, std::vector< std::vector< casacore::uInt > > selectedCorrelations, CubeView< casacore::Bool > *commonFlagsView, CubeView< casacore::Bool > *originalFlagsView, CubeView< casacore::Bool > *privateFlagsView=NULL, VectorView< casacore::Bool > *commonFlagRowView=NULL, VectorView< casacore::Bool > *originalFlagRowView=NULL, VectorView< casacore::Bool > *privateFlagRowView=NULL)
casacore::String timeSelection_p
T & accessIndex2Mapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
void applyPrivateFlagRow(casacore::uInt row)
Apply flags to common and private flag rows.
casacore::Float norm(casacore::Complex val)
casacore::Complex calsol2(casacore::uInt chan, casacore::uInt row)
size_t size() const
const casacore::IPosition & shape() const
casacore::Vector< bool > isCorrelatorType_p
PROCESSOR sub-table section.
std::vector< std::vector< casacore::Double > > antennaPointingMap
T &(casa::CubeView< T >::* access_p)(casacore::uInt, casacore::uInt, casacore::uInt)
casacore::Complex stokes_i(casacore::uInt pol, casacore::uInt chan)
bool slurp_p
Slurp flag.
casacore::uShort tableTye_p
VectorView(casacore::Vector< T > *parentVector, std::vector< casacore::uInt > *rows=NULL)
std::map< std::pair< casacore::Int, casacore::Int >, std::vector< casacore::uInt > > antennaPairMap
casacore::Cube< T > * parentCube_p
void checkCommonFlags(casacore::uInt pol, casacore::uInt channel, casacore::uInt row)
Apply flags to common and private flag cubes.
std::map< casacore::Int, casacore::Double > lambdaMap
casacore::uInt flagsPerRow_p
casacore::Cube< casacore::Bool > originalFlagCube_p
Flag Cubes.
casacore::IPosition reducedLength_p
casacore::Complex stokes_u_from_circular(casacore::uInt chan, casacore::uInt row)
T &(casa::VectorView< T >::* access_p)(casacore::uInt)
casacore::uShort chunkNo
VectorView< casacore::Bool > * commonFlagRowView_p
void setMapSubIntegrations(bool activated)
casacore::MSSelection * measurementSetSelection_p
casacore::Complex linear_yy(casacore::uInt pol, casacore::uInt chan)
casacore::Cube< casacore::Complex > weight_spectrum_p
std::map< std::pair< casacore::Int, casacore::Int >, std::vector< casacore::uInt > >::iterator antennaPairMapIterator
Type definitions.
polarizationMap * getPolarizationMap()
void setMapAntennaPairs(bool activated)
Functions to switch on/off mapping functions.
casacore::Complex circular_ll(casacore::uInt pol, casacore::uInt chan)
std::vector< casacore::uInt > * createIndex(casacore::uInt size)
virtual bool checkIfColumnExists(casacore::String)
casacore::Complex stokes_i_from_circular(casacore::uInt chan, casacore::uInt row)
casacore::String observationSelection_p
void setChanAverageIter(casacore::Vector< casacore::Int > chanbin)
const casacore::IPosition & shape() const
T & accessIndex23Mapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
void setMapPolarizations(bool activated)
void setPrivateFlags(casacore::uInt pol, casacore::uInt channel, casacore::uInt row)
std::map< casacore::uShort, casacore::uShort >::iterator polartizationMapIterator
VectorView< casacore::Bool > * originalFlagRowView_p
antennaPointingMap * getMapAntennaPointing()
casacore::Bool loadProcessorTable_p
std::vector< casacore::uInt > * rows_p
bool setDataSelection(casacore::Record record)
Set casacore::Data Selection parameters.
virtual bool nextChunk()
std::vector< std::vector< casacore::uInt > > selectedCorrelations_p
casacore::Vector< casacore::Bool > originalFlagRow_p
FlagRows.
casacore::String uvwSelection_p
casacore::Complex stokes_i_from_linear(casacore::uInt chan, casacore::uInt row)
std::vector< casacore::uInt > * channels_p
double Double
Definition: aipstype.h:55
scanStartStopMap * scanStartStopMap_p
LatticeExprNode abs(const LatticeExprNode &expr)
Numerical 1-argument functions which result in a real number regardless of input expression type...
casacore::Vector< casacore::Double > * antennaDiameters_p
antennaPointingMap * antennaPointingMap_p
void applyCommonFlags(casacore::uInt pol, casacore::uInt channel, casacore::uInt row)
Apply flags to common flag cube.
const IPosition & shape() const
The length of the Vector.
Definition: Vector.h:293
casacore::Cube< casacore::Bool > modifiedFlagCube_p
casacore::Complex linear_xx(casacore::uInt pol, casacore::uInt chan)
casacore::Complex(casa::VisMapper::* corrProduct)(casacore::uInt, casacore::uInt)
casacore::Float(casa::VisMapper::* applyVisExpr_p)(casacore::Complex)
casacore::Complex stokes_u(casacore::uInt pol, casacore::uInt chan)
void setScanStartStopMap(bool activated)
casacore::Vector< casacore::String > * fieldNames_p
casacore::String arraySelection_p
casacore::Bool getModifiedFlagRow(casacore::uInt row)
antennaPairMap * antennaPairMap_p
Mapping members.
bool groupTimeSteps_p
Vis buffer characteristics (constant values)
casacore::uShort summaryThreshold_p
lambdaMap * getLambdaMap()
MSSelection: Class to represent a selection on an MS.
Definition: MSSelection.h:118
casacore::Complex stokes_v_from_linear(casacore::uInt chan, casacore::uInt row)
void(casa::FlagMapper::* applyFlag_p)(casacore::uInt, casacore::uInt, casacore::uInt)
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 void generateSubIntegrationMap()
const casacore::IPosition & shape() const
casacore::uInt flagsPerRow()
casacore::uInt nSelectedCorrelations()
FlagDataHandler(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::Float operator()(casacore::uInt chan, casacore::uInt row)
casacore::Float real(casacore::Complex val)
casacore::Cube< casacore::Bool > * getOriginalFlagCube()
bool chunksInitialized_p
Iteration initialization parameters.
casacore::String baselineSelection_p
float Float
Definition: aipstype.h:54
CubeView< casacore::Bool > * privateFlagsView_p
casacore::Float abs(casacore::Complex val)
T & operator()(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
casacore::Complex stokes_v_from_circular(casacore::uInt chan, casacore::uInt row)
vi::AveragingOptions timeAvgOptions_p
VisMapper(casacore::String expression, polarizationMap *polMap, CubeView< casacore::Complex > *leftVis, CubeView< casacore::Complex > *rightVis=NULL)
casacore::Complex(casa::VisMapper::* getVis_p)(casacore::uInt, casacore::uInt, casacore::uInt)
casacore::uShort iterationApproach_p
Iteration parameters.
void preLoadColumn(VisBufferComponent2 column)
Pre-Load columns (in order to avoid parallelism problems when not using async i/o, and also to know what columns to pre-fetch in async i/o mode)
bool asyncio_enabled_p
Async I/O stuff.
unsigned long uLong
Definition: aipstype.h:53
virtual bool open()
Common casacore::MS/CalTables public interface.
void setIterationApproach(casacore::uShort iterationApproach)
Set the iteration approach.
std::vector< VisBufferComponent2 > preLoadColumns_p
Pre-Load columns (in order to avoid parallelism problems when not using async i/o, and also to know what columns to pre-fetch in async i/o mode)
std::vector< string > selectedCorrelationStrings_p
casacore::Complex linear_yx(casacore::uInt pol, casacore::uInt chan)
polarizationMap * polarizationMap_p
std::vector< std::vector< casacore::uInt > > getSelectedCorrelations()
std::vector< casacore::uInt > * rows_p
casacore::uLong cubeAccessCounterTotal_p
void enableAsyncIO(casacore::Bool enable)
Methods to switch on/off async i/o.
casacore::Vector< casacore::String > * antennaNames_p
casacore::Complex calsol3(casacore::uInt chan, casacore::uInt row)
bool flushFlags_p
FlagDataHanler-FlagAgents interaction.
CubeView< casacore::Bool > * originalFlagsView_p
casacore::Block< int > sortOrder_p
We need to have the CubeView definition here because its type is used by FlagDataHandler class...
subIntegrationMap * getSubIntegrationMap()
casacore::IPosition reducedLength_p
void shape(casacore::Int &s1, casacore::Int &s2, casacore::Int &s3) const
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
void applyPrivateFlags(casacore::uInt pol, casacore::uInt channel, casacore::uInt row)
Apply flags to common and private flag cubes.
virtual bool summarySignal()
std::vector< std::vector< casacore::uInt > > selectedCorrelations_p
void setMapAntennaPointing(bool activated)
casacore::String spwSelection_p
casacore::Complex circular_rl(casacore::uInt pol, casacore::uInt chan)
void shape(casacore::Int &chan, casacore::Int &row) const
CubeView(casacore::Cube< T > *parentCube, std::vector< casacore::uInt > *rows=NULL, std::vector< casacore::uInt > *channels=NULL, std::vector< casacore::uInt > *polarizations=NULL)
CubeView< casacore::Bool > * commonFlagsView_p
void setModifiedFlags(casacore::uInt pol, casacore::uInt channel, casacore::uInt row)
These methods are needed for flag extension.
virtual bool parseExpression(casacore::MSSelection &)
casacore::Complex linear_xy(casacore::uInt pol, casacore::uInt chan)
casacore::Complex stokes_q_from_circular(casacore::uInt chan, casacore::uInt row)
virtual void generateAntennaPairMap()
Common casacore::MS/CalTables private interface.
std::vector< std::vector< casacore::uInt > > getSelectedCorrelations()
T & accessIndex13Mapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
std::vector< corrProduct > selectedCorrelationProducts_p
casacore::Complex (casa::VisMapper::*getCorr_p)(casacore::uInt,casacore::uInt);
T & accessIndex3Mapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
vi::VisBuffer2 * visibilityBuffer_p
Visibility Buffer WARNING: The attach mechanism only works with pointers or referenced variables...
virtual bool nextBuffer()
std::vector< string > getSelectedCorrelationStrings()
std::map< casacore::Double, std::vector< casacore::uInt > >::iterator subIntegrationMapIterator
virtual bool flushFlags()
std::map< std::pair< casacore::Int, casacore::Int >, string > Ant1Ant2ToBaseline_p
casacore::uInt64 chunkCounts_p
virtual void generatePolarizationsMap()
casacore::Double timeAverageBin_p
casacore::Bool getPrivateFlagRow(casacore::uInt row)
This class encapsulates an enum with values corresponding to the various data components accessible v...
subIntegrationMap * subIntegrationMap_p
casacore::Bool enableChanAvg_p
bool anySelection_p
casacore::Data Selection ranges
casacore::Complex circular_lr(casacore::uInt pol, casacore::uInt chan)
casacore::Complex circular_rr(casacore::uInt pol, casacore::uInt chan)
polarizationIndexMap * polarizationIndexMap_p
void shape(casacore::Int &pol, casacore::Int &chan, casacore::Int &row) const
void applyFlagRow(casacore::uInt row)
casacore::ScalarMeasColumn< casacore::MPosition > * antennaPositions_p
T & accessMapped(casacore::uInt i1, casacore::uInt i2, casacore::uInt i3)
casacore::String polarizationSelection_p
void setParentCubes(CubeView< casacore::Bool > *commonFlagsView, CubeView< casacore::Bool > *originalFlagsView, CubeView< casacore::Bool > *privateFlagsView=NULL)
casacore::String tablename_p
Measurement set section.
std::map< string, std::pair< casacore::Int, casacore::Int > > baselineToAnt1Ant2_p
T & accessUnmapped(casacore::uInt i1)
casacore::Complex stokes_q(casacore::uInt pol, casacore::uInt chan)
void applyCommonFlagRow(casacore::uInt row)
Apply flags to common flag rows.
casacore::Complex stokes_u_from_linear(casacore::uInt chan, casacore::uInt row)
void applyFlag(casacore::uInt chan, casacore::uInt row)
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
unsigned int uInt
Definition: aipstype.h:51
polarizationMap * polMap_p
unsigned short uShort
Definition: aipstype.h:49
casacore::Bool getOriginalFlags(casacore::uInt chan, casacore::uInt row)
virtual void generateAntennaPointingMap()
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42
casacore::Complex stokes_v(casacore::uInt pol, casacore::uInt chan)
casacore::uInt64 msCounts_p