casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MeasTableMul.h
Go to the documentation of this file.
1 //# MeasTableMul.h: Nutation multiplication coefficient for MeasTable
2 //# Copyright (C) 1995-1999,2000-2004
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id: MeasTable.h 21420 2014-03-19 09:18:51Z gervandiepen $
28 
29 #ifndef MEASURES_MEASTABLEMUL_H
30 #define MEASURES_MEASTABLEMUL_H
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
36 #include <casacore/casa/OS/Mutex.h>
37 #include <vector>
38 
39 namespace casacore { //# NAMESPACE CASACORE - BEGIN
40 
41  //# Forward Declarations
42  class RotMatrix;
43  class Euler;
44 
45  // <summary>
46  // MeasTableMul provides thread-safe access to time-dependent multiplier matrices
47  // </summary>
48 
49  // <use visibility=local>
50 
51  // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasMath" demos="">
52  // </reviewed>
53 
54  // <synopsis>
55  // MeasTableMul is a helper class for MeasTable to provide thread-safe
56  // access to the various multiplier matrices for nutation, aberration, and
57  // solar position. These matrices are dependent on the epoch.
58  //
59  // It is an abstract base class for specific derived classes dealing with
60  // the various effects. This base class provides a cache to keep the matrices
61  // for various epochs alive. The idea is that a program will process epochs
62  // in order, where multiple threads can handle different epochs.
63  // <br>When the cache is full, the least recently used entry is replaced by
64  // the new matrix.
65  //
66  // The cache does not hold <src>Matrix</src> objects themselves, but a
67  // <src>CountedPtr<Matrix></src> to avoid that in one thread a Matrix is
68  // removed from the cache, while another thread is still using that Matrix.
69  // This assumes that CountedPtr is compiled thread-safe.
70  //
71  // The class provides two virtual functions.
72  // <ul>
73  // <li> <src>init</src> is called on the first access and makes it possible
74  // for the derived class to precompute some variables. In particular,
75  // <src>itsDefMatrix</src> should be filled with default values.
76  // <li> <src>calc</src> is called on each access and should return the
77  // matrix valid for the given epoch. Prior to calling this function,
78  // the class will copy <src>itsDefMatrix</src> to the result which
79  // also defines the shape of the result.
80  // Note that this function is only called if the matrix for the given
81  // epoch is not in the cache.
82  // </ul>
83  // </synopsis>
84  //
85  // <example>
86  // Class MeasTable shows how it is used.
87  // </example>
88 
90  {
91  public:
92  MeasTableMul();
93  virtual ~MeasTableMul() {}
94  void clear();
96  virtual void init() = 0;
97  virtual void calc(Matrix<Double>&, Double time) = 0;
98  protected:
101  vector<Int64> itsUsed;
102  vector<Double> itsTimes;
103  vector<CountedPtr<Matrix<Double> > > itsArrays;
105  };
106 
107 
108  // <summary>
109  // Base class for standard and B1950 nutation multipliers.
110  // </summary>
112  {
113  public:
115  protected:
116  void doInit(Matrix<Double>& result,
117  Polynomial<Double> poly[],
118  Int nrowTD, const Long coeffTD[][5],
119  Int nrowSC, const Short coeffSC[][2]);
120  void doCalc(Matrix<Double>& result, Double time,
121  const Polynomial<Double> poly[],
122  Int nrowTD, const Long coeffTD[][5]);
123  };
124 
125  // <summary>
126  // Class calculating the standard nutation multipliers.
127  // </summary>
129  {
130  public:
131  MeasTableMulSC();
132  virtual void init();
133  virtual void calc(Matrix<Double>&, Double time);
134  private:
136  static const Long theirMULTD[15][5];
137  static const Short theirMULSC[106][2];
138  };
139 
140  // <summary>
141  // Class calculating the B1950 nutation multipliers.
142  // </summary>
144  {
145  public:
147  virtual void init();
148  virtual void calc(Matrix<Double>&, Double time);
149  private:
151  static const Long theirMULTD[13][5];
152  static const Short theirMULSC[69][2];
153  };
154 
155 
156  // <summary>
157  // Base class for J2000 nutation multipliers.
158  // </summary>
160  {
161  public:
163  protected:
164  void doInit(Matrix<Double>& result,
165  Polynomial<Double> poly[],
166  Int nrowSC, const Long coeffSC[][6]);
167  void doCalc(Matrix<Double>& result, Double time,
168  const Polynomial<Double> poly[],
169  Int nrowSC);
170  };
171 
172  // <summary>
173  // Class calculating the J2000A nutation multipliers.
174  // </summary>
176  {
177  public:
179  virtual void init();
180  virtual void calc(Matrix<Double>&, Double time);
181  private:
183  static const Long theirMULSC[678][6];
184  };
185 
186  // <summary>
187  // Class calculating the J2000B nutation multipliers.
188  // </summary>
190  {
191  public:
193  virtual void init();
194  virtual void calc(Matrix<Double>&, Double time);
195  private:
197  static const Long theirMULSC[77][6];
198  };
199 
200 
201  // <summary>
202  // Class calculating the standard aberration multipliers.
203  // </summary>
205  {
206  public:
208  virtual void init();
209  virtual void calc(Matrix<Double>&, Double time);
210  private:
212  static const Long theirMABERTD[3][18];
213  static const Short theirMABER[80][6];
214  };
215 
216 
217  // <summary>
218  // Class calculating the B1950 aberration multipliers.
219  // </summary>
221  {
222  public:
224  virtual void init();
225  virtual void calc(Matrix<Double>&, Double time);
226  private:
228  double itsFactor; //# AU/d
229  static const Short theirMABER[130][6];
230  static const Short theirABERT1T[10];
231  static const Short theirABERT2T[2];
232  static const Short theirABERT3T[1];
233  static const Double theirABERSPEC[2][6];
234  };
235 
236 
237  // <summary>
238  // Class calculating the XY solar position multipliers.
239  // </summary>
241  {
242  public:
244  virtual void init();
245  virtual void calc(Matrix<Double>&, Double time);
246  private:
247  static const Double theirMPOSXY[98][4];
248  };
249 
250  // <summary>
251  // Class calculating the Z solar position multipliers.
252  // </summary>
254  {
255  public:
257  virtual void init();
258  virtual void calc(Matrix<Double>&, Double time);
259  private:
260  static const Double theirMPOSZ[29][2];
261  };
262 
263 
264  // <summary>
265  // Class calculating the XY earth position multipliers.
266  // </summary>
268  {
269  public:
271  virtual void init();
272  virtual void calc(Matrix<Double>&, Double time);
273  private:
274  static const Double theirMPOSXY[189][4];
275  };
276 
277  // <summary>
278  // Class calculating the Z earth position multipliers.
279  // </summary>
281  {
282  public:
284  virtual void init();
285  virtual void calc(Matrix<Double>&, Double time);
286  private:
287  static const Double theirMPOSZ[32][2];
288  };
289 
290 
291 } //# end namespace
292 
293 #endif
MeasTableMul provides thread-safe access to time-dependent multiplier matrices.
Definition: MeasTableMul.h:89
static const Long theirMULSC[77][6]
Definition: MeasTableMul.h:197
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition: aipsxtype.h:38
int Int
Definition: aipstype.h:50
virtual void calc(Matrix< Double > &, Double time)
void doCalc(Matrix< Double > &result, Double time, const Polynomial< Double > poly[], Int nrowSC)
virtual void calc(Matrix< Double > &, Double time)
TableExprNode time(const TableExprNode &node)
Definition: ExprNode.h:1537
Polynomial< Double > itsPoly[18]
Definition: MeasTableMul.h:227
static const Long theirMULTD[13][5]
Definition: MeasTableMul.h:151
void doInit(Matrix< Double > &result, Polynomial< Double > poly[], Int nrowSC, const Long coeffSC[][6])
virtual void calc(Matrix< Double > &, Double time)=0
Class calculating the B1950 aberration multipliers.
Definition: MeasTableMul.h:220
Class calculating the B1950 nutation multipliers.
Definition: MeasTableMul.h:143
virtual void calc(Matrix< Double > &, Double time)
static const Double theirMPOSXY[189][4]
Definition: MeasTableMul.h:274
Class calculating the J2000B nutation multipliers.
Definition: MeasTableMul.h:189
static const Short theirMABER[130][6]
Definition: MeasTableMul.h:229
void doInit(Matrix< Double > &result, Polynomial< Double > poly[], Int nrowTD, const Long coeffTD[][5], Int nrowSC, const Short coeffSC[][2])
Class calculating the XY earth position multipliers.
Definition: MeasTableMul.h:267
short Short
Definition: aipstype.h:48
Class calculating the Z solar position multipliers.
Definition: MeasTableMul.h:253
Polynomial< Double > itsPoly[2 *15]
Definition: MeasTableMul.h:135
vector< Double > itsTimes
Definition: MeasTableMul.h:102
long Long
Definition: aipstype.h:52
Class calculating the J2000A nutation multipliers.
Definition: MeasTableMul.h:175
Class calculating the XY solar position multipliers.
Definition: MeasTableMul.h:240
vector< CountedPtr< Matrix< Double > > > itsArrays
Definition: MeasTableMul.h:103
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
static const Short theirMABER[80][6]
Definition: MeasTableMul.h:213
virtual void calc(Matrix< Double > &, Double time)
Polynomial< Double > itsPoly[18]
Definition: MeasTableMul.h:211
Class calculating the Z earth position multipliers.
Definition: MeasTableMul.h:280
double Double
Definition: aipstype.h:55
virtual void calc(Matrix< Double > &, Double time)
static const Short theirMULSC[106][2]
Definition: MeasTableMul.h:137
static const Short theirABERT3T[1]
Definition: MeasTableMul.h:232
static const Short theirABERT1T[10]
Definition: MeasTableMul.h:230
virtual void init()=0
Base class for standard and B1950 nutation multipliers.
Definition: MeasTableMul.h:111
static const Double theirABERSPEC[2][6]
Definition: MeasTableMul.h:233
Base class for J2000 nutation multipliers.
Definition: MeasTableMul.h:159
virtual void calc(Matrix< Double > &, Double time)
virtual void calc(Matrix< Double > &, Double time)
Wrapper around a pthreads mutex.
Definition: Mutex.h:58
static const Short theirMULSC[69][2]
Definition: MeasTableMul.h:152
Class calculating the standard aberration multipliers.
Definition: MeasTableMul.h:204
static const Long theirMULSC[678][6]
Definition: MeasTableMul.h:183
Matrix< Double > itsDefArray
Definition: MeasTableMul.h:104
CountedPtr< Matrix< Double > > getArray(Double time, Double epsilon)
Polynomial< Double > itsPoly[2 *77]
Definition: MeasTableMul.h:196
vector< Int64 > itsUsed
Definition: MeasTableMul.h:101
static const Long theirMABERTD[3][18]
Definition: MeasTableMul.h:212
static const Short theirABERT2T[2]
Definition: MeasTableMul.h:231
virtual void calc(Matrix< Double > &, Double time)
static const Double theirMPOSXY[98][4]
Definition: MeasTableMul.h:247
static const Double theirMPOSZ[29][2]
Definition: MeasTableMul.h:260
virtual void calc(Matrix< Double > &, Double time)
void doCalc(Matrix< Double > &result, Double time, const Polynomial< Double > poly[], Int nrowTD, const Long coeffTD[][5])
Polynomial< Double > itsPoly[2 *678]
Definition: MeasTableMul.h:182
Class calculating the standard nutation multipliers.
Definition: MeasTableMul.h:128
virtual void calc(Matrix< Double > &, Double time)
static const Long theirMULTD[15][5]
Definition: MeasTableMul.h:136
static const Double theirMPOSZ[32][2]
Definition: MeasTableMul.h:287
Polynomial< Double > itsPoly[2 *13]
Definition: MeasTableMul.h:150
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42