casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ResamplerWorklet.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //# ResamplerWorklet.h: Definition of the ResamplerWorklet class
3 //# Copyright (C) 1997,1998,1999,2000,2001,2002,2003
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //# $Id$
28 
29 #ifndef SYNTHESIS_RESAMPLERWORKLET_H
30 #define SYNTHESIS_RESAMPLERWORKLET_H
31 
36 #include <msvis/MSVis/VisBuffer.h>
37 #include <casa/Arrays/Vector.h>
38 #include <casa/Arrays/Array.h>
39 
41 #include <casa/Logging/LogSink.h>
42 #include <casa/Logging/LogIO.h>
43 #include <sys/syscall.h>
44 
45 using namespace casa::async;
46 using namespace std;
47 namespace casa { //# NAMESPACE CASA - BEGIN
48  class ResamplerWorklet : public Thread
49  {
50  public:
51  enum PGridderMode {DataToGrid=0, GridToData};
52  ResamplerWorklet() {myGriddedDataDouble_p=NULL;myGriddedDataSingle_p=NULL;};
53  virtual ~ResamplerWorklet(){terminate();}
55 
56  void setID(const casacore::Int& id) {myID_p=id;}
57  void initThread(casacore::Int& id, casacore::CountedPtr<ThreadCoordinator<casacore::Int> >& threadClerk,
58  VisibilityResamplerBase* resampler);
59  void initToVis(VBStore* vbs, const casacore::Array<casacore::Complex>* skyFTGrid) ;
60  void initToSky(VBStore* vbs,casacore::Array<casacore::DComplex>* griddedData, casacore::Matrix<casacore::Double>* sumwt) ;
61  void initToSky(VBStore* vbs,casacore::Array<casacore::Complex>* griddedData, casacore::Matrix<casacore::Double>* sumwt) ;
62 
63  void init(casacore::Int& id,
65  VisibilityResamplerBase* resampler, VBStore* vbs,
67  casacore::Array<casacore::Complex>* skyFTGrid=NULL);
68  void init(casacore::Int& id,
70  VisibilityResamplerBase* resampler, VBStore* vbs,
72  casacore::Array<casacore::Complex>* skyFTGrid=NULL);
73  void* run();
74  void setPID();
75  pid_t getPID() {return myPID_p;}
76  pid_t getTID() {return myTID_p;}
77  casacore::Int getID () {return myID_p;}
78 
79  //
80  //------------------------------------------------------------------------------
81  //----------------------------Private parts-------------------------------------
82  //------------------------------------------------------------------------------
83  //
84  private:
92  pid_t myPID_p, myTID_p;
94  pid_t gettid_p () {return syscall (SYS_gettid);};
95  };
96 }; //# NAMESPACE CASA - END
97 
98 #endif //
int Int
Definition: aipstype.h:50
void setID(const casacore::Int &id)
const casacore::Array< casacore::Complex > * mySkyFTGrid_p
PtrHolder< T > & operator=(const PtrHolder< T > &other)
casacore::Matrix< casacore::Double > * mySumWt_p
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
casacore::Array< casacore::Complex > * myGriddedDataSingle_p
casacore::Int myID_p
-------------------------—Private parts----------------------------------—
VisibilityResamplerBase * myResampler_p
casacore::CountedPtr< ThreadCoordinator< casacore::Int > > myThreadClerk_p
casacore::Array< casacore::DComplex > * myGriddedDataDouble_p