celes 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +32 -0
- data/README.md +179 -0
- data/Rakefile +1 -0
- data/celes.gemspec +22 -0
- data/ext/celes/a2af.c +120 -0
- data/ext/celes/a2tf.c +116 -0
- data/ext/celes/af2a.c +107 -0
- data/ext/celes/anp.c +82 -0
- data/ext/celes/anpm.c +82 -0
- data/ext/celes/bi00.c +116 -0
- data/ext/celes/bp00.c +173 -0
- data/ext/celes/bp06.c +136 -0
- data/ext/celes/bpn2xy.c +100 -0
- data/ext/celes/c2i00a.c +139 -0
- data/ext/celes/c2i00b.c +139 -0
- data/ext/celes/c2i06a.c +136 -0
- data/ext/celes/c2ibpn.c +142 -0
- data/ext/celes/c2ixy.c +131 -0
- data/ext/celes/c2ixys.c +123 -0
- data/ext/celes/c2s.c +96 -0
- data/ext/celes/c2t00a.c +154 -0
- data/ext/celes/c2t00b.c +150 -0
- data/ext/celes/c2t06a.c +152 -0
- data/ext/celes/c2tcio.c +122 -0
- data/ext/celes/c2teqx.c +122 -0
- data/ext/celes/c2tpe.c +167 -0
- data/ext/celes/c2txy.c +159 -0
- data/ext/celes/cal2jd.c +139 -0
- data/ext/celes/celes_core.c +2522 -0
- data/ext/celes/cp.c +80 -0
- data/ext/celes/cpv.c +82 -0
- data/ext/celes/cr.c +83 -0
- data/ext/celes/d2dtf.c +206 -0
- data/ext/celes/d2tf.c +160 -0
- data/ext/celes/dat.c +289 -0
- data/ext/celes/depend +25 -0
- data/ext/celes/dtdb.c +1213 -0
- data/ext/celes/dtf2d.c +196 -0
- data/ext/celes/ee00.c +128 -0
- data/ext/celes/ee00a.c +135 -0
- data/ext/celes/ee00b.c +141 -0
- data/ext/celes/ee06a.c +122 -0
- data/ext/celes/eect00.c +282 -0
- data/ext/celes/eform.c +147 -0
- data/ext/celes/eo06a.c +131 -0
- data/ext/celes/eors.c +108 -0
- data/ext/celes/epb.c +96 -0
- data/ext/celes/epb2jd.c +91 -0
- data/ext/celes/epj.c +93 -0
- data/ext/celes/epj2jd.c +91 -0
- data/ext/celes/epv00.c +2589 -0
- data/ext/celes/eqeq94.c +131 -0
- data/ext/celes/era00.c +136 -0
- data/ext/celes/extconf.rb +4 -0
- data/ext/celes/fad03.c +103 -0
- data/ext/celes/fae03.c +102 -0
- data/ext/celes/faf03.c +106 -0
- data/ext/celes/faju03.c +102 -0
- data/ext/celes/fal03.c +103 -0
- data/ext/celes/falp03.c +103 -0
- data/ext/celes/fama03.c +102 -0
- data/ext/celes/fame03.c +102 -0
- data/ext/celes/fane03.c +99 -0
- data/ext/celes/faom03.c +104 -0
- data/ext/celes/fapa03.c +103 -0
- data/ext/celes/fasa03.c +102 -0
- data/ext/celes/faur03.c +99 -0
- data/ext/celes/fave03.c +102 -0
- data/ext/celes/fk52h.c +143 -0
- data/ext/celes/fk5hip.c +126 -0
- data/ext/celes/fk5hz.c +160 -0
- data/ext/celes/fw2m.c +134 -0
- data/ext/celes/fw2xy.c +120 -0
- data/ext/celes/gc2gd.c +134 -0
- data/ext/celes/gc2gde.c +200 -0
- data/ext/celes/gd2gc.c +134 -0
- data/ext/celes/gd2gce.c +138 -0
- data/ext/celes/gmst00.c +145 -0
- data/ext/celes/gmst06.c +136 -0
- data/ext/celes/gmst82.c +151 -0
- data/ext/celes/gst00a.c +138 -0
- data/ext/celes/gst00b.c +146 -0
- data/ext/celes/gst06.c +140 -0
- data/ext/celes/gst06a.c +131 -0
- data/ext/celes/gst94.c +131 -0
- data/ext/celes/h2fk5.c +148 -0
- data/ext/celes/hfk5z.c +175 -0
- data/ext/celes/ir.c +83 -0
- data/ext/celes/jd2cal.c +155 -0
- data/ext/celes/jdcalf.c +161 -0
- data/ext/celes/num00a.c +121 -0
- data/ext/celes/num00b.c +121 -0
- data/ext/celes/num06a.c +125 -0
- data/ext/celes/numat.c +109 -0
- data/ext/celes/nut00a.c +2047 -0
- data/ext/celes/nut00b.c +372 -0
- data/ext/celes/nut06a.c +153 -0
- data/ext/celes/nut80.c +325 -0
- data/ext/celes/nutm80.c +117 -0
- data/ext/celes/obl06.c +118 -0
- data/ext/celes/obl80.c +118 -0
- data/ext/celes/p06e.c +321 -0
- data/ext/celes/p2pv.c +83 -0
- data/ext/celes/p2s.c +91 -0
- data/ext/celes/pap.c +139 -0
- data/ext/celes/pas.c +96 -0
- data/ext/celes/pb06.c +144 -0
- data/ext/celes/pdp.c +84 -0
- data/ext/celes/pfw06.c +165 -0
- data/ext/celes/plan94.c +514 -0
- data/ext/celes/pm.c +83 -0
- data/ext/celes/pmat00.c +118 -0
- data/ext/celes/pmat06.c +122 -0
- data/ext/celes/pmat76.c +141 -0
- data/ext/celes/pmp.c +85 -0
- data/ext/celes/pn.c +109 -0
- data/ext/celes/pn00.c +177 -0
- data/ext/celes/pn00a.c +162 -0
- data/ext/celes/pn00b.c +162 -0
- data/ext/celes/pn06.c +187 -0
- data/ext/celes/pn06a.c +152 -0
- data/ext/celes/pnm00a.c +121 -0
- data/ext/celes/pnm00b.c +121 -0
- data/ext/celes/pnm06a.c +124 -0
- data/ext/celes/pnm80.c +126 -0
- data/ext/celes/pom00.c +115 -0
- data/ext/celes/ppp.c +85 -0
- data/ext/celes/ppsp.c +94 -0
- data/ext/celes/pr00.c +142 -0
- data/ext/celes/prec76.c +148 -0
- data/ext/celes/pv2p.c +81 -0
- data/ext/celes/pv2s.c +144 -0
- data/ext/celes/pvdpv.c +102 -0
- data/ext/celes/pvm.c +86 -0
- data/ext/celes/pvmpv.c +87 -0
- data/ext/celes/pvppv.c +87 -0
- data/ext/celes/pvstar.c +207 -0
- data/ext/celes/pvu.c +93 -0
- data/ext/celes/pvup.c +88 -0
- data/ext/celes/pvxpv.c +107 -0
- data/ext/celes/pxp.c +94 -0
- data/ext/celes/rm2v.c +111 -0
- data/ext/celes/rv2m.c +118 -0
- data/ext/celes/rx.c +110 -0
- data/ext/celes/rxp.c +99 -0
- data/ext/celes/rxpv.c +86 -0
- data/ext/celes/rxr.c +99 -0
- data/ext/celes/ry.c +110 -0
- data/ext/celes/rz.c +110 -0
- data/ext/celes/s00.c +371 -0
- data/ext/celes/s00a.c +143 -0
- data/ext/celes/s00b.c +143 -0
- data/ext/celes/s06.c +368 -0
- data/ext/celes/s06a.c +145 -0
- data/ext/celes/s2c.c +85 -0
- data/ext/celes/s2p.c +88 -0
- data/ext/celes/s2pv.c +103 -0
- data/ext/celes/s2xpv.c +87 -0
- data/ext/celes/sepp.c +105 -0
- data/ext/celes/seps.c +93 -0
- data/ext/celes/sofa.h +379 -0
- data/ext/celes/sofam.h +155 -0
- data/ext/celes/sp00.c +118 -0
- data/ext/celes/starpm.c +205 -0
- data/ext/celes/starpv.c +264 -0
- data/ext/celes/sxp.c +84 -0
- data/ext/celes/sxpv.c +85 -0
- data/ext/celes/taitt.c +110 -0
- data/ext/celes/taiut1.c +112 -0
- data/ext/celes/taiutc.c +182 -0
- data/ext/celes/tcbtdb.c +132 -0
- data/ext/celes/tcgtt.c +109 -0
- data/ext/celes/tdbtcb.c +137 -0
- data/ext/celes/tdbtt.c +122 -0
- data/ext/celes/tf2a.c +107 -0
- data/ext/celes/tf2d.c +107 -0
- data/ext/celes/tr.c +93 -0
- data/ext/celes/trxp.c +93 -0
- data/ext/celes/trxpv.c +93 -0
- data/ext/celes/tttai.c +110 -0
- data/ext/celes/tttcg.c +112 -0
- data/ext/celes/tttdb.c +121 -0
- data/ext/celes/ttut1.c +110 -0
- data/ext/celes/ut1tai.c +111 -0
- data/ext/celes/ut1tt.c +110 -0
- data/ext/celes/ut1utc.c +193 -0
- data/ext/celes/utctai.c +163 -0
- data/ext/celes/utcut1.c +151 -0
- data/ext/celes/xy06.c +2758 -0
- data/ext/celes/xys00a.c +133 -0
- data/ext/celes/xys00b.c +133 -0
- data/ext/celes/xys06a.c +133 -0
- data/ext/celes/zp.c +77 -0
- data/ext/celes/zpv.c +79 -0
- data/ext/celes/zr.c +83 -0
- data/lib/celes.rb +6 -0
- data/lib/celes/version.rb +3 -0
- data/sofa_20120301.diff +31384 -0
- data/test/t_sofa.rb +8228 -0
- metadata +251 -0
data/ext/celes/tr.c
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#include "sofam.h"
|
|
2
|
+
|
|
3
|
+
void iauTr(double r[3][3], double rt[3][3])
|
|
4
|
+
/*
|
|
5
|
+
** - - - - - -
|
|
6
|
+
** i a u T r
|
|
7
|
+
** - - - - - -
|
|
8
|
+
**
|
|
9
|
+
** Transpose an r-matrix.
|
|
10
|
+
**
|
|
11
|
+
** Status: vector/matrix support function.
|
|
12
|
+
**
|
|
13
|
+
** Given:
|
|
14
|
+
** r double[3][3] r-matrix
|
|
15
|
+
**
|
|
16
|
+
** Returned:
|
|
17
|
+
** rt double[3][3] transpose
|
|
18
|
+
**
|
|
19
|
+
** Note:
|
|
20
|
+
** It is permissible for r and rt to be the same array.
|
|
21
|
+
**
|
|
22
|
+
** Called:
|
|
23
|
+
** iauCr copy r-matrix
|
|
24
|
+
**
|
|
25
|
+
** This revision: 2008 May 22
|
|
26
|
+
**
|
|
27
|
+
** Original version 2012-03-01
|
|
28
|
+
**
|
|
29
|
+
** Copyright (C) 2013 Naoki Arita. See notes at end.
|
|
30
|
+
*/
|
|
31
|
+
{
|
|
32
|
+
double wm[3][3];
|
|
33
|
+
int i, j;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
for (i = 0; i < 3; i++) {
|
|
37
|
+
for (j = 0; j < 3; j++) {
|
|
38
|
+
wm[i][j] = r[j][i];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
iauCr(wm, rt);
|
|
42
|
+
|
|
43
|
+
return;
|
|
44
|
+
|
|
45
|
+
/*----------------------------------------------------------------------
|
|
46
|
+
**
|
|
47
|
+
** Celes is a wrapper of the SOFA Library for Ruby.
|
|
48
|
+
**
|
|
49
|
+
** This file is redistributed and relicensed in accordance with
|
|
50
|
+
** the SOFA Software License (http://www.iausofa.org/tandc.html).
|
|
51
|
+
**
|
|
52
|
+
** The original library is available from IAU Standards of
|
|
53
|
+
** Fundamental Astronomy (http://www.iausofa.org/).
|
|
54
|
+
**
|
|
55
|
+
**
|
|
56
|
+
**
|
|
57
|
+
**
|
|
58
|
+
**
|
|
59
|
+
** Copyright (C) 2013, Naoki Arita
|
|
60
|
+
** All rights reserved.
|
|
61
|
+
**
|
|
62
|
+
** Redistribution and use in source and binary forms, with or without
|
|
63
|
+
** modification, are permitted provided that the following conditions
|
|
64
|
+
** are met:
|
|
65
|
+
**
|
|
66
|
+
** 1 Redistributions of source code must retain the above copyright
|
|
67
|
+
** notice, this list of conditions and the following disclaimer.
|
|
68
|
+
**
|
|
69
|
+
** 2 Redistributions in binary form must reproduce the above copyright
|
|
70
|
+
** notice, this list of conditions and the following disclaimer in
|
|
71
|
+
** the documentation and/or other materials provided with the
|
|
72
|
+
** distribution.
|
|
73
|
+
**
|
|
74
|
+
** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
|
|
75
|
+
** the International Astronomical Union nor the names of its
|
|
76
|
+
** contributors may be used to endorse or promote products derived
|
|
77
|
+
** from this software without specific prior written permission.
|
|
78
|
+
**
|
|
79
|
+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
80
|
+
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
81
|
+
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
82
|
+
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
83
|
+
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
84
|
+
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
85
|
+
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
86
|
+
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
87
|
+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
88
|
+
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
89
|
+
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
90
|
+
** POSSIBILITY OF SUCH DAMAGE.
|
|
91
|
+
**
|
|
92
|
+
**--------------------------------------------------------------------*/
|
|
93
|
+
}
|
data/ext/celes/trxp.c
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#include "sofam.h"
|
|
2
|
+
|
|
3
|
+
void iauTrxp(double r[3][3], double p[3], double trp[3])
|
|
4
|
+
/*
|
|
5
|
+
** - - - - - - - -
|
|
6
|
+
** i a u T r x p
|
|
7
|
+
** - - - - - - - -
|
|
8
|
+
**
|
|
9
|
+
** Multiply a p-vector by the transpose of an r-matrix.
|
|
10
|
+
**
|
|
11
|
+
** Status: vector/matrix support function.
|
|
12
|
+
**
|
|
13
|
+
** Given:
|
|
14
|
+
** r double[3][3] r-matrix
|
|
15
|
+
** p double[3] p-vector
|
|
16
|
+
**
|
|
17
|
+
** Returned:
|
|
18
|
+
** trp double[3] r * p
|
|
19
|
+
**
|
|
20
|
+
** Note:
|
|
21
|
+
** It is permissible for p and trp to be the same array.
|
|
22
|
+
**
|
|
23
|
+
** Called:
|
|
24
|
+
** iauTr transpose r-matrix
|
|
25
|
+
** iauRxp product of r-matrix and p-vector
|
|
26
|
+
**
|
|
27
|
+
** This revision: 2008 October 28
|
|
28
|
+
**
|
|
29
|
+
** Original version 2012-03-01
|
|
30
|
+
**
|
|
31
|
+
** Copyright (C) 2013 Naoki Arita. See notes at end.
|
|
32
|
+
*/
|
|
33
|
+
{
|
|
34
|
+
double tr[3][3];
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/* Transpose of matrix r. */
|
|
38
|
+
iauTr(r, tr);
|
|
39
|
+
|
|
40
|
+
/* Matrix tr * vector p -> vector trp. */
|
|
41
|
+
iauRxp(tr, p, trp);
|
|
42
|
+
|
|
43
|
+
return;
|
|
44
|
+
|
|
45
|
+
/*----------------------------------------------------------------------
|
|
46
|
+
**
|
|
47
|
+
** Celes is a wrapper of the SOFA Library for Ruby.
|
|
48
|
+
**
|
|
49
|
+
** This file is redistributed and relicensed in accordance with
|
|
50
|
+
** the SOFA Software License (http://www.iausofa.org/tandc.html).
|
|
51
|
+
**
|
|
52
|
+
** The original library is available from IAU Standards of
|
|
53
|
+
** Fundamental Astronomy (http://www.iausofa.org/).
|
|
54
|
+
**
|
|
55
|
+
**
|
|
56
|
+
**
|
|
57
|
+
**
|
|
58
|
+
**
|
|
59
|
+
** Copyright (C) 2013, Naoki Arita
|
|
60
|
+
** All rights reserved.
|
|
61
|
+
**
|
|
62
|
+
** Redistribution and use in source and binary forms, with or without
|
|
63
|
+
** modification, are permitted provided that the following conditions
|
|
64
|
+
** are met:
|
|
65
|
+
**
|
|
66
|
+
** 1 Redistributions of source code must retain the above copyright
|
|
67
|
+
** notice, this list of conditions and the following disclaimer.
|
|
68
|
+
**
|
|
69
|
+
** 2 Redistributions in binary form must reproduce the above copyright
|
|
70
|
+
** notice, this list of conditions and the following disclaimer in
|
|
71
|
+
** the documentation and/or other materials provided with the
|
|
72
|
+
** distribution.
|
|
73
|
+
**
|
|
74
|
+
** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
|
|
75
|
+
** the International Astronomical Union nor the names of its
|
|
76
|
+
** contributors may be used to endorse or promote products derived
|
|
77
|
+
** from this software without specific prior written permission.
|
|
78
|
+
**
|
|
79
|
+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
80
|
+
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
81
|
+
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
82
|
+
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
83
|
+
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
84
|
+
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
85
|
+
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
86
|
+
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
87
|
+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
88
|
+
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
89
|
+
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
90
|
+
** POSSIBILITY OF SUCH DAMAGE.
|
|
91
|
+
**
|
|
92
|
+
**--------------------------------------------------------------------*/
|
|
93
|
+
}
|
data/ext/celes/trxpv.c
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#include "sofam.h"
|
|
2
|
+
|
|
3
|
+
void iauTrxpv(double r[3][3], double pv[2][3], double trpv[2][3])
|
|
4
|
+
/*
|
|
5
|
+
** - - - - - - - - -
|
|
6
|
+
** i a u T r x p v
|
|
7
|
+
** - - - - - - - - -
|
|
8
|
+
**
|
|
9
|
+
** Multiply a pv-vector by the transpose of an r-matrix.
|
|
10
|
+
**
|
|
11
|
+
** Status: vector/matrix support function.
|
|
12
|
+
**
|
|
13
|
+
** Given:
|
|
14
|
+
** r double[3][3] r-matrix
|
|
15
|
+
** pv double[2][3] pv-vector
|
|
16
|
+
**
|
|
17
|
+
** Returned:
|
|
18
|
+
** trpv double[2][3] r * pv
|
|
19
|
+
**
|
|
20
|
+
** Note:
|
|
21
|
+
** It is permissible for pv and trpv to be the same array.
|
|
22
|
+
**
|
|
23
|
+
** Called:
|
|
24
|
+
** iauTr transpose r-matrix
|
|
25
|
+
** iauRxpv product of r-matrix and pv-vector
|
|
26
|
+
**
|
|
27
|
+
** This revision: 2008 October 28
|
|
28
|
+
**
|
|
29
|
+
** Original version 2012-03-01
|
|
30
|
+
**
|
|
31
|
+
** Copyright (C) 2013 Naoki Arita. See notes at end.
|
|
32
|
+
*/
|
|
33
|
+
{
|
|
34
|
+
double tr[3][3];
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/* Transpose of matrix r. */
|
|
38
|
+
iauTr(r, tr);
|
|
39
|
+
|
|
40
|
+
/* Matrix tr * vector pv -> vector trpv. */
|
|
41
|
+
iauRxpv(tr, pv, trpv);
|
|
42
|
+
|
|
43
|
+
return;
|
|
44
|
+
|
|
45
|
+
/*----------------------------------------------------------------------
|
|
46
|
+
**
|
|
47
|
+
** Celes is a wrapper of the SOFA Library for Ruby.
|
|
48
|
+
**
|
|
49
|
+
** This file is redistributed and relicensed in accordance with
|
|
50
|
+
** the SOFA Software License (http://www.iausofa.org/tandc.html).
|
|
51
|
+
**
|
|
52
|
+
** The original library is available from IAU Standards of
|
|
53
|
+
** Fundamental Astronomy (http://www.iausofa.org/).
|
|
54
|
+
**
|
|
55
|
+
**
|
|
56
|
+
**
|
|
57
|
+
**
|
|
58
|
+
**
|
|
59
|
+
** Copyright (C) 2013, Naoki Arita
|
|
60
|
+
** All rights reserved.
|
|
61
|
+
**
|
|
62
|
+
** Redistribution and use in source and binary forms, with or without
|
|
63
|
+
** modification, are permitted provided that the following conditions
|
|
64
|
+
** are met:
|
|
65
|
+
**
|
|
66
|
+
** 1 Redistributions of source code must retain the above copyright
|
|
67
|
+
** notice, this list of conditions and the following disclaimer.
|
|
68
|
+
**
|
|
69
|
+
** 2 Redistributions in binary form must reproduce the above copyright
|
|
70
|
+
** notice, this list of conditions and the following disclaimer in
|
|
71
|
+
** the documentation and/or other materials provided with the
|
|
72
|
+
** distribution.
|
|
73
|
+
**
|
|
74
|
+
** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
|
|
75
|
+
** the International Astronomical Union nor the names of its
|
|
76
|
+
** contributors may be used to endorse or promote products derived
|
|
77
|
+
** from this software without specific prior written permission.
|
|
78
|
+
**
|
|
79
|
+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
80
|
+
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
81
|
+
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
82
|
+
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
83
|
+
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
84
|
+
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
85
|
+
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
86
|
+
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
87
|
+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
88
|
+
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
89
|
+
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
90
|
+
** POSSIBILITY OF SUCH DAMAGE.
|
|
91
|
+
**
|
|
92
|
+
**--------------------------------------------------------------------*/
|
|
93
|
+
}
|
data/ext/celes/tttai.c
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#include "sofam.h"
|
|
2
|
+
|
|
3
|
+
int iauTttai(double tt1, double tt2, double *tai1, double *tai2)
|
|
4
|
+
/*
|
|
5
|
+
** - - - - - - - - -
|
|
6
|
+
** i a u T t t a i
|
|
7
|
+
** - - - - - - - - -
|
|
8
|
+
**
|
|
9
|
+
** Time scale transformation: Terrestrial Time, TT, to International
|
|
10
|
+
** Atomic Time, TAI.
|
|
11
|
+
**
|
|
12
|
+
** Status: canonical.
|
|
13
|
+
**
|
|
14
|
+
** Given:
|
|
15
|
+
** tt1,tt2 double TT as a 2-part Julian Date
|
|
16
|
+
**
|
|
17
|
+
** Returned:
|
|
18
|
+
** tai1,tai2 double TAI as a 2-part Julian Date
|
|
19
|
+
**
|
|
20
|
+
** Returned (function value):
|
|
21
|
+
** int status: 0 = OK
|
|
22
|
+
**
|
|
23
|
+
** Note:
|
|
24
|
+
**
|
|
25
|
+
** tt1+tt2 is Julian Date, apportioned in any convenient way between
|
|
26
|
+
** the two arguments, for example where tt1 is the Julian Day Number
|
|
27
|
+
** and tt2 is the fraction of a day. The returned tai1,tai2 follow
|
|
28
|
+
** suit.
|
|
29
|
+
**
|
|
30
|
+
** References:
|
|
31
|
+
**
|
|
32
|
+
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
|
|
33
|
+
** IERS Technical Note No. 32, BKG (2004)
|
|
34
|
+
**
|
|
35
|
+
** Explanatory Supplement to the Astronomical Almanac,
|
|
36
|
+
** P. Kenneth Seidelmann (ed), University Science Books (1992)
|
|
37
|
+
**
|
|
38
|
+
** This revision: 2011 May 14
|
|
39
|
+
**
|
|
40
|
+
** Original version 2012-03-01
|
|
41
|
+
**
|
|
42
|
+
** Copyright (C) 2013 Naoki Arita. See notes at end.
|
|
43
|
+
*/
|
|
44
|
+
{
|
|
45
|
+
|
|
46
|
+
/* TT minus TAI (days). */
|
|
47
|
+
static const double dtat = TTMTAI/DAYSEC;
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/* Result, safeguarding precision. */
|
|
51
|
+
if ( tt1 > tt2 ) {
|
|
52
|
+
*tai1 = tt1;
|
|
53
|
+
*tai2 = tt2 - dtat;
|
|
54
|
+
} else {
|
|
55
|
+
*tai1 = tt1 - dtat;
|
|
56
|
+
*tai2 = tt2;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Status (always OK). */
|
|
60
|
+
return 0;
|
|
61
|
+
|
|
62
|
+
/*----------------------------------------------------------------------
|
|
63
|
+
**
|
|
64
|
+
** Celes is a wrapper of the SOFA Library for Ruby.
|
|
65
|
+
**
|
|
66
|
+
** This file is redistributed and relicensed in accordance with
|
|
67
|
+
** the SOFA Software License (http://www.iausofa.org/tandc.html).
|
|
68
|
+
**
|
|
69
|
+
** The original library is available from IAU Standards of
|
|
70
|
+
** Fundamental Astronomy (http://www.iausofa.org/).
|
|
71
|
+
**
|
|
72
|
+
**
|
|
73
|
+
**
|
|
74
|
+
**
|
|
75
|
+
**
|
|
76
|
+
** Copyright (C) 2013, Naoki Arita
|
|
77
|
+
** All rights reserved.
|
|
78
|
+
**
|
|
79
|
+
** Redistribution and use in source and binary forms, with or without
|
|
80
|
+
** modification, are permitted provided that the following conditions
|
|
81
|
+
** are met:
|
|
82
|
+
**
|
|
83
|
+
** 1 Redistributions of source code must retain the above copyright
|
|
84
|
+
** notice, this list of conditions and the following disclaimer.
|
|
85
|
+
**
|
|
86
|
+
** 2 Redistributions in binary form must reproduce the above copyright
|
|
87
|
+
** notice, this list of conditions and the following disclaimer in
|
|
88
|
+
** the documentation and/or other materials provided with the
|
|
89
|
+
** distribution.
|
|
90
|
+
**
|
|
91
|
+
** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
|
|
92
|
+
** the International Astronomical Union nor the names of its
|
|
93
|
+
** contributors may be used to endorse or promote products derived
|
|
94
|
+
** from this software without specific prior written permission.
|
|
95
|
+
**
|
|
96
|
+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
97
|
+
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
98
|
+
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
99
|
+
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
100
|
+
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
101
|
+
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
102
|
+
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
103
|
+
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
104
|
+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
105
|
+
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
106
|
+
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
107
|
+
** POSSIBILITY OF SUCH DAMAGE.
|
|
108
|
+
**
|
|
109
|
+
**--------------------------------------------------------------------*/
|
|
110
|
+
}
|
data/ext/celes/tttcg.c
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#include "sofam.h"
|
|
2
|
+
|
|
3
|
+
int iauTttcg(double tt1, double tt2, double *tcg1, double *tcg2)
|
|
4
|
+
/*
|
|
5
|
+
** - - - - - - - - -
|
|
6
|
+
** i a u T t t c g
|
|
7
|
+
** - - - - - - - - -
|
|
8
|
+
**
|
|
9
|
+
** Time scale transformation: Terrestrial Time, TT, to Geocentric
|
|
10
|
+
** Coordinate Time, TCG.
|
|
11
|
+
**
|
|
12
|
+
** Status: canonical.
|
|
13
|
+
**
|
|
14
|
+
** Given:
|
|
15
|
+
** tt1,tt2 double TT as a 2-part Julian Date
|
|
16
|
+
**
|
|
17
|
+
** Returned:
|
|
18
|
+
** tcg1,tcg2 double TCG as a 2-part Julian Date
|
|
19
|
+
**
|
|
20
|
+
** Returned (function value):
|
|
21
|
+
** int status: 0 = OK
|
|
22
|
+
**
|
|
23
|
+
** Note:
|
|
24
|
+
**
|
|
25
|
+
** tt1+tt2 is Julian Date, apportioned in any convenient way between
|
|
26
|
+
** the two arguments, for example where tt1 is the Julian Day Number
|
|
27
|
+
** and tt2 is the fraction of a day. The returned tcg1,tcg2 follow
|
|
28
|
+
** suit.
|
|
29
|
+
**
|
|
30
|
+
** References:
|
|
31
|
+
**
|
|
32
|
+
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
|
|
33
|
+
** IERS Technical Note No. 32, BKG (2004)
|
|
34
|
+
**
|
|
35
|
+
** IAU 2000 Resolution B1.9
|
|
36
|
+
**
|
|
37
|
+
** This revision: 2010 May 13
|
|
38
|
+
**
|
|
39
|
+
** Original version 2012-03-01
|
|
40
|
+
**
|
|
41
|
+
** Copyright (C) 2013 Naoki Arita. See notes at end.
|
|
42
|
+
*/
|
|
43
|
+
{
|
|
44
|
+
|
|
45
|
+
/* 1977 Jan 1 00:00:32.184 TT, as MJD */
|
|
46
|
+
static const double t77t = DJM77 + TTMTAI/DAYSEC;
|
|
47
|
+
|
|
48
|
+
/* TT to TCG rate */
|
|
49
|
+
static const double elgg = ELG/(1.0-ELG);
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/* Result, safeguarding precision. */
|
|
53
|
+
if ( tt1 > tt2 ) {
|
|
54
|
+
*tcg1 = tt1;
|
|
55
|
+
*tcg2 = tt2 + ( ( tt1 - DJM0 ) + ( tt2 - t77t ) ) * elgg;
|
|
56
|
+
} else {
|
|
57
|
+
*tcg1 = tt1 + ( ( tt2 - DJM0 ) + ( tt1 - t77t ) ) * elgg;
|
|
58
|
+
*tcg2 = tt2;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Status (always OK). */
|
|
62
|
+
return 0;
|
|
63
|
+
|
|
64
|
+
/*----------------------------------------------------------------------
|
|
65
|
+
**
|
|
66
|
+
** Celes is a wrapper of the SOFA Library for Ruby.
|
|
67
|
+
**
|
|
68
|
+
** This file is redistributed and relicensed in accordance with
|
|
69
|
+
** the SOFA Software License (http://www.iausofa.org/tandc.html).
|
|
70
|
+
**
|
|
71
|
+
** The original library is available from IAU Standards of
|
|
72
|
+
** Fundamental Astronomy (http://www.iausofa.org/).
|
|
73
|
+
**
|
|
74
|
+
**
|
|
75
|
+
**
|
|
76
|
+
**
|
|
77
|
+
**
|
|
78
|
+
** Copyright (C) 2013, Naoki Arita
|
|
79
|
+
** All rights reserved.
|
|
80
|
+
**
|
|
81
|
+
** Redistribution and use in source and binary forms, with or without
|
|
82
|
+
** modification, are permitted provided that the following conditions
|
|
83
|
+
** are met:
|
|
84
|
+
**
|
|
85
|
+
** 1 Redistributions of source code must retain the above copyright
|
|
86
|
+
** notice, this list of conditions and the following disclaimer.
|
|
87
|
+
**
|
|
88
|
+
** 2 Redistributions in binary form must reproduce the above copyright
|
|
89
|
+
** notice, this list of conditions and the following disclaimer in
|
|
90
|
+
** the documentation and/or other materials provided with the
|
|
91
|
+
** distribution.
|
|
92
|
+
**
|
|
93
|
+
** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
|
|
94
|
+
** the International Astronomical Union nor the names of its
|
|
95
|
+
** contributors may be used to endorse or promote products derived
|
|
96
|
+
** from this software without specific prior written permission.
|
|
97
|
+
**
|
|
98
|
+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
99
|
+
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
100
|
+
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
101
|
+
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
102
|
+
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
103
|
+
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
104
|
+
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
105
|
+
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
106
|
+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
107
|
+
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
108
|
+
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
109
|
+
** POSSIBILITY OF SUCH DAMAGE.
|
|
110
|
+
**
|
|
111
|
+
**--------------------------------------------------------------------*/
|
|
112
|
+
}
|