casacore
Loading...
Searching...
No Matches
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: casa-feedback@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#ifndef MEASURES_MEASTABLEMUL_H
27#define MEASURES_MEASTABLEMUL_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/scimath/Functionals/Polynomial.h>
32#include <casacore/casa/Arrays/Matrix.h>
33
34#include <mutex>
35#include <vector>
36#include <memory>
37
38namespace casacore { //# NAMESPACE CASACORE - BEGIN
39
40 //# Forward Declarations
41 class RotMatrix;
42 class Euler;
43
44 // <summary>
45 // MeasTableMul provides thread-safe access to time-dependent multiplier matrices
46 // </summary>
47
48 // <use visibility=local>
49
50 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasMath" demos="">
51 // </reviewed>
52
53 // <synopsis>
54 // MeasTableMul is a helper class for MeasTable to provide thread-safe
55 // access to the various multiplier matrices for nutation, aberration, and
56 // solar position. These matrices are dependent on the epoch.
57 //
58 // It is an abstract base class for specific derived classes dealing with
59 // the various effects. This base class provides a cache to keep the matrices
60 // for various epochs alive. The idea is that a program will process epochs
61 // in order, where multiple threads can handle different epochs.
62 // <br>When the cache is full, the least recently used entry is replaced by
63 // the new matrix.
64 //
65 // The cache does not hold <src>Matrix</src> objects themselves, but a
66 // <src>std::shared_ptr<Matrix></src> to avoid that in one thread a Matrix is
67 // removed from the cache, while another thread is still using that Matrix.
68 // This assumes that std::shared_ptr is compiled thread-safe.
69 //
70 // The class provides two virtual functions.
71 // <ul>
72 // <li> <src>init</src> is called on the first access and makes it possible
73 // for the derived class to precompute some variables. In particular,
74 // <src>itsDefMatrix</src> should be filled with default values.
75 // <li> <src>calc</src> is called on each access and should return the
76 // matrix valid for the given epoch. Prior to calling this function,
77 // the class will copy <src>itsDefMatrix</src> to the result which
78 // also defines the shape of the result.
79 // Note that this function is only called if the matrix for the given
80 // epoch is not in the cache.
81 // </ul>
82 // </synopsis>
83 //
84 // <example>
85 // Class MeasTable shows how it is used.
86 // </example>
87
89 {
90 public:
92 virtual ~MeasTableMul() {}
93 void clear();
94 std::shared_ptr<Matrix<Double>> getArray (Double time, Double epsilon);
95 virtual void init() = 0;
96 virtual void calc(Matrix<Double>&, Double time) = 0;
97 protected:
98 std::mutex itsMutex;
100 std::vector<Int64> itsUsed;
101 std::vector<Double> itsTimes;
102 std::vector<std::shared_ptr<Matrix<Double>>> itsArrays;
104 };
105
106
107 // <summary>
108 // Base class for standard and B1950 nutation multipliers.
109 // </summary>
111 {
112 public:
114 protected:
115 void doInit(Matrix<Double>& result,
116 Polynomial<Double> poly[],
117 Int nrowTD, const Long coeffTD[][5],
118 Int nrowSC, const Short coeffSC[][2]);
120 const Polynomial<Double> poly[],
121 Int nrowTD, const Long coeffTD[][5]);
122 };
123
124 // <summary>
125 // Class calculating the standard nutation multipliers.
126 // </summary>
128 {
129 public:
131 virtual void init();
133 private:
135 static const Long theirMULTD[15][5];
136 static const Short theirMULSC[106][2];
137 };
138
139 // <summary>
140 // Class calculating the B1950 nutation multipliers.
141 // </summary>
143 {
144 public:
146 virtual void init();
148 private:
150 static const Long theirMULTD[13][5];
151 static const Short theirMULSC[69][2];
152 };
153
154
155 // <summary>
156 // Base class for J2000 nutation multipliers.
157 // </summary>
159 {
160 public:
162 protected:
163 void doInit(Matrix<Double>& result,
164 Polynomial<Double> poly[],
165 Int nrowSC, const Long coeffSC[][6]);
167 const Polynomial<Double> poly[],
168 Int nrowSC);
169 };
170
171 // <summary>
172 // Class calculating the J2000A nutation multipliers.
173 // </summary>
175 {
176 public:
178 virtual void init();
180 private:
182 static const Long theirMULSC[678][6];
183 };
184
185 // <summary>
186 // Class calculating the J2000B nutation multipliers.
187 // </summary>
189 {
190 public:
192 virtual void init();
194 private:
196 static const Long theirMULSC[77][6];
197 };
198
199
200 // <summary>
201 // Class calculating the standard aberration multipliers.
202 // </summary>
204 {
205 public:
207 virtual void init();
209 private:
211 static const Long theirMABERTD[3][18];
212 static const Short theirMABER[80][6];
213 };
214
215
216 // <summary>
217 // Class calculating the B1950 aberration multipliers.
218 // </summary>
220 {
221 public:
223 virtual void init();
225 private:
227 double itsFactor; //# AU/d
228 static const Short theirMABER[130][6];
229 static const Short theirABERT1T[10];
230 static const Short theirABERT2T[2];
231 static const Short theirABERT3T[1];
232 static const Double theirABERSPEC[2][6];
233 };
234
235
236 // <summary>
237 // Class calculating the XY solar position multipliers.
238 // </summary>
240 {
241 public:
243 virtual void init();
245 private:
246 static const Double theirMPOSXY[98][4];
247 };
248
249 // <summary>
250 // Class calculating the Z solar position multipliers.
251 // </summary>
253 {
254 public:
256 virtual void init();
258 private:
259 static const Double theirMPOSZ[29][2];
260 };
261
262
263 // <summary>
264 // Class calculating the XY earth position multipliers.
265 // </summary>
267 {
268 public:
270 virtual void init();
272 private:
273 static const Double theirMPOSXY[189][4];
274 };
275
276 // <summary>
277 // Class calculating the Z earth position multipliers.
278 // </summary>
280 {
281 public:
283 virtual void init();
285 private:
286 static const Double theirMPOSZ[32][2];
287 };
288
289
290} //# end namespace
291
292#endif
Class calculating the B1950 aberration multipliers.
Polynomial< Double > itsPoly[18]
static const Short theirABERT2T[2]
virtual void calc(Matrix< Double > &, Double time)
static const Short theirABERT3T[1]
static const Short theirABERT1T[10]
static const Double theirABERSPEC[2][6]
static const Short theirMABER[130][6]
Class calculating the standard aberration multipliers.
Polynomial< Double > itsPoly[18]
virtual void calc(Matrix< Double > &, Double time)
static const Short theirMABER[80][6]
static const Long theirMABERTD[3][18]
Class calculating the XY earth position multipliers.
virtual void calc(Matrix< Double > &, Double time)
static const Double theirMPOSXY[189][4]
Class calculating the Z earth position multipliers.
virtual void calc(Matrix< Double > &, Double time)
static const Double theirMPOSZ[32][2]
Class calculating the XY solar position multipliers.
virtual void calc(Matrix< Double > &, Double time)
static const Double theirMPOSXY[98][4]
Class calculating the Z solar position multipliers.
static const Double theirMPOSZ[29][2]
virtual void calc(Matrix< Double > &, Double time)
Class calculating the B1950 nutation multipliers.
Polynomial< Double > itsPoly[2 *13]
virtual void calc(Matrix< Double > &, Double time)
static const Short theirMULSC[69][2]
static const Long theirMULTD[13][5]
Class calculating the J2000A nutation multipliers.
Polynomial< Double > itsPoly[2 *678]
static const Long theirMULSC[678][6]
virtual void calc(Matrix< Double > &, Double time)
Class calculating the J2000B nutation multipliers.
Polynomial< Double > itsPoly[2 *77]
static const Long theirMULSC[77][6]
virtual void calc(Matrix< Double > &, Double time)
Base class for J2000 nutation multipliers.
void doInit(Matrix< Double > &result, Polynomial< Double > poly[], Int nrowSC, const Long coeffSC[][6])
void doCalc(Matrix< Double > &result, Double time, const Polynomial< Double > poly[], Int nrowSC)
Base class for standard and B1950 nutation multipliers.
void doCalc(Matrix< Double > &result, Double time, const Polynomial< Double > poly[], Int nrowTD, const Long coeffTD[][5])
void doInit(Matrix< Double > &result, Polynomial< Double > poly[], Int nrowTD, const Long coeffTD[][5], Int nrowSC, const Short coeffSC[][2])
Class calculating the standard nutation multipliers.
virtual void calc(Matrix< Double > &, Double time)
static const Short theirMULSC[106][2]
Polynomial< Double > itsPoly[2 *15]
static const Long theirMULTD[15][5]
virtual void init()=0
std::vector< Int64 > itsUsed
std::vector< std::shared_ptr< Matrix< Double > > > itsArrays
virtual void calc(Matrix< Double > &, Double time)=0
std::vector< Double > itsTimes
Matrix< Double > itsDefArray
std::shared_ptr< Matrix< Double > > getArray(Double time, Double epsilon)
this file contains all the compiler specific defines
Definition mainpage.dox:28
long Long
Definition aipstype.h:50
TableExprNode time(const TableExprNode &node)
Definition ExprNode.h:1584
short Short
Definition aipstype.h:46
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition aipsxtype.h:36
int Int
Definition aipstype.h:48
double Double
Definition aipstype.h:53