casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSTransformManager.h
Go to the documentation of this file.
1 //# MSTransformManager.h: This file contains the interface definition of the MSTransformManager 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 MSTransformManager_H_
24 #define MSTransformManager_H_
25 
26 // To handle configuration records
28 
29 // To handle variant parameters
31 
32 // Measurement Set Selection
33 #include <ms/MSSel/MSSelection.h>
34 
35 // casacore::Data handling
37 
38 // Regridding
40 
41 // VisibityIterator / VisibilityBuffer framework
43 #include <msvis/MSVis/VisBuffer2.h>
45 
46 // TVI framework
52 
53 // THis is needed just because of vi::AveragingTvi2::weightToSigma
55 
56 // To apply hanning smooth
58 
59 // To apply fft shift
61 
62 // To apply 1D interpolations
64 
65 // single dish specific
67 
68 #include <map>
69 
70 namespace casa { //# NAMESPACE CASA - BEGIN
71 
72 // Forward declarations
73 class MSTransformBufferImpl;
74 class MSTransformIterator;
75 class MSTransformIteratorFactory;
76 
77 // casacore::MS Transform Framework utilities
78 namespace MSTransformations
79 {
80  // Returns 1/sqrt(wt) or -1, depending on whether wt is positive..
83 
85  // nearest neighbour
87  // linear
89  // cubic
91  // cubic spline
93  // fft shift
95  };
96 
107  };
108 
112  };
113 
114  enum dataCol {
121  };
122 
124 
128  };
129 }
130 
131 // Forward declarations
132 struct spwInfo;
134 
135 // casacore::Map definition
136 typedef map<casacore::MS::PredefinedColumns,casacore::MS::PredefinedColumns> dataColMap;
137 typedef map< pair< pair<casacore::uInt,casacore::uInt> , casacore::uInt >,std::vector<casacore::uInt> > baselineMap;
138 typedef map<casacore::uInt,map<casacore::uInt, casacore::uInt > > inputSpwChanMap;
139 typedef map<casacore::uInt,vector < channelContribution > > inputOutputChanFactorMap;
140 typedef map<casacore::uInt,pair < spwInfo, spwInfo > > inputOutputSpwMap;
141 
142 // Struct definition
143 struct channelInfo {
144 
152  std::vector<casacore::Double> contribFrac;
153  std::vector<casacore::Int> contribChannel;
154  std::vector<casacore::Int> contribSPW_id;
155 
157  {
158  SPW_id = -1;
159  inpChannel = 0;
160  outChannel = 0;
161 
162  CHAN_FREQ = -1;
163  CHAN_WIDTH = -1;
164  EFFECTIVE_BW = -1;
165  RESOLUTION = -1;
166  }
167 
168  bool operator<(const channelInfo& right_operand) const
169  {
170  if (CHAN_FREQ<right_operand.CHAN_FREQ)
171  {
172  return true;
173  }
174  else
175  {
176  return false;
177  }
178  }
179 
181  {
182  return CHAN_FREQ + 0.5 * std::abs(CHAN_WIDTH);
183  }
184 
186  {
187  return CHAN_FREQ - 0.5 * std::abs(CHAN_WIDTH);
188  }
189 
191  {
192 
193  // The other channel completely covers this channel
194  if ((lowerBound() <= other.lowerBound()) and (upperBound() >= other.upperBound()))
195  {
196  return 1.0;
197  }
198  // The other channel is completely covered by this channel
199  else if ((lowerBound() >= other.lowerBound()) and (upperBound() <= other.upperBound()))
200  {
201  return CHAN_WIDTH/other.CHAN_WIDTH;
202  }
203  // Lower end of this channel is overlapping with the other channel
204  else if (lowerBound() < other.lowerBound() && other.lowerBound() < upperBound() && upperBound() < other.upperBound())
205  {
206  return (upperBound()-other.lowerBound())/other.CHAN_WIDTH;
207  }
208  // Upper end of this channel is overlapping with the other channel
209  else if (other.lowerBound() < lowerBound() && lowerBound() < other.upperBound() && other.upperBound() < upperBound())
210  {
211  return (other.upperBound()-lowerBound())/other.CHAN_WIDTH;
212  }
213  else
214  {
215  return 0.0;
216  }
217 
218  }
219 };
220 
222 
228 
230  {
231  inpSpw = 0;
232  inpChannel = 0;
233  outChannel = 0;
234  weight = 0;
235  flag = false;
236  }
237 
238  channelContribution(casacore::Int inputSpw, casacore::uInt inputChannel, casacore::uInt outputChannel,casacore::Double fraction)
239  {
240  inpSpw = inputSpw;
241  inpChannel = inputChannel;
242  outChannel = outputChannel;
243  weight = fraction;
244  flag = true;
245  }
246 };
247 
248 struct spwInfo {
249 
251  {
252  initialize(0);
253  }
254 
256  {
257  initialize(nChannels);
258  }
259 
261  {
262  reset(chanFreq,chanWidth);
263  }
264 
266  {
267  initialize(chanFreq.size());
268  CHAN_FREQ = chanFreq;
269  CHAN_WIDTH = chanWidth;
270  update();
271  }
272 
273  void initialize(casacore::uInt nChannels)
274  {
275  NUM_CHAN = nChannels;
276  CHAN_FREQ.resize(nChannels,false);
277  CHAN_WIDTH.resize(nChannels,false);
278  EFFECTIVE_BW.resize(nChannels,false);
279  RESOLUTION.resize(nChannels,false);
280  CHAN_FREQ_aux.resize(nChannels,false);
281  TOTAL_BANDWIDTH = 0;
282  REF_FREQUENCY = 0;
283  upperBound = 0;
284  lowerBound = 0;
285  }
286 
287  void update()
288  {
289  if (CHAN_FREQ(NUM_CHAN - 1) > CHAN_FREQ(0)) {
291  lowerBound = CHAN_FREQ(0) - 0.5 * std::abs(CHAN_WIDTH(0));
292  // ensure width is positive
293  for (auto it = CHAN_WIDTH.begin(); it != CHAN_WIDTH.end(); ++it) {
294  *it = std::abs(*it);
295  }
296  }
297  else {
298  upperBound = CHAN_FREQ(0) + 0.5 * std::abs(CHAN_WIDTH(0));
300  // ensure width is negative, may not be the case regridding (without combine)
301  // preserves the sign but the width computation is always positive due to use
302  // of original combine+regrid cvel code that converts all channels to ascending
303  for (auto it = CHAN_WIDTH.begin(); it != CHAN_WIDTH.end(); ++it) {
304  if (*it > 0) {
305  *it = -*it;
306  }
307  }
308  }
309 
312 
316  }
317 
318  void resize(casacore::uInt nChannels)
319  {
320  NUM_CHAN = nChannels;
321  CHAN_FREQ.resize(nChannels,true);
322  CHAN_WIDTH.resize(nChannels,true);
323  EFFECTIVE_BW.resize(nChannels,true);
324  RESOLUTION.resize(nChannels,true);
325  CHAN_FREQ_aux.resize(nChannels,true);
326  update();
327  }
328 
339 };
340 
341 // MSTransformManager definition
343 {
344 
345  friend class MSTransformBufferImpl;
346  friend class MSTransformIterator;
348 
349 public:
350 
352  MSTransformManager(casacore::Record configuration);
353 
354  virtual ~MSTransformManager();
355 
356  void initialize();
357  void configure(casacore::Record &configuration);
358 
359  void open();
360  void setup();
361  void close();
362 
364  void fillOutputMs(vi::VisBuffer2 *vb);
365 
366  // For buffer handling classes (MSTransformIterator)
367 
368  // Needed by MSTransformIteratorFactory
370 
371  // Needed by MSTransformIterator
374 
375  // Needed by MSTransformBuffer
379 
380  // Need by tMSTransformIterator
382 
383 
384 
385 protected:
386 
387  void parseMsSpecParams(casacore::Record &configuration);
388  void parseDataSelParams(casacore::Record &configuration);
389  void parseFreqTransParams(casacore::Record &configuration);
390  void parseChanAvgParams(casacore::Record &configuration);
391  void parseRefFrameTransParams(casacore::Record &configuration);
392  void parseFreqSpecParams(casacore::Record &configuration);
393  void parsePhaseShiftParams(casacore::Record &configuration);
394  void parseTimeAvgParams(casacore::Record &configuration);
395  void parseCalParams(casacore::Record &configuration);
396  void parseUVContSubParams(casacore::Record &configuration);
397  void setSpwAvg(casacore::Record &configuration);
398  void parsePolAvgParams(casacore::Record &configuration);
400 
401  // From input MS
404 
405  // To re-grid SPW subtable
409  void regridSpwSubTable();
412  void regridSpwAux(casacore::Int spwId, casacore::MFrequency::Types spwInputRefFrame,
413  casacore::Vector<casacore::Double> &inputCHAN_FREQ,
414  casacore::Vector<casacore::Double> &inputCHAN_WIDTH,
415  casacore::Vector<casacore::Double> &originalCHAN_FREQ,
416  casacore::Vector<casacore::Double> &originalCHAN_WIDTH,
417  casacore::Vector<casacore::Double> &regriddedCHAN_FREQ,
418  casacore::Vector<casacore::Double> &regriddedCHAN_WIDTH,
419  string msg);
420 
422  void reindexSourceSubTable();
423  void reindexDDISubTable();
424  void reindexFeedSubTable();
425  void reindexSysCalSubTable();
428 
429  void separateSpwSubtable();
430  void separateFeedSubtable();
431  void separateSourceSubtable();
432  void separateSyscalSubtable();
436 
437  // To average polarization components
439  void reindexPolarizationIdInDataDesc(casacore::Int newPolarizationId);
440 
441  // Setters for Weight-based transformation
443  void setBufferMode(casacore::Bool on);
447 
448  // Drop channels with non-uniform width when doing channel average
450 
451  // From output MS
453 
455  Vector<Double> &inputCHAN_FREQ,
456  Vector<Double> &inputCHAN_WIDTH,
457  const Vector<Double> &originalCHAN_FREQ,
458  const Vector<Double> &originalCHAN_WIDTH,
459  const Vector<Double> &regriddedCHAN_FREQ,
460  const Vector<Double> &regriddedCHAN_WIDTH);
461  void doPreAveragingBeforeRegridding(uInt widthFactor, Int spwId,
462  const Vector<Double> &originalCHAN_FREQ,
463  const Vector<Double> &originalCHAN_WIDTH,
464  Vector<Double> &inputCHAN_FREQ,
465  Vector<Double> &inputCHAN_WIDTH);
466 
467  // For channel averaging and selection
469  const casacore::Vector<casacore::Double> &inputChanFreq,
470  const casacore::Vector<casacore::Double> &inputChanWidth,
471  casacore::Vector<casacore::Double> &intermediateChanFreq,
472  casacore::Vector<casacore::Double> &intermediateChanWidth);
473 
474  void initGridForRegridTClean(const Vector<Double> &originalCHAN_FREQ,
475  const Vector<Double> &regriddedCHAN_FREQ,
476  const Vector<Double> &regriddedCHAN_WIDTH,
477  Double widthFactor);
478 
479 
482 
483  // Column check
484  void checkFillFlagCategory();
487  void checkDataColumnsToFill();
488  void colCheckInfo(const casacore::String& inputColName, const casacore::String& outputColName);
491 
492  // Iterator set-up
493  virtual void setIterationApproach();
494  void generateIterator();
495 
497  void fillIdCols(vi::VisBuffer2 *vb,casacore::RefRows &rowRef);
499 
502  casacore::RefRows &rowRef,
503  const casacore::Cube<casacore::Float> &inputSpectrum,
507  casacore::Bool flushSpectrumCube);
508 
509  template <class T> void setTileShape(casacore::RefRows &rowRef,casacore::ArrayColumn<T> &outputDataCol);
510 
515 
516  // Methods to transform and write vectors
517 
518  template <class T> void transformAndWriteNotReindexableVector( const casacore::Vector<T> &inputVector,
519  casacore::Vector<T> &outputVector,
520  casacore::Bool constant,
521  casacore::ScalarColumn<T> &outputCol,
522  casacore::RefRows &rowReference);
523 
524  template <class T> void transformAndWriteReindexableVector( const casacore::Vector<T> &inputVector,
525  casacore::Vector<T> &outputVector,
526  casacore::Bool constant,
527  map<casacore::uInt,casacore::uInt> &inputOutputIndexMap,
528  casacore::ScalarColumn<T> &outputCol,
529  casacore::RefRows &rowReference);
530 
532 
534  casacore::Vector<casacore::Double> &outputVector);
535 
536  void mapAndAverageVector( const casacore::Vector<casacore::Bool> &inputVector,
537  casacore::Vector<casacore::Bool> &outputVector);
538 
539  // Templates methods to transform vectors that must be available for MSTransformBuffer
540 
541  template <class T> casacore::Bool transformNotReindexableVector( const casacore::Vector<T> &inputVector,
542  casacore::Vector<T> &outputVector,
543  casacore::Bool constant)
544  {
545  casacore::Bool transformed = true;
546 
547  if ((combinespws_p) or (nspws_p >1))
548  {
549  if (constant)
550  {
551  outputVector = inputVector(0);
552  }
553  else
554  {
555  mapVector(inputVector,outputVector);
556  }
557  }
558  else
559  {
560  transformed = false;
561  }
562 
563  return transformed;
564  };
565 
566  template <class T> casacore::Bool transformReindexableVector( const casacore::Vector<T> &inputVector,
567  casacore::Vector<T> &outputVector,
568  casacore::Bool constant,
569  map<casacore::uInt,casacore::uInt> &inputOutputIndexMap)
570  {
571  casacore::Bool transformed = true;
572 
573  if (inputOutputIndexMap.size() == 0)
574  {
575  transformed = transformNotReindexableVector(inputVector,outputVector,constant);
576  }
577  else
578  {
579  if (constant)
580  {
581  outputVector = inputOutputIndexMap[inputVector(0)];
582  }
583  else if (combinespws_p)
584  {
585  mapAndReindexVector(inputVector,outputVector,inputOutputIndexMap);
586  }
587  else
588  {
589  reindexVector(inputVector,outputVector,inputOutputIndexMap);
590  }
591  }
592 
593  return transformed;
594  };
595 
596  template <class T> void mapAndReindexVector( const casacore::Vector<T> &inputVector,
597  casacore::Vector<T> &outputVector,
598  map<casacore::uInt,casacore::uInt> &inputOutputIndexMap)
599  {
600  if (nspws_p <2)
601  {
602  for (casacore::uInt index=0; index<rowIndex_p.size();index++)
603  {
604  outputVector(index) = inputOutputIndexMap[inputVector(rowIndex_p[index])];
605  }
606  }
607  else
608  {
609  casacore::uInt absoluteIndex = 0;
610  for (casacore::uInt index=0; index<rowIndex_p.size();index++)
611  {
612  for (casacore::uInt spwIndex=0;spwIndex < nspws_p; spwIndex++)
613  {
614  outputVector(absoluteIndex) = inputOutputIndexMap[inputVector(rowIndex_p[index])];
615  absoluteIndex += 1;
616  }
617  }
618  }
619 
620  return;
621  }
622 
623 
624  template <class T> void reindexVector( const casacore::Vector<T> &inputVector,
625  casacore::Vector<T> &outputVector,
626  map<casacore::uInt,casacore::uInt> &inputOutputIndexMap)
627  {
628  if (nspws_p <2)
629  {
630  for (casacore::uInt index=0; index<inputVector.shape()[0];index++)
631  {
632  outputVector(index) = inputOutputIndexMap[inputVector(index)];
633  }
634  }
635  else
636  {
637  casacore::uInt absoluteIndex = 0;
638  for (casacore::uInt index=0; index<inputVector.shape()[0];index++)
639  {
640  for (casacore::uInt spwIndex=0;spwIndex < nspws_p; spwIndex++)
641  {
642  outputVector(absoluteIndex) = inputOutputIndexMap[inputVector(index)];
643  absoluteIndex += 1;
644  }
645  }
646  }
647 
648  return;
649  };
650 
651  template <class T> void mapVector( const casacore::Vector<T> &inputVector,
652  casacore::Vector<T> &outputVector)
653  {
654  if (nspws_p < 2)
655  {
656  for (casacore::uInt index=0; index<rowIndex_p.size();index++)
657  {
658  outputVector(index) = inputVector(rowIndex_p[index]);
659  }
660  }
661  else
662  {
663  casacore::uInt absoluteIndex = 0;
664  for (casacore::uInt index=0; index<rowIndex_p.size();index++)
665  {
666  for (casacore::uInt spwIndex=0;spwIndex < nspws_p; spwIndex++)
667  {
668  outputVector(absoluteIndex) = inputVector(rowIndex_p[index]);
669  absoluteIndex += 1;
670  }
671  }
672  }
673 
674 
675  return;
676  }
677 
678  // ------------------------------------------------------------------------------------
679  // Fill the data from an input matrix with shape [nCol,nBaselinesxnSPWsxnScans/nStates]
680  // into an output matrix with shape [nCol,nBaselinesxnScans/nStates]
681  // ------------------------------------------------------------------------------------
682  template <class T> void mapMatrix( const casacore::Matrix<T> &inputMatrix,casacore::Matrix<T> &outputMatrix)
683  {
684  // Get number of columns
685  casacore::uInt nCols = outputMatrix.shape()(0);
686 
687  for (casacore::uInt index=0; index<rowIndex_p.size();index++)
688  {
689  for (casacore::uInt col = 0; col < nCols; col++)
690  {
691  outputMatrix(col,index) = inputMatrix(col,rowIndex_p[index]);
692  }
693  }
694 
695  return;
696  }
697 
698 
699  template <class T> void mapAndAverageMatrix( const casacore::Matrix<T> &inputMatrix,
700  casacore::Matrix<T> &outputMatrix,
701  casacore::Bool convolveFlags=false,
702  vi::VisBuffer2 *vb=NULL);
703  template <class T> void mapAndScaleMatrix( const casacore::Matrix<T> &inputMatrix,
704  casacore::Matrix<T> &outputMatrix,
705  map<casacore::uInt,T> scaleMap,
707  template <class T> void writeMatrix( const casacore::Matrix<T> &inputMatrix,
708  casacore::ArrayColumn<T> &outputCol,
709  casacore::RefRows &rowRef,
710  casacore::uInt nBlocks);
711 
712  // Methods to transform and write cubes
713 
714  template <class T> void writeCube( const casacore::Cube<T> &inputCube,
715  casacore::ArrayColumn<T> &outputCol,
716  casacore::RefRows &rowRef);
717 
719  casacore::RefRows &rowRef,
720  const casacore::Cube<casacore::Complex> &inputDataCube,
723  const casacore::Cube<casacore::Float> &inputWeightCube);
725  casacore::RefRows &rowRef,
726  const casacore::Cube<casacore::Float> &inputDataCube,
729  const casacore::Cube<casacore::Float> &inputWeightCube);
731  casacore::RefRows &rowRef,
732  const casacore::Cube<casacore::Complex> &inputDataCube,
735  const casacore::Cube<casacore::Float> &inputWeightCube);
737  casacore::RefRows &rowRef,
738  const casacore::Cube<casacore::Float> &inputDataCube,
741  const casacore::Cube<casacore::Float> &inputWeightCube);
742 
743  template <class T> void copyCubeOfData( vi::VisBuffer2 *vb,
744  casacore::RefRows &rowRef,
745  const casacore::Cube<T> &inputDataCube,
746  casacore::ArrayColumn<T> &outputDataCol,
748  const casacore::Cube<casacore::Float> &inputWeightCube);
749 
750  template <class T> void combineCubeOfData( vi::VisBuffer2 *vb,
751  casacore::RefRows &rowRef,
752  const casacore::Cube<T> &inputDataCube,
753  casacore::ArrayColumn<T> &outputDataCol,
755  const casacore::Cube<casacore::Float> &inputWeightCube);
756 
757  // Methods to transform data in cubes
758 
760  casacore::uInt &pol,
761  casacore::uInt &inputChannel,
762  casacore::uInt &row,
763  const casacore::Cube<casacore::Float> &inputWeightsCube);
765  casacore::uInt &pol,
766  casacore::uInt &inputChannel,
767  casacore::uInt &row,
768  const casacore::Cube<casacore::Float> &inputWeightsCube);
770  casacore::uInt &pol,
771  casacore::uInt &inputChannel,
772  casacore::uInt &row,
773  const casacore::Cube<casacore::Float> &inputWeightsCube);
774 
775 
777  casacore::uInt inputChannel,
778  casacore::uInt outputChannel,
779  casacore::uInt inputRow,
780  const casacore::Cube<casacore::Float> &inputWeightsCube,
781  casacore::Matrix<casacore::Float> &inputWeightsPlane,
782  casacore::Double weight);
789  casacore::Double ) {return;}
791  casacore::uInt inputChannel,
792  casacore::uInt outputChannel,
793  casacore::uInt inputRow,
794  const casacore::Cube<casacore::Float> &inputWeightsCube,
795  casacore::Matrix<casacore::Float> &inputWeightsPlane,
796  casacore::Double weight);
797 
799  casacore::uInt outputChannel,
800  casacore::Matrix<casacore::Float> &inputPlaneWeights,
801  casacore::Matrix<casacore::Double> &normalizingFactorPlane);
807  casacore::uInt outputChannel,
808  casacore::Matrix<casacore::Float> &inputPlaneWeights,
809  casacore::Matrix<casacore::Double> &normalizingFactorPlane);
810 
811  template <class T> void averageCubeOfData( vi::VisBuffer2 *vb,
812  casacore::RefRows &rowRef,
813  const casacore::Cube<T> &inputDataCube,
814  casacore::ArrayColumn<T> &outputDataCol,
816  const casacore::Cube<casacore::Float> &inputWeightCube);
817  template <class T> void smoothCubeOfData( vi::VisBuffer2 *vb,
818  casacore::RefRows &rowRef,
819  const casacore::Cube<T> &inputDataCube,
820  casacore::ArrayColumn<T> &outputDataCol,
822  const casacore::Cube<casacore::Float> &inputWeightCube);
823  template <class T> void regridCubeOfData( vi::VisBuffer2 *vb,
824  casacore::RefRows &rowRef,
825  const casacore::Cube<T> &inputDataCube,
826  casacore::ArrayColumn<T> &outputDataCol,
828  const casacore::Cube<casacore::Float> &inputWeightCube);
829  template <class T> void separateCubeOfData( vi::VisBuffer2 *vb,
830  casacore::RefRows &rowRef,
831  const casacore::Cube<T> &inputDataCube,
832  casacore::ArrayColumn<T> &outputDataCol,
834  const casacore::Cube<casacore::Float> &inputWeightCube);
835 
836  template <class T> void transformAndWriteCubeOfData( casacore::Int inputSpw,
837  casacore::RefRows &rowRef,
838  const casacore::Cube<T> &inputDataCube,
839  const casacore::Cube<casacore::Bool> &inputFlagsCube,
840  const casacore::Cube<casacore::Float> &inputWeightsCube,
841  casacore::IPosition &outputPlaneShape,
842  casacore::ArrayColumn<T> &outputDataCol,
844 
845 
847  const casacore::Cube<casacore::Float> &inputWeightsCube,
848  casacore::Matrix<casacore::Float> &inputWeightsPlane);
853  const casacore::Cube<casacore::Float> &inputWeightsCube,
854  casacore::Matrix<casacore::Float> &inputWeightsPlane);
855 
856  template <class T> void transformAndWritePlaneOfData( casacore::Int inputSpw,
857  casacore::uInt row,
858  casacore::Matrix<T> &inputDataPlane,
859  casacore::Matrix<casacore::Bool> &inputFlagsPlane,
860  casacore::Matrix<casacore::Float> &inputWeightsPlane,
861  casacore::Matrix<T> &outputDataPlane,
862  casacore::Matrix<casacore::Bool> &outputFlagsPlane,
863  casacore::ArrayColumn<T> &outputDataCol,
866  casacore::Matrix<casacore::Float> &inputWeightsPlane,
867  casacore::Vector<casacore::Float> &inputWeightsStripe);
872  casacore::Matrix<casacore::Float> &inputWeightsPlane,
873  casacore::Vector<casacore::Float> &inputWeightsStripe);
874 
875  void setOutputbuffer(casacore::Cube<casacore::Complex> *& dataBufferPointer,casacore::Cube<casacore::Bool> *& flagBufferPointer);
876  void setOutputbuffer(casacore::Cube<casacore::Float> *& dataBufferPointer,casacore::Cube<casacore::Bool> *& flagBufferPointer);
877 
878  template <class T> void bufferOutputPlanes( casacore::uInt row,
879  casacore::Matrix<T> &outputDataPlane,
880  casacore::Matrix<casacore::Bool> &outputFlagsPlane,
881  casacore::ArrayColumn<T> &outputDataCol,
883  template <class T> void bufferOutputPlanesInSlices( casacore::uInt row,
884  casacore::Matrix<T> &outputDataPlane,
885  casacore::Matrix<casacore::Bool> &outputFlagsPlane,
886  casacore::ArrayColumn<T> &outputDataCol,
888 
890  casacore::Matrix<casacore::Complex> &outputDataPlane,
891  casacore::Matrix<casacore::Bool> &outputFlagsPlane,
895  casacore::Matrix<casacore::Float> &outputDataPlane,
896  casacore::Matrix<casacore::Bool> &outputFlagsPlane,
900  casacore::Matrix<casacore::Complex> &outputDataPlane,
901  casacore::Matrix<casacore::Bool> &outputFlagsPlane,
905  casacore::Matrix<casacore::Float> &outputDataPlane,
906  casacore::Matrix<casacore::Bool> &outputFlagsPlane,
909 
910  template <class T> void writeOutputPlanesInBlock( casacore::uInt row,
911  casacore::Matrix<T> &outputDataPlane,
912  casacore::Matrix<casacore::Bool> &outputFlagsPlane,
913  casacore::ArrayColumn<T> &outputDataCol,
917  casacore::IPosition &outputPlaneShape,
918  casacore::uInt &outputRow);
921  casacore::IPosition &outputPlaneShape,
922  casacore::uInt &outputRow);
926  casacore::uInt &) {return;}
927 
928  template <class T> void writeOutputPlanesInSlices( casacore::uInt row,
929  casacore::Matrix<T> &outputDataPlane,
930  casacore::Matrix<casacore::Bool> &outputFlagsPlane,
931  casacore::ArrayColumn<T> &outputDataCol,
933  template <class T> void writeOutputPlaneSlices( casacore::Matrix<T> &outputPlane,
934  casacore::ArrayColumn<T> &outputDataCol,
935  casacore::Slice &sliceX,
936  casacore::Slice &sliceY,
937  casacore::IPosition &outputPlaneShape,
938  casacore::uInt &outputRow);
939  template <class T> void writeOutputPlaneReshapedSlices( casacore::Matrix<T> &outputPlane,
940  casacore::ArrayColumn<T> &outputDataCol,
941  casacore::Slice &sliceX,
942  casacore::Slice &sliceY,
943  casacore::IPosition &outputPlaneShape,
944  casacore::uInt &outputRow);
947  casacore::Slice &sliceX,
948  casacore::Slice &sliceY,
949  casacore::IPosition &outputPlaneShape,
950  casacore::uInt &outputRow);
953  casacore::Slice &sliceX,
954  casacore::Slice &sliceY,
955  casacore::IPosition &outputPlaneShape,
956  casacore::uInt &outputRow);
959  casacore::Slice &,
960  casacore::Slice &,
962  casacore::uInt &) {return;}
965  casacore::Slice &sliceX,
966  casacore::Slice &sliceY,
967  casacore::IPosition &outputPlaneShape,
968  casacore::uInt &outputRow);
971  casacore::Slice &sliceX,
972  casacore::Slice &sliceY,
973  casacore::IPosition &outputPlaneShape,
974  casacore::uInt &outputRow);
977  casacore::Slice &,
978  casacore::Slice &,
980  casacore::uInt &) {return;}
981 
982  void transformStripeOfData(casacore::Int inputSpw,
983  const casacore::Vector<casacore::Complex> &inputDataStripe,
984  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
985  const casacore::Vector<casacore::Float> &inputWeightsStripe,
986  casacore::Vector<casacore::Complex> &outputDataStripe,
987  casacore::Vector<casacore::Bool> &outputFlagsStripe);
988 
989  void transformStripeOfData(casacore::Int inputSpw,
990  const casacore::Vector<casacore::Float> &inputDataStripe,
991  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
992  const casacore::Vector<casacore::Float> &inputWeightsStripe,
993  casacore::Vector<casacore::Float> &outputDataStripe,
994  casacore::Vector<casacore::Bool> &outputFlagsStripe);
995 
997  const casacore::Vector<casacore::Complex> &inputDataStripe,
998  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
999  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1000  casacore::Vector<casacore::Complex> &outputDataStripe,
1001  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1002 
1004  const casacore::Vector<casacore::Float> &inputDataStripe,
1005  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1006  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1007  casacore::Vector<casacore::Float> &outputDataStripe,
1008  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1009 
1010  template <class T> void average(casacore::Int inputSpw,
1011  const casacore::Vector<T> &inputDataStripe,
1012  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1013  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1014  casacore::Vector<T> &outputDataStripe,
1015  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1016 
1017  template <class T> void simpleAverage(casacore::uInt width,
1018  const casacore::Vector<T> &inputData,
1019  casacore::Vector<T> &outputData);
1020 
1021  void averageKernel(const casacore::Vector<casacore::Complex> &inputData,
1022  const casacore::Vector<casacore::Bool> &inputFlags,
1023  const casacore::Vector<casacore::Float> &inputWeights,
1025  casacore::Vector<casacore::Bool> &outputFlags,
1026  casacore::uInt startInputPos,
1027  casacore::uInt outputPos,
1028  casacore::uInt width);
1029 
1030  void averageKernel(const casacore::Vector<casacore::Float> &inputData,
1031  const casacore::Vector<casacore::Bool> &inputFlags,
1032  const casacore::Vector<casacore::Float> &inputWeights,
1034  casacore::Vector<casacore::Bool> &outputFlags,
1035  casacore::uInt startInputPos,
1036  casacore::uInt outputPos,
1037  casacore::uInt width);
1038 
1040  const casacore::Vector<casacore::Bool> &inputFlags,
1041  const casacore::Vector<casacore::Float> &inputWeights,
1043  casacore::Vector<casacore::Bool> &outputFlags,
1044  casacore::uInt startInputPos,
1045  casacore::uInt outputPos,
1046  casacore::uInt width);
1048  const casacore::Vector<casacore::Bool> &inputFlags,
1049  const casacore::Vector<casacore::Float> &inputWeights,
1051  casacore::Vector<casacore::Bool> &outputFlags,
1052  casacore::uInt startInputPos,
1053  casacore::uInt outputPos,
1054  casacore::uInt width);
1055  template <class T> void simpleAverageKernel(const casacore::Vector<T> &inputData,
1058  casacore::Vector<T> &outputData,
1060  casacore::uInt startInputPos,
1061  casacore::uInt outputPos,
1062  casacore::uInt width);
1063 
1064  template <class T> void flagAverageKernel(const casacore::Vector<T> &inputData,
1065  const casacore::Vector<casacore::Bool> &inputFlags,
1067  casacore::Vector<T> &outputData,
1068  casacore::Vector<casacore::Bool> &outputFlags,
1069  casacore::uInt startInputPos,
1070  casacore::uInt outputPos,
1071  casacore::uInt width);
1072 
1073  template <class T> void weightAverageKernel(const casacore::Vector<T> &inputData,
1075  const casacore::Vector<casacore::Float> &inputWeights,
1076  casacore::Vector<T> &outputData,
1077  casacore::Vector<casacore::Bool> &outputFlags,
1078  casacore::uInt startInputPos,
1079  casacore::uInt outputPos,
1080  casacore::uInt width);
1081 
1082  template <class T> void cumSumKernel(const casacore::Vector<T> &inputData,
1085  casacore::Vector<T> &outputData,
1087  casacore::uInt startInputPos,
1088  casacore::uInt outputPos,
1089  casacore::uInt width);
1090 
1091  template <class T> void flagWeightAverageKernel(const casacore::Vector<T> &inputData,
1092  const casacore::Vector<casacore::Bool> &inputFlags,
1093  const casacore::Vector<casacore::Float> &inputWeights,
1094  casacore::Vector<T> &outputData,
1095  casacore::Vector<casacore::Bool> &outputFlags,
1096  casacore::uInt startInputPos,
1097  casacore::uInt outputPos,
1098  casacore::uInt width);
1099 
1100  template <class T> void flagCumSumKernel(const casacore::Vector<T> &inputData,
1101  const casacore::Vector<casacore::Bool> &inputFlags,
1103  casacore::Vector<T> &outputData,
1105  casacore::uInt startInputPos,
1106  casacore::uInt outputPos,
1107  casacore::uInt width);
1108 
1109  template <class T> void flagNonZeroAverageKernel(const casacore::Vector<T> &inputData,
1110  const casacore::Vector<casacore::Bool> &inputFlags,
1112  casacore::Vector<T> &outputData,
1114  casacore::uInt startInputPos,
1115  casacore::uInt outputPos,
1116  casacore::uInt width);
1117 
1118  template <class T> void flagWeightNonZeroAverageKernel(const casacore::Vector<T> &inputData,
1119  const casacore::Vector<casacore::Bool> &inputFlags,
1121  casacore::Vector<T> &outputData,
1123  casacore::uInt startInputPos,
1124  casacore::uInt outputPos,
1125  casacore::uInt width);
1126 
1127  template <class T> void flagCumSumNonZeroKernel(const casacore::Vector<T> &inputData,
1128  const casacore::Vector<casacore::Bool> &inputFlags,
1130  casacore::Vector<T> &outputData,
1132  casacore::uInt startInputPos,
1133  casacore::uInt outputPos,
1134  casacore::uInt width);
1135 
1136 
1137  template <class T> void smooth(casacore::Int inputSpw,
1138  const casacore::Vector<T> &inputDataStripe,
1139  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1140  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1141  casacore::Vector<T> &outputDataStripe,
1142  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1143 
1144  void smoothKernel(const casacore::Vector<casacore::Complex> &inputData,
1145  const casacore::Vector<casacore::Bool> &inputFlags,
1146  const casacore::Vector<casacore::Float> &inputWeights,
1148  casacore::Vector<casacore::Bool> &outputFlags,
1149  casacore::uInt outputPos);
1150 
1151  void smoothKernel(const casacore::Vector<casacore::Float> &inputData,
1152  const casacore::Vector<casacore::Bool> &inputFlags,
1153  const casacore::Vector<casacore::Float> &inputWeights,
1155  casacore::Vector<casacore::Bool> &outputFlags,
1156  casacore::uInt outputPos);
1157 
1159  const casacore::Vector<casacore::Bool> &inputFlags,
1160  const casacore::Vector<casacore::Float> &inputWeights,
1162  casacore::Vector<casacore::Bool> &outputFlags,
1163  casacore::uInt outputPos);
1164 
1166  const casacore::Vector<casacore::Bool> &inputFlags,
1167  const casacore::Vector<casacore::Float> &inputWeights,
1169  casacore::Vector<casacore::Bool> &outputFlags,
1170  casacore::uInt outputPos);
1171 
1172  template <class T> void plainSmooth(const casacore::Vector<T> &inputData,
1173  const casacore::Vector<casacore::Bool> &inputFlags,
1174  const casacore::Vector<casacore::Float> &inputWeights,
1175  casacore::Vector<T> &outputData,
1176  casacore::Vector<casacore::Bool> &outputFlags,
1177  casacore::uInt outputPos);
1178 
1179  template <class T> void plainSmoothSpectrum(const casacore::Vector<T> &inputData,
1180  const casacore::Vector<casacore::Bool> &inputFlags,
1181  const casacore::Vector<casacore::Float> &inputWeights,
1182  casacore::Vector<T> &outputData,
1183  casacore::Vector<casacore::Bool> &outputFlags,
1184  casacore::uInt outputPos);
1185 
1186 
1187  template <class T> void regrid(casacore::Int ,
1188  const casacore::Vector<T> &inputDataStripe,
1189  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1191  casacore::Vector<T> &outputDataStripe,
1192  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1193 
1194  void regridCore(casacore::Int inputSpw,
1195  const casacore::Vector<casacore::Complex> &inputDataStripe,
1196  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1197  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1198  casacore::Vector<casacore::Complex> &outputDataStripe,
1199  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1200  void regridCore(casacore::Int inputSpw,
1201  const casacore::Vector<casacore::Float> &inputDataStripe,
1202  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1203  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1204  casacore::Vector<casacore::Float> &outputDataStripe,
1205  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1206 
1208  const casacore::Vector<casacore::Complex> &inputDataStripe,
1209  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1210  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1211  casacore::Vector<casacore::Complex> &outputDataStripe,
1212  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1213 
1215  const casacore::Vector<casacore::Float> &inputDataStripe,
1216  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1217  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1218  casacore::Vector<casacore::Float> &outputDataStripe,
1219  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1220 
1221  void fftshift(casacore::Int inputSpw,
1222  const casacore::Vector<casacore::Complex> &inputDataStripe,
1223  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1224  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1225  casacore::Vector<casacore::Complex> &outputDataStripe,
1226  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1227  void fftshift(casacore::Int inputSpw,
1228  const casacore::Vector<casacore::Float> &inputDataStripe,
1229  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1230  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1231  casacore::Vector<casacore::Float> &outputDataStripe,
1232  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1233 
1234  template <class T> void interpol1D(casacore::Int inputSpw,
1235  const casacore::Vector<T> &inputDataStripe,
1236  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1238  casacore::Vector<T> &outputDataStripe,
1239  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1240 
1241  template <class T> void interpol1Dfftshift(casacore::Int inputSpw,
1242  const casacore::Vector<T> &inputDataStripe,
1243  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1244  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1245  casacore::Vector<T> &outputDataStripe,
1246  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1247 
1248  template <class T> void interpolateByChannelMap(Int spw,
1249  const Vector<T> &inputDataStripe,
1250  const Vector<Bool> &inputFlagsStripe,
1251  Vector<T> &outputDataStripe,
1252  Vector<Bool> &outputFlagsStripe);
1253 
1254  template <class T> void averageRegrid(casacore::Int inputSpw,
1255  const casacore::Vector<T> &inputDataStripe,
1256  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1257  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1258  casacore::Vector<T> &outputDataStripe,
1259  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1260 
1261  template <class T> void smoothRegrid(casacore::Int inputSpw,
1262  const casacore::Vector<T> &inputDataStripe,
1263  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1264  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1265  casacore::Vector<T> &outputDataStripe,
1266  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1267 
1268  template <class T> void averageSmooth(casacore::Int inputSpw,
1269  const casacore::Vector<T> &inputDataStripe,
1270  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1271  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1272  casacore::Vector<T> &outputDataStripe,
1273  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1274 
1275  template <class T> void averageSmoothRegrid(casacore::Int inputSpw,
1276  const casacore::Vector<T> &inputDataStripe,
1277  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1278  const casacore::Vector<casacore::Float> &inputWeightsStripe,
1279  casacore::Vector<T> &outputDataStripe,
1280  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1281 
1282  // The following methods are single dish specific so far
1284  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1285  const casacore::Vector<casacore::Float> &inputWeightStripe,
1286  casacore::Vector<casacore::Float> &outputDataStripe,
1287  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1288 
1290  const casacore::Vector<casacore::Bool> &inputFlagsStripe,
1291  const casacore::Vector<casacore::Float> &inputWeightStripe,
1292  casacore::Vector<casacore::Complex> &outputDataStripe,
1293  casacore::Vector<casacore::Bool> &outputFlagsStripe);
1294 
1296 
1297  // casacore::MS specification parameters
1304 
1305  // casacore::Data selection parameters
1318 
1319  // casacore::Input-Output index maps
1320  map<casacore::uInt,casacore::uInt> inputOutputObservationIndexMap_p;
1321  map<casacore::uInt,casacore::uInt> inputOutputArrayIndexMap_p;
1322  map<casacore::uInt,casacore::uInt> inputOutputScanIndexMap_p;
1323  map<casacore::uInt,casacore::uInt> inputOutputScanIntentIndexMap_p;
1324  map<casacore::uInt,casacore::uInt> inputOutputFieldIndexMap_p;
1325  map<casacore::uInt,casacore::uInt> inputOutputSPWIndexMap_p;
1326  map<casacore::uInt,casacore::uInt> inputOutputDDIndexMap_p;
1327  map<casacore::uInt,casacore::uInt> inputOutputAntennaIndexMap_p;
1328  map<casacore::uInt,casacore::uInt> outputInputSPWIndexMap_p;
1329  map<casacore::Int,std::vector<casacore::Int> > inputOutputChanIndexMap_p;
1330 
1331  // Frequency transformation parameters
1340  // For when the interpolation needs to be done the tclean way
1341  // (output width > 2 input width). CAS-9853, CAS-9852
1347  // Options are: nearest, linear, cubic, spline, fftshift
1351  // Options are: LSRK, LSRD, BARY, GALACTO, LGROUP, CMB, GEO, or TOPO
1358 
1359  // Frequency specification parameters
1363  int nChan_p;
1365 
1366  // Phase shifting parameters
1369 
1370  // For scalar averaging, use "timebin" for iter interval but don't average
1372 
1373  // casacore::Time transformation parameters
1379  // casacore::uInt minbaselines_p;
1380 
1381  // Calibration parameters
1385 
1386  // UVContSub parameters
1389 
1390  // Spw averaging parameters
1392 
1393  // Polarization transformation parameters
1396 
1397  // Pointings interpolation transformation parameters
1400 
1401  // Weight Spectrum parameters
1403 
1404  // Buffer handling parameters
1410 
1411  // casacore::MS-related members
1418  std::shared_ptr<casacore::MSFieldColumns> inputMSFieldCols_p;
1419 
1420  // VI/VB related members
1424 
1425  // Output casacore::MS structure related members
1434 
1435  // Frequency transformation members
1440  std::vector<casacore::uInt> rowIndex_p;
1444  map<casacore::uInt,casacore::uInt> freqbinMap_p;
1445  map<casacore::uInt,casacore::uInt> numOfInpChanMap_p;
1446  map<casacore::uInt,casacore::uInt> numOfSelChanMap_p;
1447  map<casacore::uInt,casacore::uInt> numOfOutChanMap_p;
1448  map<casacore::uInt,casacore::uInt> numOfCombInputChanMap_p;
1449  map<casacore::uInt,casacore::uInt> numOfCombInterChanMap_p;
1450  map<casacore::uInt,casacore::Float> weightFactorMap_p;
1451  map<casacore::uInt,casacore::Float> sigmaFactorMap_p;
1452  map<casacore::uInt,casacore::Float> newWeightFactorMap_p;
1453  map<casacore::uInt,casacore::Float> newSigmaFactorMap_p;
1454 
1455  // Reference Frame Transformation members
1467  casacore::ROScalarMeasColumn<casacore::MEpoch> timeMeas_p;
1468 
1469  // Weight Spectrum members
1474  // whether to create and fill the WEIGHT/SIMA_SPECTRUM columns in the output MS
1482 
1483  // Buffer handling members
1503 
1504  // single dish specific
1506  map<casacore::Int, casacore::Convolver<casacore::Float> > convolverPool_;
1507 
1508  // Logging
1510 
1511 private:
1513  void createOutputMSStructure();
1514 
1515 };
1516 
1517 } //# NAMESPACE CASA - END
1518 
1519 #endif /* MSTransformManager_H_ */
void getOutputNumberOfChannels()
From output MS.
spwInfo(casacore::Vector< casacore::Double > &chanFreq, casacore::Vector< casacore::Double > &chanWidth)
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
Struct definition.
casacore::ArrayColumn< casacore::Float > & getOutputWeightColumn(vi::VisBuffer2 *vb, casacore::MS::PredefinedColumns datacol)
A Measure: astronomical direction.
Definition: MDirection.h:174
void writeMatrix(const casacore::Matrix< T > &inputMatrix, casacore::ArrayColumn< T > &outputCol, casacore::RefRows &rowRef, casacore::uInt nBlocks)
void calculateIntermediateFrequencies(casacore::Int spwId, const casacore::Vector< casacore::Double > &inputChanFreq, const casacore::Vector< casacore::Double > &inputChanWidth, casacore::Vector< casacore::Double > &intermediateChanFreq, casacore::Vector< casacore::Double > &intermediateChanWidth)
For channel averaging and selection.
casacore::String restFrequency_p
void setTileShape(casacore::RefRows &rowRef, casacore::ArrayColumn< T > &outputDataCol)
casacore::Bool shouldCreateOutputWtSpectrum(casacore::Bool usewtspectrum)
casacore::uInt outChannel
void separateCubeOfData(vi::VisBuffer2 *vb, casacore::RefRows &rowRef, const casacore::Cube< T > &inputDataCube, casacore::ArrayColumn< T > &outputDataCol, casacore::ArrayColumn< casacore::Bool > *outputFlagCol, const casacore::Cube< casacore::Float > &inputWeightCube)
inputOutputChanFactorMap inputOutputChanFactorMap_p
void transformCubeOfData(vi::VisBuffer2 *vb, casacore::RefRows &rowRef, const casacore::Cube< casacore::Complex > &inputDataCube, casacore::ArrayColumn< casacore::Complex > &outputDataCol, casacore::ArrayColumn< casacore::Bool > *outputFlagCol, const casacore::Cube< casacore::Float > &inputWeightCube)
A Measure: position on Earth.
Definition: MPosition.h:79
casacore::String fieldSelection_p
int Int
Definition: aipstype.h:50
casacore::uInt dataBuffer_p
Buffer handling members.
casacore::Cube< casacore::Complex > * visCubeModel_p
std::vector< casacore::uInt > rowIndex_p
void parseChanAvgParams(casacore::Record &configuration)
void(casa::MSTransformManager::* transformStripeOfDataFloat_p)(casacore::Int inputSpw, const casacore::Vector< casacore::Float > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< casacore::Float > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
casacore::Bool inputFlagCategoryAvailable_p
Output casacore::MS structure related members.
map< casacore::uInt, casacore::uInt > inputOutputScanIndexMap_p
map< casacore::uInt, casacore::uInt > inputOutputSPWIndexMap_p
const casacore::Cube< casacore::Float > & getWeightSpectrumFromSigmaSpectrum(vi::VisBuffer2 *vb)
vi::AveragingOptions timeAvgOptions_p
casacore::ArrayColumn< casacore::Float > dummyWeightCol_p
void dontAddWeightSpectrumContribution(casacore::Double &weight, casacore::uInt &pol, casacore::uInt &inputChannel, casacore::uInt &row, const casacore::Cube< casacore::Float > &inputWeightsCube)
map< casacore::uInt, map< casacore::uInt, casacore::uInt > > inputSpwChanMap
vi::VisBuffer2 * getVisBuffer()
Needed by MSTransformBuffer.
casacore::ROScalarMeasColumn< casacore::MEpoch > timeMeas_p
void reindexPolarizationIdInDataDesc(casacore::Int newPolarizationId)
void smoothFourierFloat(casacore::Int, const casacore::Vector< casacore::Float > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightStripe, casacore::Vector< casacore::Float > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
The following methods are single dish specific so far.
casacore::Block< casacore::Int > sortColumns_p
VI/VB related members.
casacore::Double upperBound
void transformAndWriteNotReindexableVector(const casacore::Vector< T > &inputVector, casacore::Vector< T > &outputVector, casacore::Bool constant, casacore::ScalarColumn< T > &outputCol, casacore::RefRows &rowReference)
Methods to transform and write vectors.
std::vector< casacore::Int > contribSPW_id
dataColMap getDataColMap()
Need by tMSTransformIterator.
casacore::Bool pointingsInterpolation_p
Pointings interpolation transformation parameters.
void(casa::MSTransformManager::* normalizeWeightsPlane_p)(casacore::uInt pol, casacore::uInt outputChannel, casacore::Matrix< casacore::Float > &inputPlaneWeights, casacore::Matrix< casacore::Double > &normalizingFactorPlane)
const IPosition & shape() const
The length of each axis of the Matrix.
Definition: Matrix.h:295
casacore::Vector< casacore::Double > CHAN_FREQ
casacore::Cube< casacore::Float > weightSpectrumCubeFlat_p
casacore::Bool uvcontsub_p
UVContSub parameters.
casacore::Bool flushWeightSpectrum_p
whether to create and fill the WEIGHT/SIMA_SPECTRUM columns in the output MS
casacore::Bool spectrumTransformation_p
Weight Spectrum members.
Vector< Double > regridTCleanCHAN_FREQ_p
void copyCubeOfData(vi::VisBuffer2 *vb, casacore::RefRows &rowRef, const casacore::Cube< T > &inputDataCube, casacore::ArrayColumn< T > &outputDataCol, casacore::ArrayColumn< casacore::Bool > *outputFlagCol, const casacore::Cube< casacore::Float > &inputWeightCube)
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
casacore::Bool spwAverage_p
Spw averaging parameters.
void weightAverageKernel(const casacore::Vector< T > &inputData, const casacore::Vector< casacore::Bool > &, const casacore::Vector< casacore::Float > &inputWeights, casacore::Vector< T > &outputData, casacore::Vector< casacore::Bool > &outputFlags, casacore::uInt startInputPos, casacore::uInt outputPos, casacore::uInt width)
casacore::Cube< casacore::Float > * sigmaSpectrum_p
void dontWriteOutputFlagsPlane(casacore::Matrix< casacore::Bool > &, casacore::ArrayColumn< casacore::Bool > &, casacore::IPosition &, casacore::uInt &)
vi::VisibilityIterator2 * visibilityIterator_p
map< casacore::uInt, casacore::uInt > numOfCombInterChanMap_p
void fillIdCols(vi::VisBuffer2 *vb, casacore::RefRows &rowRef)
void doPreAveragingBeforeRegridding(uInt widthFactor, Int spwId, const Vector< Double > &originalCHAN_FREQ, const Vector< Double > &originalCHAN_WIDTH, Vector< Double > &inputCHAN_FREQ, Vector< Double > &inputCHAN_WIDTH)
void(casa::MSTransformManager::* transformStripeOfDataComplex_p)(casacore::Int inputSpw, const casacore::Vector< casacore::Complex > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< casacore::Complex > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
void parseFreqTransParams(casacore::Record &configuration)
casacore::LogIO logger_p
Logging.
void regridCubeOfData(vi::VisBuffer2 *vb, casacore::RefRows &rowRef, const casacore::Cube< T > &inputDataCube, casacore::ArrayColumn< T > &outputDataCol, casacore::ArrayColumn< casacore::Bool > *outputFlagCol, const casacore::Cube< casacore::Float > &inputWeightCube)
void parseDataSelParams(casacore::Record &configuration)
channelContribution(casacore::Int inputSpw, casacore::uInt inputChannel, casacore::uInt outputChannel, casacore::Double fraction)
void setChannelAverageKernel(casacore::uInt mode)
std::vector< casacore::Int > contribChannel
void averageSmoothRegrid(casacore::Int inputSpw, const casacore::Vector< T > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< T > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
casacore::String getOutputMsName()
void regridSpwAux(casacore::Int spwId, casacore::MFrequency::Types spwInputRefFrame, casacore::Vector< casacore::Double > &inputCHAN_FREQ, casacore::Vector< casacore::Double > &inputCHAN_WIDTH, casacore::Vector< casacore::Double > &originalCHAN_FREQ, casacore::Vector< casacore::Double > &originalCHAN_WIDTH, casacore::Vector< casacore::Double > &regriddedCHAN_FREQ, casacore::Vector< casacore::Double > &regriddedCHAN_WIDTH, string msg)
Regrids one SPW.
void writeCube(const casacore::Cube< T > &inputCube, casacore::ArrayColumn< T > &outputCol, casacore::RefRows &rowRef)
Methods to transform and write cubes.
map< casacore::uInt, casacore::uInt > freqbinMap_p
void writeOutputPlaneReshapedSlices(casacore::Matrix< T > &outputPlane, casacore::ArrayColumn< T > &outputDataCol, casacore::Slice &sliceX, casacore::Slice &sliceY, casacore::IPosition &outputPlaneShape, casacore::uInt &outputRow)
casacore::Cube< casacore::Float > * visCubeFloat_p
casacore::Vector< casacore::Double > CHAN_WIDTH
casacore::String interpolationMethodPar_p
Options are: nearest, linear, cubic, spline, fftshift.
casacore::Cube< casacore::Float > * weightSpectrum_p
void smooth(casacore::Int inputSpw, const casacore::Vector< T > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< T > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
map< casacore::uInt, pair< spwInfo, spwInfo > > inputOutputSpwMap
void dropNonUniformWidthChannels()
Drop channels with non-uniform width when doing channel average.
casacore::Bool createWeightSpectrumCols_p
FrequencySelectionUsingChannels()
casacore::Double lowerBound
void simpleAverageKernel(const casacore::Vector< T > &inputData, const casacore::Vector< casacore::Bool > &, const casacore::Vector< casacore::Float > &, casacore::Vector< T > &outputData, casacore::Vector< casacore::Bool > &, casacore::uInt startInputPos, casacore::uInt outputPos, casacore::uInt width)
void(casa::MSTransformManager::* regridCoreComplex_p)(casacore::Int inputSpw, const casacore::Vector< casacore::Complex > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< casacore::Complex > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
map< casacore::uInt, casacore::uInt > numOfOutChanMap_p
casac::variant * phaseCenterPar_p
void setWeightStripeByReference(casacore::uInt corrIndex, casacore::Matrix< casacore::Float > &inputWeightsPlane, casacore::Vector< casacore::Float > &inputWeightsStripe)
void setBufferMode(casacore::Bool on)
casacore::Bool combinationOfSPWsWithDifferentExposure_p
const casacore::Cube< casacore::Float > & getApplicableSpectrum(vi::VisBuffer2 *vb, casacore::MS::PredefinedColumns datacol)
casacore::Double sigmaToWeight(casacore::Double wt)
void averageCubeOfData(vi::VisBuffer2 *vb, casacore::RefRows &rowRef, const casacore::Cube< T > &inputDataCube, casacore::ArrayColumn< T > &outputDataCol, casacore::ArrayColumn< casacore::Bool > *outputFlagCol, const casacore::Cube< casacore::Float > &inputWeightCube)
map< casacore::uInt, vector< channelContribution > > inputOutputChanFactorMap
void writeOutputPlanesInBlock(casacore::uInt row, casacore::Matrix< T > &outputDataPlane, casacore::Matrix< casacore::Bool > &outputFlagsPlane, casacore::ArrayColumn< T > &outputDataCol, casacore::ArrayColumn< casacore::Bool > &outputFlagCol)
casacore::Record pointingsInterpolationConfig_p
MSTransformDataHandler * dataHandler_p
casacore::MS-related members
void averageKernel(const casacore::Vector< casacore::Complex > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &inputWeights, casacore::Vector< casacore::Complex > &outputData, casacore::Vector< casacore::Bool > &outputFlags, casacore::uInt startInputPos, casacore::uInt outputPos, casacore::uInt width)
casacore::MFrequency::Convert freqTransEngine_p
void dontfillWeightsPlane(casacore::uInt, casacore::uInt, casacore::uInt, casacore::uInt, const casacore::Cube< casacore::Float > &, casacore::Matrix< casacore::Float > &, casacore::Double)
casacore::Int getAveragedPolarizationId()
To average polarization components.
void setOutputbuffer(casacore::Cube< casacore::Complex > *&dataBufferPointer, casacore::Cube< casacore::Bool > *&flagBufferPointer)
A 2-D Specialization of the Array class.
ostream-like interface to creating log messages.
Definition: LogIO.h:167
casacore::Bool smoothFourier_p
single dish specific
A Measure: radial velocity.
casacore::String outputReferenceFramePar_p
Options are: LSRK, LSRD, BARY, GALACTO, LGROUP, CMB, GEO, or TOPO.
casacore::Bool correctedDataColumnAvailable_p
void fillOutputMs(vi::VisBuffer2 *vb)
iterator begin()
Get the begin iterator object for any array.
Definition: Array.h:856
casacore::Double lowerBound() const
casacore::uInt chansPerOutputSpw_p
Frequency transformation members.
void setupBufferTransformations(vi::VisBuffer2 *vb)
void setWeightsPlaneByReference(casacore::uInt inputRow, const casacore::Cube< casacore::Float > &inputWeightsCube, casacore::Matrix< casacore::Float > &inputWeightsPlane)
PredefinedColumns
The Main table colums with predefined meaning.
Definition: MSMainEnums.h:65
spwInfo(casacore::uInt nChannels)
void smoothKernel(const casacore::Vector< casacore::Complex > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &inputWeights, casacore::Vector< casacore::Complex > &outputData, casacore::Vector< casacore::Bool > &outputFlags, casacore::uInt outputPos)
void flagCumSumNonZeroKernel(const casacore::Vector< T > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &, casacore::Vector< T > &outputData, casacore::Vector< casacore::Bool > &, casacore::uInt startInputPos, casacore::uInt outputPos, casacore::uInt width)
map< casacore::uInt, casacore::uInt > numOfSelChanMap_p
casacore::Cube< casacore::Float > weightSpectrumCube_p
void dontNormalizeWeightsPlane(casacore::uInt, casacore::uInt, casacore::Matrix< casacore::Float > &, casacore::Matrix< casacore::Double > &)
void normalizeWeightsPlane(casacore::uInt pol, casacore::uInt outputChannel, casacore::Matrix< casacore::Float > &inputPlaneWeights, casacore::Matrix< casacore::Double > &normalizingFactorPlane)
A Measure: instant in time.
Definition: MEpoch.h:104
void average(casacore::Int inputSpw, const casacore::Vector< T > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< T > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
casacore::Bool makeVirtualCorrectedColReal_p
casacore::Matrix< casacore::Float > * sigma_p
void smoothFourierComplex(casacore::Int, const casacore::Vector< casacore::Complex > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightStripe, casacore::Vector< casacore::Complex > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
inputOutputSpwMap inputOutputSpwMap_p
casacore::Bool enableChanPreAverage_p
void writeOutputPlanesInSlices(casacore::uInt row, casacore::Matrix< T > &outputDataPlane, casacore::Matrix< casacore::Bool > &outputFlagsPlane, casacore::ArrayColumn< T > &outputDataCol, casacore::ArrayColumn< casacore::Bool > &outputFlagCol)
casacore::Cube< casacore::Complex > * visCubeCorrected_p
casacore::Bool modelDataColumnAvailable_p
void checkAndPreaverageChannelsIfNeeded(Int spwId, Vector< Double > &inputCHAN_FREQ, Vector< Double > &inputCHAN_WIDTH, const Vector< Double > &originalCHAN_FREQ, const Vector< Double > &originalCHAN_WIDTH, const Vector< Double > &regriddedCHAN_FREQ, const Vector< Double > &regriddedCHAN_WIDTH)
void combineCubeOfData(vi::VisBuffer2 *vb, casacore::RefRows &rowRef, const casacore::Cube< T > &inputDataCube, casacore::ArrayColumn< T > &outputDataCol, casacore::ArrayColumn< casacore::Bool > *outputFlagCol, const casacore::Cube< casacore::Float > &inputWeightCube)
casacore::MeasurementSet * outputMs_p
void parseFreqSpecParams(casacore::Record &configuration)
void writeOutputPlanes(casacore::uInt row, casacore::Matrix< casacore::Complex > &outputDataPlane, casacore::Matrix< casacore::Bool > &outputFlagsPlane, casacore::ArrayColumn< casacore::Complex > &outputDataCol, casacore::ArrayColumn< casacore::Bool > &outputFlagCol)
casacore::String taqlSelection_p
casacore::Bool polAverage_p
Polarization transformation parameters.
MSTransformDataHandler definition.
void(casa::MSTransformManager::* smoothKernelFloat_p)(const casacore::Vector< casacore::Float > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &inputWeights, casacore::Vector< casacore::Float > &outputData, casacore::Vector< casacore::Bool > &outputFlags, casacore::uInt outputPos)
casacore::MeasurementSet * inputMs_p
void mapAndScaleMatrix(const casacore::Matrix< T > &inputMatrix, casacore::Matrix< T > &outputMatrix, map< casacore::uInt, T > scaleMap, casacore::Vector< casacore::Int > spws)
casacore::String feedSelection_p
void addWeightSpectrumContribution(casacore::Double &weight, casacore::uInt &pol, casacore::uInt &inputChannel, casacore::uInt &row, const casacore::Cube< casacore::Float > &inputWeightsCube)
Methods to transform data in cubes.
casacore::MeasurementSet * selectedInputMs_p
void flagNonZeroAverageKernel(const casacore::Vector< T > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &, casacore::Vector< T > &outputData, casacore::Vector< casacore::Bool > &, casacore::uInt startInputPos, casacore::uInt outputPos, casacore::uInt width)
void(casa::MSTransformManager::* smoothKernelComplex_p)(const casacore::Vector< casacore::Complex > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &inputWeights, casacore::Vector< casacore::Complex > &outputData, casacore::Vector< casacore::Bool > &outputFlags, casacore::uInt outputPos)
void reindexGenericTimeDependentSubTable(const casacore::String &subtabname)
casacore::MDirection determinePhaseCenter()
casacore::MPosition observatoryPosition_p
void interpolateByChannelMap(Int spw, const Vector< T > &inputDataStripe, const Vector< Bool > &inputFlagsStripe, Vector< T > &outputDataStripe, Vector< Bool > &outputFlagsStripe)
void setSmoothingFourierKernel(casacore::uInt mode)
casacore::Bool usewtspectrum_p
Weight Spectrum parameters.
void mapAndReindexVector(const casacore::Vector< T > &inputVector, casacore::Vector< T > &outputVector, map< casacore::uInt, casacore::uInt > &inputOutputIndexMap)
casacore::String observationSelection_p
void plainSmoothSpectrum(const casacore::Vector< T > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &inputWeights, casacore::Vector< T > &outputData, casacore::Vector< casacore::Bool > &outputFlags, casacore::uInt outputPos)
void dontWriteOutputFlagsPlaneSlices(casacore::Matrix< casacore::Bool > &, casacore::ArrayColumn< casacore::Bool > &, casacore::Slice &, casacore::Slice &, casacore::IPosition &, casacore::uInt &)
casacore::String scanIntentSelection_p
void(casa::MSTransformManager::* writeOutputFlagsPlaneReshapedSlices_p)(casacore::Matrix< casacore::Bool > &outputPlane, casacore::ArrayColumn< casacore::Bool > &outputCol, casacore::Slice &sliceX, casacore::Slice &sliceY, casacore::IPosition &outputPlaneShape, casacore::uInt &outputRow)
casacore::MFrequency::Convert refTimeFreqTransEngine_p
void resize(casacore::uInt nChannels)
void simpleAverage(casacore::uInt width, const casacore::Vector< T > &inputData, casacore::Vector< T > &outputData)
define a (start,length,increment) along an axis
Definition: Slice.h:93
void fillWeightCols(vi::VisBuffer2 *vb, casacore::RefRows &rowRef)
void(casa::MSTransformManager::* writeOutputFlagsPlane_p)(casacore::Matrix< casacore::Bool > &outputPlane, casacore::ArrayColumn< casacore::Bool > &outputCol, casacore::IPosition &outputPlaneShape, casacore::uInt &outputRow)
map< casacore::uInt, casacore::uInt > inputOutputFieldIndexMap_p
casacore::Double CHAN_WIDTH
void transformAndWriteReindexableVector(const casacore::Vector< T > &inputVector, casacore::Vector< T > &outputVector, casacore::Bool constant, map< casacore::uInt, casacore::uInt > &inputOutputIndexMap, casacore::ScalarColumn< T > &outputCol, casacore::RefRows &rowReference)
void(casa::MSTransformManager::* fillWeightsPlane_p)(casacore::uInt pol, casacore::uInt inputChannel, casacore::uInt outputChannel, casacore::uInt inputRow, const casacore::Cube< casacore::Float > &inputWeightsCube, casacore::Matrix< casacore::Float > &inputWeightsPlane, casacore::Double weight)
void parseUVContSubParams(casacore::Record &configuration)
casacore::String arraySelection_p
casacore::Data selection parameters
void mapAndAverageMatrix(const casacore::Matrix< T > &inputMatrix, casacore::Matrix< T > &outputMatrix, casacore::Bool convolveFlags=false, vi::VisBuffer2 *vb=NULL)
void initDataSelectionParams()
From input MS.
casacore::Bool bufferMode_p
Buffer handling parameters.
void calculateNewWeightAndSigmaFactors()
double Double
Definition: aipstype.h:55
void parseCalParams(casacore::Record &configuration)
LatticeExprNode abs(const LatticeExprNode &expr)
Numerical 1-argument functions which result in a real number regardless of input expression type...
casacore::Bool makeVirtualModelColReal_p
casacore::Double RESOLUTION
void mapAndAverageVector(const casacore::Vector< casacore::Double > &inputVector, casacore::Vector< casacore::Double > &outputVector)
void(casa::MSTransformManager::* writeOutputPlanesFloat_p)(casacore::uInt row, casacore::Matrix< casacore::Float > &outputDataPlane, casacore::Matrix< casacore::Bool > &outputFlagsPlane, casacore::ArrayColumn< casacore::Float > &outputDataCol, casacore::ArrayColumn< casacore::Bool > &outputFlagCol)
A class to provide easy read-only access to MeasurementSet columns.
Definition: MSColumns.h:111
Class holding the row numbers in a RefTable.
Definition: RefRows.h:85
map< casacore::uInt, casacore::uInt > inputOutputObservationIndexMap_p
casacore::Input-Output index maps
casacore::Vector< casacore::Float > smoothCoeff_p
void parsePhaseShiftParams(casacore::Record &configuration)
casacore::String polarizationSelection_p
void setSpwAvg(casacore::Record &configuration)
void averageRegrid(casacore::Int inputSpw, const casacore::Vector< T > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< T > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
void parsePolAvgParams(casacore::Record &configuration)
map< casacore::uInt, casacore::Float > sigmaFactorMap_p
void initialize(casacore::uInt nChannels)
casacore::Vector< casacore::Int > tileShape_p
const IPosition & shape() const
The length of the Vector.
Definition: Vector.h:293
void averageSmooth(casacore::Int inputSpw, const casacore::Vector< T > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< T > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
void(casa::MSTransformManager::* transformCubeOfDataComplex_p)(vi::VisBuffer2 *vb, casacore::RefRows &rowRef, const casacore::Cube< casacore::Complex > &inputDataCube, casacore::ArrayColumn< casacore::Complex > &outputDataCol, casacore::ArrayColumn< casacore::Bool > *outputFlagCol, const casacore::Cube< casacore::Float > &inputWeightCube)
void transformStripeOfData(casacore::Int inputSpw, const casacore::Vector< casacore::Complex > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< casacore::Complex > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
map< casacore::uInt, casacore::uInt > inputOutputDDIndexMap_p
void parseTimeAvgParams(casacore::Record &configuration)
casacore::Matrix< casacore::Float > * weight_p
void flagWeightAverageKernel(const casacore::Vector< T > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &inputWeights, casacore::Vector< T > &outputData, casacore::Vector< casacore::Bool > &outputFlags, casacore::uInt startInputPos, casacore::uInt outputPos, casacore::uInt width)
vi::VisibilityIterator2 * getVisIter()
For buffer handling classes (MSTransformIterator)
void configure(casacore::Record &configuration)
void checkSPWChannelsKnownLimitation()
void(casa::MSTransformManager::* setWeightsPlaneByReference_p)(casacore::uInt inputRow, const casacore::Cube< casacore::Float > &inputWeightsCube, casacore::Matrix< casacore::Float > &inputWeightsPlane)
casacore::MeasurementSet * getOutputMs()
Needed by MSTransformIterator.
casacore::MFrequency::Types determineInputRefFrame()
vi::FrequencySelectionUsingChannels * channelSelector_p
casacore::Vector< casacore::Double > CHAN_FREQ_aux
void propagateWeights(casacore::Bool on)
Setters for Weight-based transformation.
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
void smoothRegrid(casacore::Int inputSpw, const casacore::Vector< T > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< T > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
void initFrequencyTransGrid(vi::VisBuffer2 *vb)
casacore::Cube< casacore::Complex > * visCube_p
void checkFillFlagCategory()
Column check.
casacore::Bool inputWeightSpectrumAvailable_p
void flagAverageKernel(const casacore::Vector< T > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &, casacore::Vector< T > &outputData, casacore::Vector< casacore::Bool > &outputFlags, casacore::uInt startInputPos, casacore::uInt outputPos, casacore::uInt width)
map< pair< pair< casacore::uInt, casacore::uInt >, casacore::uInt >, std::vector< casacore::uInt > > baselineMap
void bufferOutputPlanesInSlices(casacore::uInt row, casacore::Matrix< T > &outputDataPlane, casacore::Matrix< casacore::Bool > &outputFlagsPlane, casacore::ArrayColumn< T > &outputDataCol, casacore::ArrayColumn< casacore::Bool > &outputFlagCol)
casacore::Bool timeAverage_p
casacore::Time transformation parameters
casacore::String mode_p
Frequency specification parameters.
casacore::Double TOTAL_BANDWIDTH
casacore::Bool dataColumnAvailable_p
casacore::Double wtToSigma(casacore::Double wt)
Returns 1/sqrt(wt) or -1, depending on whether wt is positive.
casacore::Bool radialVelocityCorrection_p
void(casa::MSTransformManager::* writeOutputPlanesComplex_p)(casacore::uInt row, casacore::Matrix< casacore::Complex > &outputDataPlane, casacore::Matrix< casacore::Bool > &outputFlagsPlane, casacore::ArrayColumn< casacore::Complex > &outputDataCol, casacore::ArrayColumn< casacore::Bool > &outputFlagCol)
casacore::Double upperBound() const
casacore::Convolver< casacore::Float > * getConvolver(casacore::Int const numChan)
void interpol1Dfftshift(casacore::Int inputSpw, const casacore::Vector< T > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< T > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
casacore::String baselineSelection_p
void flagWeightNonZeroAverageKernel(const casacore::Vector< T > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &, casacore::Vector< T > &outputData, casacore::Vector< casacore::Bool > &, casacore::uInt startInputPos, casacore::uInt outputPos, casacore::uInt width)
casacore::MDirection phaseCenter_p
casacore::Double REF_FREQUENCY
void bufferOutputPlanes(casacore::uInt row, casacore::Matrix< T > &outputDataPlane, casacore::Matrix< casacore::Bool > &outputFlagsPlane, casacore::ArrayColumn< T > &outputDataCol, casacore::ArrayColumn< casacore::Bool > &outputFlagCol)
casacore::uInt interpolationMethod_p
void reindexVector(const casacore::Vector< T > &inputVector, casacore::Vector< T > &outputVector, map< casacore::uInt, casacore::uInt > &inputOutputIndexMap)
casacore::IPosition getTransformedShape(vi::VisBuffer2 *inputVisBuffer)
map< casacore::Int, std::vector< casacore::Int > > inputOutputChanIndexMap_p
map< casacore::uInt, casacore::uInt > inputOutputArrayIndexMap_p
map< casacore::uInt, casacore::uInt > numOfCombInputChanMap_p
A Table intended to hold astronomical data (a set of Measurements).
void parseMsSpecParams(casacore::Record &configuration)
casacore::Vector< casacore::Double > RESOLUTION
std::vector< casacore::Double > contribFrac
void fillWeightsPlane(casacore::uInt pol, casacore::uInt inputChannel, casacore::uInt outputChannel, casacore::uInt inputRow, const casacore::Cube< casacore::Float > &inputWeightsCube, casacore::Matrix< casacore::Float > &inputWeightsPlane, casacore::Double weight)
virtual void setIterationApproach()
Iterator set-up.
void initGridForRegridTClean(const Vector< Double > &originalCHAN_FREQ, const Vector< Double > &regriddedCHAN_FREQ, const Vector< Double > &regriddedCHAN_WIDTH, Double widthFactor)
casacore::uInt nspws_p
Frequency transformation parameters.
casacore::MSColumns * outputMsCols_p
casacore::ROMSColumns * selectedInputMsCols_p
casacore::MEpoch referenceTime_p
void smoothCubeOfData(vi::VisBuffer2 *vb, casacore::RefRows &rowRef, const casacore::Cube< T > &inputDataCube, casacore::ArrayColumn< T > &outputDataCol, casacore::ArrayColumn< casacore::Bool > *outputFlagCol, const casacore::Cube< casacore::Float > &inputWeightCube)
casacore::Double EFFECTIVE_BW
casacore::Bool phaseShifting_p
Phase shifting parameters.
casacore::Bool transformDDIVector(const casacore::Vector< casacore::Int > &inputVector, casacore::Vector< casacore::Int > &outputVector)
void writeOutputPlaneSlices(casacore::Matrix< T > &outputPlane, casacore::ArrayColumn< T > &outputDataCol, casacore::Slice &sliceX, casacore::Slice &sliceY, casacore::IPosition &outputPlaneShape, casacore::uInt &outputRow)
casacore::Bool weightSpectrumFlatFilled_p
casacore::Cube< casacore::Bool > * flagCube_p
casacore::Bool transformNotReindexableVector(const casacore::Vector< T > &inputVector, casacore::Vector< T > &outputVector, casacore::Bool constant)
Templates methods to transform vectors that must be available for MSTransformBuffer.
void writeOutputFlagsPlane(casacore::Matrix< casacore::Bool > &outputPlane, casacore::ArrayColumn< casacore::Bool > &outputCol, casacore::IPosition &outputPlaneShape, casacore::uInt &outputRow)
iterator end()
Definition: Array.h:860
casacore::uInt NUM_CHAN
void dontWriteOutputPlaneReshapedSlices(casacore::Matrix< casacore::Bool > &, casacore::ArrayColumn< casacore::Bool > &, casacore::Slice &, casacore::Slice &, casacore::IPosition &, casacore::uInt &)
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
casacore::Bool lagDataColumnAvailable_p
bool operator<(const channelInfo &right_operand) const
void reindexColumn(casacore::ScalarColumn< casacore::Int > &inputCol, casacore::Int value)
map< casacore::uInt, casacore::uInt > outputInputSPWIndexMap_p
casacore::Double CHAN_FREQ
map< casacore::uInt, casacore::uInt > inputOutputAntennaIndexMap_p
void cumSumKernel(const casacore::Vector< T > &inputData, const casacore::Vector< casacore::Bool > &, const casacore::Vector< casacore::Float > &, casacore::Vector< T > &outputData, casacore::Vector< casacore::Bool > &, casacore::uInt startInputPos, casacore::uInt outputPos, casacore::uInt width)
void setSmoothingKernel(casacore::uInt mode)
map< casacore::Int, casacore::Convolver< casacore::Float > > convolverPool_
void writeOutputFlagsPlaneSlices(casacore::Matrix< casacore::Bool > &outputPlane, casacore::ArrayColumn< casacore::Bool > &outputCol, casacore::Slice &sliceX, casacore::Slice &sliceY, casacore::IPosition &outputPlaneShape, casacore::uInt &outputRow)
A class to provide easy read-write access to MeasurementSet columns.
Definition: MSColumns.h:221
void(casa::MSTransformManager::* averageKernelComplex_p)(const casacore::Vector< casacore::Complex > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &inputWeights, casacore::Vector< casacore::Complex > &outputData, casacore::Vector< casacore::Bool > &outputFlags, casacore::uInt startInputPos, casacore::uInt outputPos, casacore::uInt width)
casacore::MFrequency::Types inputReferenceFrame_p
Reference Frame Transformation members.
void fftshift(casacore::Int inputSpw, const casacore::Vector< casacore::Complex > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< casacore::Complex > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
A top level class defining the data handling interface for the MSTransform module.
void transformAndWriteCubeOfData(casacore::Int inputSpw, casacore::RefRows &rowRef, const casacore::Cube< T > &inputDataCube, const casacore::Cube< casacore::Bool > &inputFlagsCube, const casacore::Cube< casacore::Float > &inputWeightsCube, casacore::IPosition &outputPlaneShape, casacore::ArrayColumn< T > &outputDataCol, casacore::ArrayColumn< casacore::Bool > *outputFlagCol)
casacore::Vector< casacore::Int > freqbin_p
VisBuffer2 * getVisBuffer()
Returns the VisBuffer permanently attached to this VisibilityIterator.
void(casa::MSTransformManager::* averageKernelFloat_p)(const casacore::Vector< casacore::Float > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &inputWeights, casacore::Vector< casacore::Float > &outputData, casacore::Vector< casacore::Bool > &outputFlags, casacore::uInt startInputPos, casacore::uInt outputPos, casacore::uInt width)
casacore::Bool calibrate_p
casacore::uInt minbaselines_p;
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void initRefFrameTransParams()
To re-grid SPW subtable.
void(casa::MSTransformManager::* regridCoreFloat_p)(casacore::Int inputSpw, const casacore::Vector< casacore::Float > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< casacore::Float > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
void(casa::MSTransformManager::* writeOutputFlagsPlaneSlices_p)(casacore::Matrix< casacore::Bool > &outputPlane, casacore::ArrayColumn< casacore::Bool > &outputCol, casacore::Slice &sliceX, casacore::Slice &sliceY, casacore::IPosition &outputPlaneShape, casacore::uInt &outputRow)
casacore::MRadialVelocity radialVelocity_p
void mapMatrix(const casacore::Matrix< T > &inputMatrix, casacore::Matrix< T > &outputMatrix)
Fill the data from an input matrix with shape [nCol,nBaselinesxnSPWsxnScans/nStates] into an output ...
map< casacore::uInt, casacore::Float > weightFactorMap_p
casacore::FFTServer< casacore::Float, casacore::Complex > fFFTServer_p
void(casa::MSTransformManager::* addWeightSpectrumContribution_p)(casacore::Double &weight, casacore::uInt &pol, casacore::uInt &inputChannel, casacore::uInt &row, const casacore::Cube< casacore::Float > &inputWeightsCube)
casacore::uInt inpChannel
map< casacore::uInt, casacore::uInt > numOfInpChanMap_p
std::shared_ptr< casacore::MSFieldColumns > inputMSFieldCols_p
void reset(casacore::Vector< casacore::Double > &chanFreq, casacore::Vector< casacore::Double > &chanWidth)
size_t size() const
Definition: ArrayBase.h:101
casacore::Bool regridTClean_p
For when the interpolation needs to be done the tclean way (output width &gt; 2 input width)...
casacore::String scanSelection_p
void transformAndWriteSpectrum(vi::VisBuffer2 *vb, casacore::RefRows &rowRef, const casacore::Cube< casacore::Float > &inputSpectrum, casacore::ArrayColumn< casacore::Float > &outputCubeCol, casacore::ArrayColumn< casacore::Float > &outputMatrixCol, MSTransformations::weightTransformation weightTransformation, casacore::Bool flushSpectrumCube)
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
Definition: MFrequency.h:176
map< casacore::uInt, casacore::Float > newSigmaFactorMap_p
casacore::Bool refFrameTransformation_p
void writeOutputFlagsPlaneReshapedSlices(casacore::Matrix< casacore::Bool > &outputPlane, casacore::ArrayColumn< casacore::Bool > &outputCol, casacore::Slice &sliceX, casacore::Slice &sliceY, casacore::IPosition &outputPlaneShape, casacore::uInt &outputRow)
void mapVector(const casacore::Vector< T > &inputVector, casacore::Vector< T > &outputVector)
void fillDataCols(vi::VisBuffer2 *vb, casacore::RefRows &rowRef)
void resize(size_t len, Bool copyValues=False)
Definition: Vector.h:167
void parsePointingsInterpolationParams(casacore::Record &configuration)
casacore::String timeSelection_p
void parseRefFrameTransParams(casacore::Record &configuration)
void dontSetWeightStripeByReference(casacore::uInt, casacore::Matrix< casacore::Float > &, casacore::Vector< casacore::Float > &)
void transformAndWritePlaneOfData(casacore::Int inputSpw, casacore::uInt row, casacore::Matrix< T > &inputDataPlane, casacore::Matrix< casacore::Bool > &inputFlagsPlane, casacore::Matrix< casacore::Float > &inputWeightsPlane, casacore::Matrix< T > &outputDataPlane, casacore::Matrix< casacore::Bool > &outputFlagsPlane, casacore::ArrayColumn< T > &outputDataCol, casacore::ArrayColumn< casacore::Bool > *outputFlagCol)
casacore::MFrequency::Types outputReferenceFrame_p
map< casacore::uInt, casacore::Float > newWeightFactorMap_p
void regrid(casacore::Int, const casacore::Vector< T > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &, casacore::Vector< T > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
map< casacore::MS::PredefinedColumns, casacore::MS::PredefinedColumns > dataColMap
casacore::Map definition
void regridCore(casacore::Int inputSpw, const casacore::Vector< casacore::Complex > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &inputWeightsStripe, casacore::Vector< casacore::Complex > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
casacore::IPosition getShape()
casacore::Double overlap(const channelInfo &other) const
void(casa::MSTransformManager::* transformCubeOfDataFloat_p)(vi::VisBuffer2 *vb, casacore::RefRows &rowRef, const casacore::Cube< casacore::Float > &inputDataCube, casacore::ArrayColumn< casacore::Float > &outputDataCol, casacore::ArrayColumn< casacore::Bool > *outputFlagCol, const casacore::Cube< casacore::Float > &inputWeightCube)
casacore::Vector< casacore::Double > EFFECTIVE_BW
casacore::Record polAverageConfig_p
casacore::MSMainEnums::PredefinedColumns mainColumn_p
map< casacore::uInt, casacore::uInt > inputOutputScanIntentIndexMap_p
casacore::uInt tailOfChansforLastSpw_p
casacore::String inpMsName_p
casacore::MS specification parameters
casacore::Bool weightSpectrumFromSigmaFilled_p
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
void flagCumSumKernel(const casacore::Vector< T > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &, casacore::Vector< T > &outputData, casacore::Vector< casacore::Bool > &, casacore::uInt startInputPos, casacore::uInt outputPos, casacore::uInt width)
MSTransformManager definition.
void plainSmooth(const casacore::Vector< T > &inputData, const casacore::Vector< casacore::Bool > &inputFlags, const casacore::Vector< casacore::Float > &inputWeights, casacore::Vector< T > &outputData, casacore::Vector< casacore::Bool > &outputFlags, casacore::uInt outputPos)
casacore::Bool floatDataColumnAvailable_p
void dontsetWeightsPlaneByReference(casacore::uInt, const casacore::Cube< casacore::Float > &, casacore::Matrix< casacore::Float > &)
casacore::Bool transformReindexableVector(const casacore::Vector< T > &inputVector, casacore::Vector< T > &outputVector, casacore::Bool constant, map< casacore::uInt, casacore::uInt > &inputOutputIndexMap)
unsigned int uInt
Definition: aipstype.h:51
casacore::Bool scalarAverage_p
For scalar averaging, use &quot;timebin&quot; for iter interval but don&#39;t average.
casacore::Cube< casacore::Float > weightSpectrumCubeDummy_p
void colCheckInfo(const casacore::String &inputColName, const casacore::String &outputColName)
void interpol1D(casacore::Int inputSpw, const casacore::Vector< T > &inputDataStripe, const casacore::Vector< casacore::Bool > &inputFlagsStripe, const casacore::Vector< casacore::Float > &, casacore::Vector< T > &outputDataStripe, casacore::Vector< casacore::Bool > &outputFlagsStripe)
void(casa::MSTransformManager::* setWeightStripeByReference_p)(casacore::uInt corrIndex, casacore::Matrix< casacore::Float > &inputWeightsPlane, casacore::Vector< casacore::Float > &inputWeightsStripe)
const casacore::Cube< casacore::Float > & getWeightSpectrumFlat(vi::VisBuffer2 *vb)
casacore::Double maxuvwdistance_p