equationoftime 3.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.buildpath +5 -0
- data/.project +17 -0
- data/.rvmrc +1 -0
- data/.settings/org.eclipse.ltk.core.refactoring.prefs +2 -0
- data/Makefile +238 -0
- data/Rakefile +40 -3
- data/analemma_data.yml +2925 -0
- data/equationoftime.gemspec +6 -3
- data/examples/analemma_data_generator.rb +12 -12
- data/examples/celes_parts/.RUBYARCHDIR.time +0 -0
- data/examples/celes_parts/.cproject +56 -0
- data/examples/celes_parts/.project +78 -0
- data/examples/celes_parts/a2af.c +120 -0
- data/examples/celes_parts/a2tf.c +116 -0
- data/examples/celes_parts/af2a.c +107 -0
- data/examples/celes_parts/anp.c +82 -0
- data/examples/celes_parts/anpm.c +82 -0
- data/examples/celes_parts/bi00.c +116 -0
- data/examples/celes_parts/bp00.c +173 -0
- data/examples/celes_parts/bp06.c +136 -0
- data/examples/celes_parts/bpn2xy.c +100 -0
- data/examples/celes_parts/c2i00a.c +139 -0
- data/examples/celes_parts/c2i00b.c +139 -0
- data/examples/celes_parts/c2i06a.c +136 -0
- data/examples/celes_parts/c2ibpn.c +142 -0
- data/examples/celes_parts/c2ixy.c +131 -0
- data/examples/celes_parts/c2ixys.c +123 -0
- data/examples/celes_parts/c2s.c +96 -0
- data/examples/celes_parts/c2t00a.c +154 -0
- data/examples/celes_parts/c2t00b.c +150 -0
- data/examples/celes_parts/c2t06a.c +152 -0
- data/examples/celes_parts/c2tcio.c +122 -0
- data/examples/celes_parts/c2teqx.c +122 -0
- data/examples/celes_parts/c2tpe.c +167 -0
- data/examples/celes_parts/c2txy.c +159 -0
- data/examples/celes_parts/cal2jd.c +139 -0
- data/examples/celes_parts/celes_core.c +2522 -0
- data/examples/celes_parts/cp.c +80 -0
- data/examples/celes_parts/cpv.c +82 -0
- data/examples/celes_parts/cr.c +83 -0
- data/examples/celes_parts/d2dtf.c +206 -0
- data/examples/celes_parts/d2tf.c +160 -0
- data/examples/celes_parts/dat.c +289 -0
- data/examples/celes_parts/depend +25 -0
- data/examples/celes_parts/dtdb.c +1213 -0
- data/examples/celes_parts/dtf2d.c +196 -0
- data/examples/celes_parts/ee00.c +128 -0
- data/examples/celes_parts/ee00a.c +135 -0
- data/examples/celes_parts/ee00b.c +141 -0
- data/examples/celes_parts/ee06a.c +122 -0
- data/examples/celes_parts/eect00.c +282 -0
- data/examples/celes_parts/eform.c +147 -0
- data/examples/celes_parts/eo06a.c +131 -0
- data/examples/celes_parts/eors.c +108 -0
- data/examples/celes_parts/epb.c +96 -0
- data/examples/celes_parts/epb2jd.c +91 -0
- data/examples/celes_parts/epj.c +93 -0
- data/examples/celes_parts/epj2jd.c +91 -0
- data/examples/celes_parts/epv00.c +2589 -0
- data/examples/celes_parts/eqeq94.c +131 -0
- data/examples/celes_parts/era00.c +136 -0
- data/examples/celes_parts/extconf.rb +4 -0
- data/examples/celes_parts/fad03.c +103 -0
- data/examples/celes_parts/fae03.c +102 -0
- data/examples/celes_parts/faf03.c +106 -0
- data/examples/celes_parts/faju03.c +102 -0
- data/examples/celes_parts/fal03.c +103 -0
- data/examples/celes_parts/falp03.c +103 -0
- data/examples/celes_parts/fama03.c +102 -0
- data/examples/celes_parts/fame03.c +102 -0
- data/examples/celes_parts/fane03.c +99 -0
- data/examples/celes_parts/faom03.c +104 -0
- data/examples/celes_parts/fapa03.c +103 -0
- data/examples/celes_parts/fasa03.c +102 -0
- data/examples/celes_parts/faur03.c +99 -0
- data/examples/celes_parts/fave03.c +102 -0
- data/examples/celes_parts/fk52h.c +143 -0
- data/examples/celes_parts/fk5hip.c +126 -0
- data/examples/celes_parts/fk5hz.c +160 -0
- data/examples/celes_parts/fw2m.c +134 -0
- data/examples/celes_parts/fw2xy.c +120 -0
- data/examples/celes_parts/gc2gd.c +134 -0
- data/examples/celes_parts/gc2gde.c +200 -0
- data/examples/celes_parts/gd2gc.c +134 -0
- data/examples/celes_parts/gd2gce.c +138 -0
- data/examples/celes_parts/gmst00.c +145 -0
- data/examples/celes_parts/gmst06.c +136 -0
- data/examples/celes_parts/gmst82.c +151 -0
- data/examples/celes_parts/gst00a.c +138 -0
- data/examples/celes_parts/gst00b.c +146 -0
- data/examples/celes_parts/gst06.c +140 -0
- data/examples/celes_parts/gst06a.c +131 -0
- data/examples/celes_parts/gst94.c +131 -0
- data/examples/celes_parts/h2fk5.c +148 -0
- data/examples/celes_parts/hfk5z.c +175 -0
- data/examples/celes_parts/ir.c +83 -0
- data/examples/celes_parts/jd2cal.c +155 -0
- data/examples/celes_parts/jdcalf.c +161 -0
- data/examples/celes_parts/num00a.c +121 -0
- data/examples/celes_parts/num00b.c +121 -0
- data/examples/celes_parts/num06a.c +125 -0
- data/examples/celes_parts/numat.c +109 -0
- data/examples/celes_parts/nut00a.c +2047 -0
- data/examples/celes_parts/nut00b.c +372 -0
- data/examples/celes_parts/nut06a.c +153 -0
- data/examples/celes_parts/nut80.c +325 -0
- data/examples/celes_parts/nutm80.c +117 -0
- data/examples/celes_parts/obl06.c +118 -0
- data/examples/celes_parts/obl80.c +118 -0
- data/examples/celes_parts/p06e.c +321 -0
- data/examples/celes_parts/p2pv.c +83 -0
- data/examples/celes_parts/p2s.c +91 -0
- data/examples/celes_parts/pap.c +139 -0
- data/examples/celes_parts/pas.c +96 -0
- data/examples/celes_parts/pb06.c +144 -0
- data/examples/celes_parts/pdp.c +84 -0
- data/examples/celes_parts/pfw06.c +165 -0
- data/examples/celes_parts/plan94.c +514 -0
- data/examples/celes_parts/pm.c +83 -0
- data/examples/celes_parts/pmat00.c +118 -0
- data/examples/celes_parts/pmat06.c +122 -0
- data/examples/celes_parts/pmat76.c +141 -0
- data/examples/celes_parts/pmp.c +85 -0
- data/examples/celes_parts/pn.c +109 -0
- data/examples/celes_parts/pn00.c +177 -0
- data/examples/celes_parts/pn00a.c +162 -0
- data/examples/celes_parts/pn00b.c +162 -0
- data/examples/celes_parts/pn06.c +187 -0
- data/examples/celes_parts/pn06a.c +152 -0
- data/examples/celes_parts/pnm00a.c +121 -0
- data/examples/celes_parts/pnm00b.c +121 -0
- data/examples/celes_parts/pnm06a.c +124 -0
- data/examples/celes_parts/pnm80.c +126 -0
- data/examples/celes_parts/pom00.c +115 -0
- data/examples/celes_parts/ppp.c +85 -0
- data/examples/celes_parts/ppsp.c +94 -0
- data/examples/celes_parts/pr00.c +142 -0
- data/examples/celes_parts/prec76.c +148 -0
- data/examples/celes_parts/pv2p.c +81 -0
- data/examples/celes_parts/pv2s.c +144 -0
- data/examples/celes_parts/pvdpv.c +102 -0
- data/examples/celes_parts/pvm.c +86 -0
- data/examples/celes_parts/pvmpv.c +87 -0
- data/examples/celes_parts/pvppv.c +87 -0
- data/examples/celes_parts/pvstar.c +207 -0
- data/examples/celes_parts/pvu.c +93 -0
- data/examples/celes_parts/pvup.c +88 -0
- data/examples/celes_parts/pvxpv.c +107 -0
- data/examples/celes_parts/pxp.c +94 -0
- data/examples/celes_parts/rm2v.c +111 -0
- data/examples/celes_parts/rv2m.c +118 -0
- data/examples/celes_parts/rx.c +110 -0
- data/examples/celes_parts/rxp.c +99 -0
- data/examples/celes_parts/rxpv.c +86 -0
- data/examples/celes_parts/rxr.c +99 -0
- data/examples/celes_parts/ry.c +110 -0
- data/examples/celes_parts/rz.c +110 -0
- data/examples/celes_parts/s00.c +371 -0
- data/examples/celes_parts/s00a.c +143 -0
- data/examples/celes_parts/s00b.c +143 -0
- data/examples/celes_parts/s06.c +368 -0
- data/examples/celes_parts/s06a.c +145 -0
- data/examples/celes_parts/s2c.c +85 -0
- data/examples/celes_parts/s2p.c +88 -0
- data/examples/celes_parts/s2pv.c +103 -0
- data/examples/celes_parts/s2xpv.c +87 -0
- data/examples/celes_parts/sepp.c +105 -0
- data/examples/celes_parts/seps.c +93 -0
- data/examples/celes_parts/sofa.h +379 -0
- data/examples/celes_parts/sofam.h +155 -0
- data/examples/celes_parts/sp00.c +118 -0
- data/examples/celes_parts/starpm.c +205 -0
- data/examples/celes_parts/starpv.c +264 -0
- data/examples/celes_parts/sxp.c +84 -0
- data/examples/celes_parts/sxpv.c +85 -0
- data/examples/celes_parts/taitt.c +110 -0
- data/examples/celes_parts/taiut1.c +112 -0
- data/examples/celes_parts/taiutc.c +182 -0
- data/examples/celes_parts/tcbtdb.c +132 -0
- data/examples/celes_parts/tcgtt.c +109 -0
- data/examples/celes_parts/tdbtcb.c +137 -0
- data/examples/celes_parts/tdbtt.c +122 -0
- data/examples/celes_parts/test_celes.rb +48 -0
- data/examples/celes_parts/tf2a.c +107 -0
- data/examples/celes_parts/tf2d.c +107 -0
- data/examples/celes_parts/tr.c +93 -0
- data/examples/celes_parts/trxp.c +93 -0
- data/examples/celes_parts/trxpv.c +93 -0
- data/examples/celes_parts/tttai.c +110 -0
- data/examples/celes_parts/tttcg.c +112 -0
- data/examples/celes_parts/tttdb.c +121 -0
- data/examples/celes_parts/ttut1.c +110 -0
- data/examples/celes_parts/ut1tai.c +111 -0
- data/examples/celes_parts/ut1tt.c +110 -0
- data/examples/celes_parts/ut1utc.c +193 -0
- data/examples/celes_parts/utctai.c +163 -0
- data/examples/celes_parts/utcut1.c +151 -0
- data/examples/celes_parts/xy06.c +2758 -0
- data/examples/celes_parts/xys00a.c +133 -0
- data/examples/celes_parts/xys00b.c +133 -0
- data/examples/celes_parts/xys06a.c +133 -0
- data/examples/celes_parts/zp.c +77 -0
- data/examples/celes_parts/zpv.c +79 -0
- data/examples/celes_parts/zr.c +83 -0
- data/examples/check_date_type.rb +2 -4
- data/examples/compare_geoc_long_ra.rb +19 -11
- data/examples/data_table_for_astro_dog.rb +40 -0
- data/examples/earth_rotation.rb +28 -3
- data/examples/eot.c +15 -0
- data/examples/eot.h +2 -0
- data/examples/eot_methods_list.rb +30 -3
- data/examples/eot_suntimes.rb +99 -95
- data/examples/extconf.rb +2 -0
- data/examples/{read_nutation_data.rb → gmst_gast_non_sofa.rb} +103 -98
- data/examples/nutation_table5_3a.yaml +1658 -1658
- data/examples/rbeot.c +24 -0
- data/examples/test_eot.rb +17 -0
- data/examples/test_poly_eval.rb +6 -17
- data/examples/time_scales.rb +4 -7
- data/examples/times_year.rb +50 -0
- data/examples/usage_example.rb +15 -5
- data/examples/use_angles.rb +151 -87
- data/lib/eot/angles.rb +130 -177
- data/lib/eot/constants.rb +41 -44
- data/lib/eot/displays.rb +40 -37
- data/lib/eot/geo_lat_lng_smt.rb +7 -6
- data/lib/eot/init.rb +62 -39
- data/lib/eot/nutation.rb +53 -45
- data/lib/eot/times.rb +32 -41
- data/lib/eot/utilities.rb +11 -90
- data/lib/eot/version.rb +3 -2
- data/rise_set_data.yml +1461 -0
- data/run_tests_eclipse.rb +1 -0
- data/tests/minitest/aliased_angles_spec.rb +119 -165
- data/tests/minitest/aliased_displays_spec.rb +41 -39
- data/tests/minitest/aliased_utilities_spec.rb +11 -22
- data/tests/minitest/angles_spec.rb +134 -181
- data/tests/minitest/constants_spec.rb +4 -10
- data/tests/minitest/delta_epsilon_spec.rb +13 -16
- data/tests/minitest/displays_spec.rb +39 -37
- data/tests/minitest/geo_spec.rb +15 -11
- data/tests/minitest/init_spec.rb +30 -16
- data/tests/minitest/nutation_spec.rb +19 -13
- data/tests/minitest/times_spec.rb +77 -75
- data/tests/minitest/utilities_spec.rb +10 -94
- data/wiki.md +7 -9
- metadata +218 -26
- data/examples/data_table.rb +0 -26
- data/lib/eot/nutation_table5_3a.yaml +0 -9532
- data/tests/minitest/aliased_times_spec.rb +0 -36
@@ -0,0 +1,139 @@
|
|
1
|
+
#include "sofam.h"
|
2
|
+
|
3
|
+
int iauCal2jd(int iy, int im, int id, double *djm0, double *djm)
|
4
|
+
/*
|
5
|
+
** - - - - - - - - - -
|
6
|
+
** i a u C a l 2 j d
|
7
|
+
** - - - - - - - - - -
|
8
|
+
**
|
9
|
+
** Gregorian Calendar to Julian Date.
|
10
|
+
**
|
11
|
+
** Status: support function.
|
12
|
+
**
|
13
|
+
** Given:
|
14
|
+
** iy,im,id int year, month, day in Gregorian calendar (Note 1)
|
15
|
+
**
|
16
|
+
** Returned:
|
17
|
+
** djm0 double MJD zero-point: always 2400000.5
|
18
|
+
** djm double Modified Julian Date for 0 hrs
|
19
|
+
**
|
20
|
+
** Returned (function value):
|
21
|
+
** int status:
|
22
|
+
** 0 = OK
|
23
|
+
** -1 = bad year (Note 3: JD not computed)
|
24
|
+
** -2 = bad month (JD not computed)
|
25
|
+
** -3 = bad day (JD computed)
|
26
|
+
**
|
27
|
+
** Notes:
|
28
|
+
**
|
29
|
+
** 1) The algorithm used is valid from -4800 March 1, but this
|
30
|
+
** implementation rejects dates before -4799 January 1.
|
31
|
+
**
|
32
|
+
** 2) The Julian Date is returned in two pieces, in the usual SOFA
|
33
|
+
** manner, which is designed to preserve time resolution. The
|
34
|
+
** Julian Date is available as a single number by adding djm0 and
|
35
|
+
** djm.
|
36
|
+
**
|
37
|
+
** 3) In early eras the conversion is from the "Proleptic Gregorian
|
38
|
+
** Calendar"; no account is taken of the date(s) of adoption of
|
39
|
+
** the Gregorian Calendar, nor is the AD/BC numbering convention
|
40
|
+
** observed.
|
41
|
+
**
|
42
|
+
** Reference:
|
43
|
+
**
|
44
|
+
** Explanatory Supplement to the Astronomical Almanac,
|
45
|
+
** P. Kenneth Seidelmann (ed), University Science Books (1992),
|
46
|
+
** Section 12.92 (p604).
|
47
|
+
**
|
48
|
+
** This revision: 2009 October 19
|
49
|
+
**
|
50
|
+
** Original version 2012-03-01
|
51
|
+
**
|
52
|
+
** Copyright (C) 2013 Naoki Arita. See notes at end.
|
53
|
+
*/
|
54
|
+
{
|
55
|
+
int j, ly, my;
|
56
|
+
long iypmy;
|
57
|
+
|
58
|
+
/* Earliest year allowed (4800BC) */
|
59
|
+
const int IYMIN = -4799;
|
60
|
+
|
61
|
+
/* Month lengths in days */
|
62
|
+
static const int mtab[]
|
63
|
+
= {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
64
|
+
|
65
|
+
|
66
|
+
/* Preset status. */
|
67
|
+
j = 0;
|
68
|
+
|
69
|
+
/* Validate year and month. */
|
70
|
+
if (iy < IYMIN) return -1;
|
71
|
+
if (im < 1 || im > 12) return -2;
|
72
|
+
|
73
|
+
/* If February in a leap year, 1, otherwise 0. */
|
74
|
+
ly = ((im == 2) && !(iy%4) && (iy%100 || !(iy%400)));
|
75
|
+
|
76
|
+
/* Validate day, taking into account leap years. */
|
77
|
+
if ( (id < 1) || (id > (mtab[im-1] + ly))) j = -3;
|
78
|
+
|
79
|
+
/* Return result. */
|
80
|
+
my = (im - 14) / 12;
|
81
|
+
iypmy = (long) (iy + my);
|
82
|
+
*djm0 = 2400000.5;
|
83
|
+
*djm = (double)((1461L * (iypmy + 4800L)) / 4L
|
84
|
+
+ (367L * (long) (im - 2 - 12 * my)) / 12L
|
85
|
+
- (3L * ((iypmy + 4900L) / 100L)) / 4L
|
86
|
+
+ (long) id - 2432076L);
|
87
|
+
|
88
|
+
/* Return status. */
|
89
|
+
return j;
|
90
|
+
|
91
|
+
/*----------------------------------------------------------------------
|
92
|
+
**
|
93
|
+
** Celes is a wrapper of the SOFA Library for Ruby.
|
94
|
+
**
|
95
|
+
** This file is redistributed and relicensed in accordance with
|
96
|
+
** the SOFA Software License (http://www.iausofa.org/tandc.html).
|
97
|
+
**
|
98
|
+
** The original library is available from IAU Standards of
|
99
|
+
** Fundamental Astronomy (http://www.iausofa.org/).
|
100
|
+
**
|
101
|
+
**
|
102
|
+
**
|
103
|
+
**
|
104
|
+
**
|
105
|
+
** Copyright (C) 2013, Naoki Arita
|
106
|
+
** All rights reserved.
|
107
|
+
**
|
108
|
+
** Redistribution and use in source and binary forms, with or without
|
109
|
+
** modification, are permitted provided that the following conditions
|
110
|
+
** are met:
|
111
|
+
**
|
112
|
+
** 1 Redistributions of source code must retain the above copyright
|
113
|
+
** notice, this list of conditions and the following disclaimer.
|
114
|
+
**
|
115
|
+
** 2 Redistributions in binary form must reproduce the above copyright
|
116
|
+
** notice, this list of conditions and the following disclaimer in
|
117
|
+
** the documentation and/or other materials provided with the
|
118
|
+
** distribution.
|
119
|
+
**
|
120
|
+
** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
|
121
|
+
** the International Astronomical Union nor the names of its
|
122
|
+
** contributors may be used to endorse or promote products derived
|
123
|
+
** from this software without specific prior written permission.
|
124
|
+
**
|
125
|
+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
126
|
+
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
127
|
+
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
128
|
+
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
129
|
+
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
130
|
+
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
131
|
+
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
132
|
+
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
133
|
+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
134
|
+
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
135
|
+
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
136
|
+
** POSSIBILITY OF SUCH DAMAGE.
|
137
|
+
**
|
138
|
+
**--------------------------------------------------------------------*/
|
139
|
+
}
|
@@ -0,0 +1,2522 @@
|
|
1
|
+
#include "sofa.h"
|
2
|
+
#include "sofam.h"
|
3
|
+
#include "ruby.h"
|
4
|
+
|
5
|
+
#ifndef DBL2NUM
|
6
|
+
# define DBL2NUM(dbl) rb_float_new(dbl)
|
7
|
+
#endif
|
8
|
+
|
9
|
+
VALUE mCeles;
|
10
|
+
ID id_status;
|
11
|
+
|
12
|
+
static VALUE
|
13
|
+
celes_s_status(VALUE self){
|
14
|
+
return rb_ivar_get(self, id_status);
|
15
|
+
}
|
16
|
+
|
17
|
+
static void
|
18
|
+
cvec_cp(VALUE vvector, double vector[3]){
|
19
|
+
int i;
|
20
|
+
|
21
|
+
Check_Type(vvector, T_ARRAY);
|
22
|
+
if(RARRAY_LEN(vvector) != 3)
|
23
|
+
rb_raise(rb_eArgError, "vector size is not 3");
|
24
|
+
|
25
|
+
for(i = 0; i < 3; i++)
|
26
|
+
vector[i] = NUM2DBL(RARRAY_PTR(vvector)[i]);
|
27
|
+
}
|
28
|
+
|
29
|
+
static void
|
30
|
+
cmat_cp23(VALUE vmatrix, double matrix[2][3]){
|
31
|
+
int i, j;
|
32
|
+
|
33
|
+
Check_Type(vmatrix, T_ARRAY);
|
34
|
+
if(RARRAY_LEN(vmatrix) != 2)
|
35
|
+
rb_raise(rb_eArgError, "matrix size is not 2x3");
|
36
|
+
|
37
|
+
for(i = 0; i < 2; i++){
|
38
|
+
Check_Type(RARRAY_PTR(vmatrix)[i], T_ARRAY);
|
39
|
+
if(RARRAY_LEN(RARRAY_PTR(vmatrix)[i]) != 3)
|
40
|
+
rb_raise(rb_eArgError, "matrix size is not 2x3");
|
41
|
+
|
42
|
+
for(j = 0; j < 3; j++)
|
43
|
+
matrix[i][j] = NUM2DBL(RARRAY_PTR(RARRAY_PTR(vmatrix)[i])[j]);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
static void
|
48
|
+
cmat_cp33(VALUE vmatrix, double matrix[3][3]){
|
49
|
+
int i, j;
|
50
|
+
|
51
|
+
Check_Type(vmatrix, T_ARRAY);
|
52
|
+
if(RARRAY_LEN(vmatrix) != 3)
|
53
|
+
rb_raise(rb_eArgError, "matrix size is not 3x3");
|
54
|
+
|
55
|
+
for(i = 0; i < 3; i++){
|
56
|
+
Check_Type(RARRAY_PTR(vmatrix)[i], T_ARRAY);
|
57
|
+
if(RARRAY_LEN(RARRAY_PTR(vmatrix)[i]) != 3)
|
58
|
+
rb_raise(rb_eArgError, "matrix size is not 3x3");
|
59
|
+
|
60
|
+
for(j = 0; j < 3; j++)
|
61
|
+
matrix[i][j] = NUM2DBL(RARRAY_PTR(RARRAY_PTR(vmatrix)[i])[j]);
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
static VALUE
|
66
|
+
vvec_cp(double vector[3], VALUE vvector){
|
67
|
+
int i;
|
68
|
+
|
69
|
+
Check_Type(vvector, T_ARRAY);
|
70
|
+
if(RARRAY_LEN(vvector) != 3)
|
71
|
+
rb_raise(rb_eArgError, "vector size is not 3");
|
72
|
+
|
73
|
+
for(i = 0; i < 3; i++)
|
74
|
+
RARRAY_PTR(vvector)[i] = DBL2NUM(vector[i]);
|
75
|
+
|
76
|
+
return vvector;
|
77
|
+
}
|
78
|
+
|
79
|
+
static VALUE
|
80
|
+
vmat_cp23(double matrix[2][3], VALUE vmatrix){
|
81
|
+
int i, j;
|
82
|
+
|
83
|
+
Check_Type(vmatrix, T_ARRAY);
|
84
|
+
if(RARRAY_LEN(vmatrix) != 2)
|
85
|
+
rb_raise(rb_eArgError, "matrix size is not 2x3");
|
86
|
+
|
87
|
+
for(i = 0; i < 2; i++){
|
88
|
+
Check_Type(RARRAY_PTR(vmatrix)[i], T_ARRAY);
|
89
|
+
if(RARRAY_LEN(RARRAY_PTR(vmatrix)[i]) != 3)
|
90
|
+
rb_raise(rb_eArgError, "matrix size is not 2x3");
|
91
|
+
|
92
|
+
for(j = 0; j < 3; j++)
|
93
|
+
RARRAY_PTR(RARRAY_PTR(vmatrix)[i])[j] = DBL2NUM(matrix[i][j]);
|
94
|
+
}
|
95
|
+
|
96
|
+
return vmatrix;
|
97
|
+
}
|
98
|
+
|
99
|
+
static VALUE
|
100
|
+
vmat_cp33(double matrix[3][3], VALUE vmatrix){
|
101
|
+
int i, j;
|
102
|
+
|
103
|
+
Check_Type(vmatrix, T_ARRAY);
|
104
|
+
if(RARRAY_LEN(vmatrix) != 3)
|
105
|
+
rb_raise(rb_eArgError, "matrix size is not 3x3");
|
106
|
+
|
107
|
+
for(i = 0; i < 3; i++){
|
108
|
+
Check_Type(RARRAY_PTR(vmatrix)[i], T_ARRAY);
|
109
|
+
if(RARRAY_LEN(RARRAY_PTR(vmatrix)[i]) != 3)
|
110
|
+
rb_raise(rb_eArgError, "matrix size is not 3x3");
|
111
|
+
|
112
|
+
for(j = 0; j < 3; j++)
|
113
|
+
RARRAY_PTR(RARRAY_PTR(vmatrix)[i])[j] = DBL2NUM(matrix[i][j]);
|
114
|
+
}
|
115
|
+
|
116
|
+
return vmatrix;
|
117
|
+
}
|
118
|
+
|
119
|
+
static VALUE
|
120
|
+
vvec_new(double vector[3]){
|
121
|
+
return rb_ary_new3(3,
|
122
|
+
DBL2NUM(vector[0]),
|
123
|
+
DBL2NUM(vector[1]),
|
124
|
+
DBL2NUM(vector[2]));
|
125
|
+
}
|
126
|
+
|
127
|
+
static VALUE
|
128
|
+
vmat_new23(double matrix[2][3]){
|
129
|
+
return rb_ary_new3(2,
|
130
|
+
rb_ary_new3(3,
|
131
|
+
DBL2NUM(matrix[0][0]),
|
132
|
+
DBL2NUM(matrix[0][1]),
|
133
|
+
DBL2NUM(matrix[0][2])),
|
134
|
+
rb_ary_new3(3,
|
135
|
+
DBL2NUM(matrix[1][0]),
|
136
|
+
DBL2NUM(matrix[1][1]),
|
137
|
+
DBL2NUM(matrix[1][2])));
|
138
|
+
}
|
139
|
+
|
140
|
+
static VALUE
|
141
|
+
vmat_new33(double matrix[3][3]){
|
142
|
+
return rb_ary_new3(3,
|
143
|
+
rb_ary_new3(3,
|
144
|
+
DBL2NUM(matrix[0][0]),
|
145
|
+
DBL2NUM(matrix[0][1]),
|
146
|
+
DBL2NUM(matrix[0][2])),
|
147
|
+
rb_ary_new3(3,
|
148
|
+
DBL2NUM(matrix[1][0]),
|
149
|
+
DBL2NUM(matrix[1][1]),
|
150
|
+
DBL2NUM(matrix[1][2])),
|
151
|
+
rb_ary_new3(3,
|
152
|
+
DBL2NUM(matrix[2][0]),
|
153
|
+
DBL2NUM(matrix[2][1]),
|
154
|
+
DBL2NUM(matrix[2][2])));
|
155
|
+
}
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
static VALUE
|
160
|
+
celes_s_zp_b(VALUE self, VALUE vp){
|
161
|
+
double p[3];
|
162
|
+
|
163
|
+
cvec_cp(vp, p);
|
164
|
+
iauZp(p);
|
165
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
166
|
+
|
167
|
+
return vvec_cp(p, vp);
|
168
|
+
}
|
169
|
+
|
170
|
+
static VALUE
|
171
|
+
celes_s_zp(VALUE self){
|
172
|
+
double p[3];
|
173
|
+
|
174
|
+
iauZp(p);
|
175
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
176
|
+
|
177
|
+
return vvec_new(p);
|
178
|
+
}
|
179
|
+
|
180
|
+
static VALUE
|
181
|
+
celes_s_zr_b(VALUE self, VALUE vr){
|
182
|
+
double r[3][3];
|
183
|
+
|
184
|
+
cmat_cp33(vr, r);
|
185
|
+
iauZr(r);
|
186
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
187
|
+
|
188
|
+
return vmat_cp33(r, vr);
|
189
|
+
}
|
190
|
+
|
191
|
+
static VALUE
|
192
|
+
celes_s_zr(VALUE self){
|
193
|
+
double r[3][3];
|
194
|
+
|
195
|
+
iauZr(r);
|
196
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
197
|
+
|
198
|
+
return vmat_new33(r);
|
199
|
+
}
|
200
|
+
|
201
|
+
static VALUE
|
202
|
+
celes_s_ir_b(VALUE self, VALUE vr){
|
203
|
+
double r[3][3];
|
204
|
+
|
205
|
+
cmat_cp33(vr, r);
|
206
|
+
iauIr(r);
|
207
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
208
|
+
|
209
|
+
return vmat_cp33(r, vr);
|
210
|
+
}
|
211
|
+
|
212
|
+
static VALUE
|
213
|
+
celes_s_ir(VALUE self){
|
214
|
+
double r[3][3];
|
215
|
+
|
216
|
+
iauIr(r);
|
217
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
218
|
+
|
219
|
+
return vmat_new33(r);
|
220
|
+
}
|
221
|
+
|
222
|
+
static VALUE
|
223
|
+
celes_s_cp(VALUE self, VALUE vp){
|
224
|
+
double p[3], c[3];
|
225
|
+
|
226
|
+
cvec_cp(vp, p);
|
227
|
+
iauCp(p, c);
|
228
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
229
|
+
|
230
|
+
return vvec_new(c);
|
231
|
+
}
|
232
|
+
|
233
|
+
static VALUE
|
234
|
+
celes_s_cr(VALUE self, VALUE vr){
|
235
|
+
double r[3][3], c[3][3];
|
236
|
+
|
237
|
+
cmat_cp33(vr, r);
|
238
|
+
iauCr(r, c);
|
239
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
240
|
+
|
241
|
+
return vmat_new33(c);
|
242
|
+
}
|
243
|
+
|
244
|
+
static VALUE
|
245
|
+
celes_s_rx_b(VALUE self, VALUE vphi, VALUE vr){
|
246
|
+
double r[3][3];
|
247
|
+
|
248
|
+
cmat_cp33(vr, r);
|
249
|
+
iauRx(NUM2DBL(vphi), r);
|
250
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
251
|
+
|
252
|
+
return vmat_cp33(r, vr);
|
253
|
+
}
|
254
|
+
|
255
|
+
static VALUE
|
256
|
+
celes_s_rx(VALUE self, VALUE vphi, VALUE vr){
|
257
|
+
double r[3][3];
|
258
|
+
|
259
|
+
cmat_cp33(vr, r);
|
260
|
+
iauRx(NUM2DBL(vphi), r);
|
261
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
262
|
+
|
263
|
+
return vmat_new33(r);
|
264
|
+
}
|
265
|
+
|
266
|
+
static VALUE
|
267
|
+
celes_s_ry_b(VALUE self, VALUE vphi, VALUE vr){
|
268
|
+
double r[3][3];
|
269
|
+
|
270
|
+
cmat_cp33(vr, r);
|
271
|
+
iauRy(NUM2DBL(vphi), r);
|
272
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
273
|
+
|
274
|
+
return vmat_cp33(r, vr);
|
275
|
+
}
|
276
|
+
|
277
|
+
static VALUE
|
278
|
+
celes_s_ry(VALUE self, VALUE vphi, VALUE vr){
|
279
|
+
double r[3][3];
|
280
|
+
|
281
|
+
cmat_cp33(vr, r);
|
282
|
+
iauRy(NUM2DBL(vphi), r);
|
283
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
284
|
+
|
285
|
+
return vmat_new33(r);
|
286
|
+
}
|
287
|
+
|
288
|
+
static VALUE
|
289
|
+
celes_s_rz_b(VALUE self, VALUE vphi, VALUE vr){
|
290
|
+
double r[3][3];
|
291
|
+
|
292
|
+
cmat_cp33(vr, r);
|
293
|
+
iauRz(NUM2DBL(vphi), r);
|
294
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
295
|
+
|
296
|
+
return vmat_cp33(r, vr);
|
297
|
+
}
|
298
|
+
|
299
|
+
static VALUE
|
300
|
+
celes_s_rz(VALUE self, VALUE vphi, VALUE vr){
|
301
|
+
double r[3][3];
|
302
|
+
|
303
|
+
cmat_cp33(vr, r);
|
304
|
+
iauRz(NUM2DBL(vphi), r);
|
305
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
306
|
+
|
307
|
+
return vmat_new33(r);
|
308
|
+
}
|
309
|
+
|
310
|
+
static VALUE
|
311
|
+
celes_s_s2c(VALUE self, VALUE vtheta, VALUE vphi){
|
312
|
+
double c[3];
|
313
|
+
|
314
|
+
iauS2c(NUM2DBL(vtheta), NUM2DBL(vphi), c);
|
315
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
316
|
+
|
317
|
+
return vvec_new(c);
|
318
|
+
}
|
319
|
+
|
320
|
+
static VALUE
|
321
|
+
celes_s_c2s(VALUE self, VALUE vp){
|
322
|
+
double p[3], theta, phi;
|
323
|
+
|
324
|
+
cvec_cp(vp, p);
|
325
|
+
iauC2s(p, &theta, &phi);
|
326
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
327
|
+
|
328
|
+
return rb_ary_new3(2, DBL2NUM(theta), DBL2NUM(phi));
|
329
|
+
}
|
330
|
+
|
331
|
+
static VALUE
|
332
|
+
celes_s_s2p(VALUE self, VALUE vtheta, VALUE vphi, VALUE vr){
|
333
|
+
double p[3];
|
334
|
+
|
335
|
+
iauS2p(NUM2DBL(vtheta), NUM2DBL(vphi), NUM2DBL(vr), p);
|
336
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
337
|
+
|
338
|
+
return vvec_new(p);
|
339
|
+
}
|
340
|
+
|
341
|
+
static VALUE
|
342
|
+
celes_s_p2s(VALUE self, VALUE vp){
|
343
|
+
double p[3], theta, phi, r;
|
344
|
+
|
345
|
+
cvec_cp(vp, p);
|
346
|
+
iauP2s(p, &theta, &phi, &r);
|
347
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
348
|
+
|
349
|
+
return rb_ary_new3(3, DBL2NUM(theta), DBL2NUM(phi), DBL2NUM(r));
|
350
|
+
}
|
351
|
+
|
352
|
+
static VALUE
|
353
|
+
celes_s_ppp(VALUE self, VALUE va, VALUE vb){
|
354
|
+
double a[3], b[3], apb[3];
|
355
|
+
|
356
|
+
cvec_cp(va, a);
|
357
|
+
cvec_cp(vb, b);
|
358
|
+
iauPpp(a, b, apb);
|
359
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
360
|
+
|
361
|
+
return vvec_new(apb);
|
362
|
+
}
|
363
|
+
|
364
|
+
static VALUE
|
365
|
+
celes_s_pmp(VALUE self, VALUE va, VALUE vb){
|
366
|
+
double a[3], b[3], amb[3];
|
367
|
+
|
368
|
+
cvec_cp(va, a);
|
369
|
+
cvec_cp(vb, b);
|
370
|
+
iauPmp(a, b, amb);
|
371
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
372
|
+
|
373
|
+
return vvec_new(amb);
|
374
|
+
}
|
375
|
+
|
376
|
+
static VALUE
|
377
|
+
celes_s_ppsp(VALUE self, VALUE va, VALUE vs, VALUE vb){
|
378
|
+
double a[3], b[3], apsb[3];
|
379
|
+
|
380
|
+
cvec_cp(va, a);
|
381
|
+
cvec_cp(vb, b);
|
382
|
+
iauPpsp(a, NUM2DBL(vs), b, apsb);
|
383
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
384
|
+
|
385
|
+
return vvec_new(apsb);
|
386
|
+
}
|
387
|
+
|
388
|
+
static VALUE
|
389
|
+
celes_s_pdp(VALUE self, VALUE va, VALUE vb){
|
390
|
+
double a[3], b[3];
|
391
|
+
|
392
|
+
cvec_cp(va, a);
|
393
|
+
cvec_cp(vb, b);
|
394
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
395
|
+
|
396
|
+
return DBL2NUM(iauPdp(a, b));
|
397
|
+
}
|
398
|
+
|
399
|
+
static VALUE
|
400
|
+
celes_s_pxp(VALUE self, VALUE va, VALUE vb){
|
401
|
+
double a[3], b[3], axb[3];
|
402
|
+
|
403
|
+
cvec_cp(va, a);
|
404
|
+
cvec_cp(vb, b);
|
405
|
+
iauPxp(a, b, axb);
|
406
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
407
|
+
|
408
|
+
return vvec_new(axb);
|
409
|
+
}
|
410
|
+
|
411
|
+
static VALUE
|
412
|
+
celes_s_pm(VALUE self, VALUE vp){
|
413
|
+
double p[3];
|
414
|
+
|
415
|
+
cvec_cp(vp, p);
|
416
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
417
|
+
|
418
|
+
return DBL2NUM(iauPm(p));
|
419
|
+
}
|
420
|
+
|
421
|
+
static VALUE
|
422
|
+
celes_s_pn(VALUE self, VALUE vp){
|
423
|
+
double p[3], r, u[3];
|
424
|
+
|
425
|
+
cvec_cp(vp, p);
|
426
|
+
iauPn(p, &r, u);
|
427
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
428
|
+
|
429
|
+
return rb_ary_new3(2, DBL2NUM(r), vvec_new(u));
|
430
|
+
}
|
431
|
+
|
432
|
+
static VALUE
|
433
|
+
celes_s_sxp(VALUE self, VALUE vs, VALUE vp){
|
434
|
+
double p[3], sp[3];
|
435
|
+
|
436
|
+
cvec_cp(vp, p);
|
437
|
+
iauSxp(NUM2DBL(vs), p, sp);
|
438
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
439
|
+
|
440
|
+
return vvec_new(sp);
|
441
|
+
}
|
442
|
+
|
443
|
+
|
444
|
+
static VALUE
|
445
|
+
celes_s_rxr(VALUE self, VALUE va, VALUE vb){
|
446
|
+
double a[3][3], b[3][3], atb[3][3];
|
447
|
+
|
448
|
+
cmat_cp33(va, a);
|
449
|
+
cmat_cp33(vb, b);
|
450
|
+
iauRxr(a, b, atb);
|
451
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
452
|
+
|
453
|
+
return vmat_new33(atb);
|
454
|
+
}
|
455
|
+
|
456
|
+
static VALUE
|
457
|
+
celes_s_tr(VALUE self, VALUE vr){
|
458
|
+
double r[3][3], rt[3][3];
|
459
|
+
|
460
|
+
cmat_cp33(vr, r);
|
461
|
+
iauTr(r, rt);
|
462
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
463
|
+
|
464
|
+
return vmat_new33(rt);
|
465
|
+
}
|
466
|
+
|
467
|
+
static VALUE
|
468
|
+
celes_s_rxp(VALUE self, VALUE vr, VALUE vp){
|
469
|
+
double r[3][3], p[3], rp[3];
|
470
|
+
|
471
|
+
cmat_cp33(vr, r);
|
472
|
+
cvec_cp(vp, p);
|
473
|
+
iauRxp(r, p, rp);
|
474
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
475
|
+
|
476
|
+
return vvec_new(rp);
|
477
|
+
}
|
478
|
+
|
479
|
+
static VALUE
|
480
|
+
celes_s_trxp(VALUE self, VALUE vr, VALUE vp){
|
481
|
+
double r[3][3], p[3], trp[3];
|
482
|
+
|
483
|
+
cmat_cp33(vr, r);
|
484
|
+
cvec_cp(vp, p);
|
485
|
+
iauTrxp(r, p, trp);
|
486
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
487
|
+
|
488
|
+
return vvec_new(trp);
|
489
|
+
}
|
490
|
+
|
491
|
+
static VALUE
|
492
|
+
celes_s_sepp(VALUE self, VALUE va, VALUE vb){
|
493
|
+
double a[3], b[3];
|
494
|
+
|
495
|
+
cvec_cp(va, a);
|
496
|
+
cvec_cp(vb, b);
|
497
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
498
|
+
|
499
|
+
return DBL2NUM(iauSepp(a, b));
|
500
|
+
}
|
501
|
+
|
502
|
+
static VALUE
|
503
|
+
celes_s_seps(VALUE self, VALUE val, VALUE vap, VALUE vbl, VALUE vbp){
|
504
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
505
|
+
|
506
|
+
return DBL2NUM(iauSeps(NUM2DBL(val), NUM2DBL(vap),
|
507
|
+
NUM2DBL(vbl), NUM2DBL(vbp)));
|
508
|
+
}
|
509
|
+
|
510
|
+
static VALUE
|
511
|
+
celes_s_pap(VALUE self, VALUE va, VALUE vb){
|
512
|
+
double a[3], b[3];
|
513
|
+
|
514
|
+
cvec_cp(va, a);
|
515
|
+
cvec_cp(vb, b);
|
516
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
517
|
+
|
518
|
+
return DBL2NUM(iauPap(a, b));
|
519
|
+
}
|
520
|
+
|
521
|
+
static VALUE
|
522
|
+
celes_s_pas(VALUE self, VALUE val, VALUE vap, VALUE vbl, VALUE vbp){
|
523
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
524
|
+
|
525
|
+
return DBL2NUM(iauPas(NUM2DBL(val), NUM2DBL(vap),
|
526
|
+
NUM2DBL(vbl), NUM2DBL(vbp)));
|
527
|
+
}
|
528
|
+
|
529
|
+
static VALUE
|
530
|
+
celes_s_rv2m(VALUE self, VALUE vw){
|
531
|
+
double w[3], r[3][3];
|
532
|
+
|
533
|
+
cvec_cp(vw, w);
|
534
|
+
iauRv2m(w, r);
|
535
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
536
|
+
|
537
|
+
return vmat_new33(r);
|
538
|
+
}
|
539
|
+
|
540
|
+
static VALUE
|
541
|
+
celes_s_rm2v(VALUE self, VALUE vr){
|
542
|
+
double r[3][3], w[3];
|
543
|
+
|
544
|
+
cmat_cp33(vr, r);
|
545
|
+
iauRm2v(r, w);
|
546
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
547
|
+
|
548
|
+
return vvec_new(w);
|
549
|
+
}
|
550
|
+
|
551
|
+
static VALUE
|
552
|
+
celes_s_zpv_b(VALUE self, VALUE vpv){
|
553
|
+
double pv[2][3];
|
554
|
+
|
555
|
+
cmat_cp23(vpv, pv);
|
556
|
+
iauZpv(pv);
|
557
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
558
|
+
|
559
|
+
return vmat_cp23(pv, vpv);
|
560
|
+
}
|
561
|
+
|
562
|
+
static VALUE
|
563
|
+
celes_s_zpv(VALUE self){
|
564
|
+
double pv[2][3];
|
565
|
+
|
566
|
+
iauZpv(pv);
|
567
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
568
|
+
|
569
|
+
return vmat_new23(pv);
|
570
|
+
}
|
571
|
+
|
572
|
+
static VALUE
|
573
|
+
celes_s_cpv(VALUE self, VALUE vpv){
|
574
|
+
double pv[2][3], c[2][3];
|
575
|
+
|
576
|
+
cmat_cp23(vpv, pv);
|
577
|
+
iauCpv(pv, c);
|
578
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
579
|
+
|
580
|
+
return vmat_new23(c);
|
581
|
+
}
|
582
|
+
|
583
|
+
static VALUE
|
584
|
+
celes_s_p2pv(VALUE self, VALUE vp){
|
585
|
+
double p[3], pv[2][3];
|
586
|
+
|
587
|
+
cvec_cp(vp, p);
|
588
|
+
iauP2pv(p, pv);
|
589
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
590
|
+
|
591
|
+
return vmat_new23(pv);
|
592
|
+
}
|
593
|
+
|
594
|
+
static VALUE
|
595
|
+
celes_s_pv2p(VALUE self, VALUE vpv){
|
596
|
+
double pv[2][3], p[3];
|
597
|
+
|
598
|
+
cmat_cp23(vpv, pv);
|
599
|
+
iauPv2p(pv, p);
|
600
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
601
|
+
|
602
|
+
return vvec_new(p);
|
603
|
+
}
|
604
|
+
|
605
|
+
static VALUE
|
606
|
+
celes_s_s2pv(VALUE self, VALUE vtheta, VALUE vphi, VALUE vr,
|
607
|
+
VALUE vtd, VALUE vpd, VALUE vrd){
|
608
|
+
double pv[2][3];
|
609
|
+
|
610
|
+
iauS2pv(NUM2DBL(vtheta), NUM2DBL(vphi), NUM2DBL(vr),
|
611
|
+
NUM2DBL(vtd), NUM2DBL(vpd), NUM2DBL(vrd), pv);
|
612
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
613
|
+
|
614
|
+
return vmat_new23(pv);
|
615
|
+
}
|
616
|
+
|
617
|
+
static VALUE
|
618
|
+
celes_s_pv2s(VALUE self, VALUE vpv){
|
619
|
+
double pv[2][3], theta, phi, r, td, pd, rd;
|
620
|
+
|
621
|
+
cmat_cp23(vpv, pv);
|
622
|
+
iauPv2s(pv, &theta, &phi, &r, &td, &pd, &rd);
|
623
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
624
|
+
|
625
|
+
return rb_ary_new3(6, DBL2NUM(theta), DBL2NUM(phi),
|
626
|
+
DBL2NUM(r), DBL2NUM(td), DBL2NUM(pd), DBL2NUM(rd));
|
627
|
+
}
|
628
|
+
|
629
|
+
static VALUE
|
630
|
+
celes_s_pvppv(VALUE self, VALUE va, VALUE vb){
|
631
|
+
double a[2][3], b[2][3], apb[2][3];
|
632
|
+
|
633
|
+
cmat_cp23(va, a);
|
634
|
+
cmat_cp23(vb, b);
|
635
|
+
iauPvppv(a, b, apb);
|
636
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
637
|
+
|
638
|
+
return vmat_new23(apb);
|
639
|
+
}
|
640
|
+
|
641
|
+
static VALUE
|
642
|
+
celes_s_pvmpv(VALUE self, VALUE va, VALUE vb){
|
643
|
+
double a[2][3], b[2][3], amb[2][3];
|
644
|
+
|
645
|
+
cmat_cp23(va, a);
|
646
|
+
cmat_cp23(vb, b);
|
647
|
+
iauPvmpv(a, b, amb);
|
648
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
649
|
+
|
650
|
+
return vmat_new23(amb);
|
651
|
+
}
|
652
|
+
|
653
|
+
static VALUE
|
654
|
+
celes_s_pvdpv(VALUE self, VALUE va, VALUE vb){
|
655
|
+
double a[2][3], b[2][3], adb[2];
|
656
|
+
|
657
|
+
cmat_cp23(va, a);
|
658
|
+
cmat_cp23(vb, b);
|
659
|
+
iauPvdpv(a, b, adb);
|
660
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
661
|
+
|
662
|
+
return rb_ary_new3(2, DBL2NUM(adb[0]), DBL2NUM(adb[1]));
|
663
|
+
}
|
664
|
+
|
665
|
+
static VALUE
|
666
|
+
celes_s_pvxpv(VALUE self, VALUE va, VALUE vb){
|
667
|
+
double a[2][3], b[2][3], axb[2][3];
|
668
|
+
|
669
|
+
cmat_cp23(va, a);
|
670
|
+
cmat_cp23(vb, b);
|
671
|
+
iauPvxpv(a, b, axb);
|
672
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
673
|
+
|
674
|
+
return vmat_new23(axb);
|
675
|
+
}
|
676
|
+
|
677
|
+
static VALUE
|
678
|
+
celes_s_pvm(VALUE self, VALUE vpv){
|
679
|
+
double pv[2][3], r, s;
|
680
|
+
|
681
|
+
cmat_cp23(vpv, pv);
|
682
|
+
iauPvm(pv, &r, &s);
|
683
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
684
|
+
|
685
|
+
return rb_ary_new3(2, DBL2NUM(r), DBL2NUM(s));
|
686
|
+
}
|
687
|
+
|
688
|
+
static VALUE
|
689
|
+
celes_s_sxpv(VALUE self, VALUE vs, VALUE vpv){
|
690
|
+
double pv[2][3], spv[2][3];
|
691
|
+
|
692
|
+
cmat_cp23(vpv, pv);
|
693
|
+
iauSxpv(NUM2DBL(vs), pv, spv);
|
694
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
695
|
+
|
696
|
+
return vmat_new23(spv);
|
697
|
+
}
|
698
|
+
|
699
|
+
static VALUE
|
700
|
+
celes_s_s2xpv(VALUE self, VALUE vs1, VALUE vs2, VALUE vpv){
|
701
|
+
double pv[2][3], spv[2][3];
|
702
|
+
|
703
|
+
cmat_cp23(vpv, pv);
|
704
|
+
iauS2xpv(NUM2DBL(vs1), NUM2DBL(vs2), pv, spv);
|
705
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
706
|
+
|
707
|
+
return vmat_new23(spv);
|
708
|
+
}
|
709
|
+
|
710
|
+
static VALUE
|
711
|
+
celes_s_pvu(VALUE self, VALUE vdt, VALUE vpv){
|
712
|
+
double pv[2][3], upv[2][3];
|
713
|
+
|
714
|
+
cmat_cp23(vpv, pv);
|
715
|
+
iauPvu(NUM2DBL(vdt), pv, upv);
|
716
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
717
|
+
|
718
|
+
return vmat_new23(upv);
|
719
|
+
}
|
720
|
+
|
721
|
+
static VALUE
|
722
|
+
celes_s_pvup(VALUE self, VALUE vdt, VALUE vpv){
|
723
|
+
double pv[2][3], p[3];
|
724
|
+
|
725
|
+
cmat_cp23(vpv, pv);
|
726
|
+
iauPvup(NUM2DBL(vdt), pv, p);
|
727
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
728
|
+
|
729
|
+
return vvec_new(p);
|
730
|
+
}
|
731
|
+
|
732
|
+
static VALUE
|
733
|
+
celes_s_rxpv(VALUE self, VALUE vr, VALUE vpv){
|
734
|
+
double r[3][3], pv[2][3], rpv[2][3];
|
735
|
+
|
736
|
+
cmat_cp33(vr, r);
|
737
|
+
cmat_cp23(vpv, pv);
|
738
|
+
iauRxpv(r, pv, rpv);
|
739
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
740
|
+
|
741
|
+
return vmat_new23(rpv);
|
742
|
+
}
|
743
|
+
|
744
|
+
static VALUE
|
745
|
+
celes_s_trxpv(VALUE self, VALUE vr, VALUE vpv){
|
746
|
+
double r[3][3], pv[2][3], trpv[2][3];
|
747
|
+
|
748
|
+
cmat_cp33(vr, r);
|
749
|
+
cmat_cp23(vpv, pv);
|
750
|
+
iauTrxpv(r, pv, trpv);
|
751
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
752
|
+
|
753
|
+
return vmat_new23(trpv);
|
754
|
+
}
|
755
|
+
|
756
|
+
static VALUE
|
757
|
+
celes_s_anp(VALUE self, VALUE va){
|
758
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
759
|
+
|
760
|
+
return DBL2NUM(iauAnp(NUM2DBL(va)));
|
761
|
+
}
|
762
|
+
|
763
|
+
static VALUE
|
764
|
+
celes_s_anpm(VALUE self, VALUE va){
|
765
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
766
|
+
|
767
|
+
return DBL2NUM(iauAnpm(NUM2DBL(va)));
|
768
|
+
}
|
769
|
+
|
770
|
+
static VALUE
|
771
|
+
celes_s_a2tf(VALUE self, VALUE vndp, VALUE vangle){
|
772
|
+
char sign;
|
773
|
+
int ihmsf[4];
|
774
|
+
|
775
|
+
iauA2tf(NUM2INT(vndp), NUM2DBL(vangle), &sign, ihmsf);
|
776
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
777
|
+
|
778
|
+
return rb_ary_new3(2, rb_str_new(&sign, 1),
|
779
|
+
rb_ary_new3(4, INT2NUM(ihmsf[0]), INT2NUM(ihmsf[1]),
|
780
|
+
INT2NUM(ihmsf[2]), INT2NUM(ihmsf[3])));
|
781
|
+
}
|
782
|
+
|
783
|
+
static VALUE
|
784
|
+
celes_s_a2af(VALUE self, VALUE vndp, VALUE vangle){
|
785
|
+
char sign;
|
786
|
+
int idmsf[4];
|
787
|
+
|
788
|
+
iauA2af(NUM2INT(vndp), NUM2DBL(vangle), &sign, idmsf);
|
789
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
790
|
+
|
791
|
+
return rb_ary_new3(2, rb_str_new(&sign, 1),
|
792
|
+
rb_ary_new3(4, INT2NUM(idmsf[0]), INT2NUM(idmsf[1]),
|
793
|
+
INT2NUM(idmsf[2]), INT2NUM(idmsf[3])));
|
794
|
+
}
|
795
|
+
|
796
|
+
static VALUE
|
797
|
+
celes_s_af2a(VALUE self, VALUE vs, VALUE vdeg, VALUE vamin, VALUE vasec){
|
798
|
+
int ret;
|
799
|
+
double rad;
|
800
|
+
|
801
|
+
Check_Type(vs, T_STRING);
|
802
|
+
|
803
|
+
ret = iauAf2a(RSTRING_PTR(vs)[0], NUM2DBL(vdeg),
|
804
|
+
NUM2DBL(vamin), NUM2DBL(vasec), &rad);
|
805
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
806
|
+
|
807
|
+
return DBL2NUM(rad);
|
808
|
+
}
|
809
|
+
|
810
|
+
static VALUE
|
811
|
+
celes_s_d2tf(VALUE self, VALUE vndp, VALUE vdays){
|
812
|
+
char sign;
|
813
|
+
int ihmsf[4];
|
814
|
+
|
815
|
+
iauD2tf(NUM2INT(vndp), NUM2DBL(vdays), &sign, ihmsf);
|
816
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
817
|
+
|
818
|
+
return rb_ary_new3(2, rb_str_new(&sign, 1),
|
819
|
+
rb_ary_new3(4, INT2NUM(ihmsf[0]), INT2NUM(ihmsf[1]),
|
820
|
+
INT2NUM(ihmsf[2]), INT2NUM(ihmsf[3])));
|
821
|
+
}
|
822
|
+
|
823
|
+
static VALUE
|
824
|
+
celes_s_tf2a(VALUE self, VALUE vs, VALUE vhour, VALUE vmin, VALUE vsec){
|
825
|
+
int ret;
|
826
|
+
double rad;
|
827
|
+
|
828
|
+
Check_Type(vs, T_STRING);
|
829
|
+
|
830
|
+
ret = iauTf2a(RSTRING_PTR(vs)[0], NUM2DBL(vhour),
|
831
|
+
NUM2DBL(vmin), NUM2DBL(vsec), &rad);
|
832
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
833
|
+
|
834
|
+
return DBL2NUM(rad);
|
835
|
+
}
|
836
|
+
|
837
|
+
static VALUE
|
838
|
+
celes_s_tf2d(VALUE self, VALUE vs, VALUE vhour, VALUE vmin, VALUE vsec){
|
839
|
+
int ret;
|
840
|
+
double days;
|
841
|
+
|
842
|
+
Check_Type(vs, T_STRING);
|
843
|
+
|
844
|
+
ret = iauTf2d(RSTRING_PTR(vs)[0], NUM2DBL(vhour),
|
845
|
+
NUM2DBL(vmin), NUM2DBL(vsec), &days);
|
846
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
847
|
+
|
848
|
+
return DBL2NUM(days);
|
849
|
+
}
|
850
|
+
|
851
|
+
static VALUE
|
852
|
+
celes_s_cal2jd(VALUE self, VALUE vy, VALUE vm, VALUE vd){
|
853
|
+
int ret;
|
854
|
+
double djm0, djm;
|
855
|
+
|
856
|
+
ret = iauCal2jd(NUM2INT(vy), NUM2INT(vm), NUM2INT(vd), &djm0, &djm);
|
857
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
858
|
+
|
859
|
+
if(ret == -1)
|
860
|
+
rb_raise(rb_eArgError, "bad year");
|
861
|
+
else if(ret == -2)
|
862
|
+
rb_raise(rb_eArgError, "bad month");
|
863
|
+
|
864
|
+
return rb_ary_new3(2, DBL2NUM(djm0), DBL2NUM(djm));
|
865
|
+
}
|
866
|
+
|
867
|
+
static VALUE
|
868
|
+
celes_s_epb(VALUE self, VALUE vdj1, VALUE vdj2){
|
869
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
870
|
+
|
871
|
+
return DBL2NUM(iauEpb(NUM2DBL(vdj1), NUM2DBL(vdj2)));
|
872
|
+
}
|
873
|
+
|
874
|
+
static VALUE
|
875
|
+
celes_s_epb2jd(VALUE self, VALUE vepb){
|
876
|
+
double djm0, djm;
|
877
|
+
|
878
|
+
iauEpb2jd(NUM2DBL(vepb), &djm0, &djm);
|
879
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
880
|
+
|
881
|
+
return rb_ary_new3(2, DBL2NUM(djm0), DBL2NUM(djm));
|
882
|
+
}
|
883
|
+
|
884
|
+
static VALUE
|
885
|
+
celes_s_epj(VALUE self, VALUE vdj1, VALUE vdj2){
|
886
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
887
|
+
|
888
|
+
return DBL2NUM(iauEpj(NUM2DBL(vdj1), NUM2DBL(vdj2)));
|
889
|
+
}
|
890
|
+
|
891
|
+
static VALUE
|
892
|
+
celes_s_epj2jd(VALUE self, VALUE vepj){
|
893
|
+
double djm0, djm;
|
894
|
+
|
895
|
+
iauEpj2jd(NUM2DBL(vepj), &djm0, &djm);
|
896
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
897
|
+
|
898
|
+
return rb_ary_new3(2, DBL2NUM(djm0), DBL2NUM(djm));
|
899
|
+
}
|
900
|
+
|
901
|
+
|
902
|
+
static VALUE
|
903
|
+
celes_s_jd2cal(VALUE self, VALUE vdj1, VALUE vdj2){
|
904
|
+
int ret, iy, im, id;
|
905
|
+
double fd;
|
906
|
+
|
907
|
+
ret = iauJd2cal(NUM2DBL(vdj1), NUM2DBL(vdj2), &iy, &im, &id, &fd);
|
908
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
909
|
+
|
910
|
+
if(ret == -1)
|
911
|
+
rb_raise(rb_eArgError, "unacceptable date");
|
912
|
+
|
913
|
+
return rb_ary_new3(4, INT2FIX(iy), INT2FIX(im),
|
914
|
+
INT2FIX(id), DBL2NUM(fd));
|
915
|
+
}
|
916
|
+
|
917
|
+
static VALUE
|
918
|
+
celes_s_jdcalf(VALUE self, VALUE vndp, VALUE vdj1, VALUE vdj2){
|
919
|
+
int ret, iymdf[4];
|
920
|
+
|
921
|
+
ret = iauJdcalf(NUM2INT(vndp), NUM2DBL(vdj1), NUM2DBL(vdj2), iymdf);
|
922
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
923
|
+
|
924
|
+
if(ret == -1)
|
925
|
+
rb_raise(rb_eArgError, "date out of range");
|
926
|
+
|
927
|
+
return rb_ary_new3(4, INT2FIX(iymdf[0]), INT2FIX(iymdf[1]),
|
928
|
+
INT2FIX(iymdf[2]), INT2NUM(iymdf[3]));
|
929
|
+
}
|
930
|
+
|
931
|
+
static VALUE
|
932
|
+
celes_s_d2dtf(VALUE self, VALUE vscale, VALUE vndp, VALUE vd1, VALUE vd2){
|
933
|
+
int ret;
|
934
|
+
int iy, im, id, ihmsf[4];
|
935
|
+
|
936
|
+
if(NIL_P(vscale)) vscale = rb_str_new2("");
|
937
|
+
ret = iauD2dtf(RSTRING_PTR(vscale), NUM2INT(vndp),
|
938
|
+
NUM2DBL(vd1), NUM2DBL(vd2), &iy, &im, &id, ihmsf);
|
939
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
940
|
+
|
941
|
+
if(ret == -1)
|
942
|
+
rb_raise(rb_eArgError, "unacceptable date");
|
943
|
+
|
944
|
+
return rb_ary_new3(4, INT2FIX(iy), INT2FIX(im), INT2FIX(id),
|
945
|
+
rb_ary_new3(4, INT2FIX(ihmsf[0]), INT2FIX(ihmsf[1]),
|
946
|
+
INT2FIX(ihmsf[2]), INT2NUM(ihmsf[3])));
|
947
|
+
}
|
948
|
+
|
949
|
+
static VALUE
|
950
|
+
celes_s_dat(VALUE self, VALUE vy, VALUE vm, VALUE vd, VALUE vfd){
|
951
|
+
int ret;
|
952
|
+
double deltat;
|
953
|
+
|
954
|
+
ret = iauDat(NUM2INT(vy), NUM2INT(vm),
|
955
|
+
NUM2INT(vd), NUM2DBL(vfd), &deltat);
|
956
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
957
|
+
|
958
|
+
if(ret == -1)
|
959
|
+
rb_raise(rb_eArgError, "bad year");
|
960
|
+
else if(ret == -2)
|
961
|
+
rb_raise(rb_eArgError, "bad month");
|
962
|
+
else if(ret == -3)
|
963
|
+
rb_raise(rb_eArgError, "bad day");
|
964
|
+
else if(ret == -4)
|
965
|
+
rb_raise(rb_eArgError, "bad fraction");
|
966
|
+
|
967
|
+
return DBL2NUM(deltat);
|
968
|
+
}
|
969
|
+
|
970
|
+
static VALUE
|
971
|
+
celes_s_dtdb(VALUE self, VALUE vdate1, VALUE vdate2,
|
972
|
+
VALUE vut, VALUE velong, VALUE vu, VALUE vv){
|
973
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
974
|
+
|
975
|
+
return DBL2NUM(iauDtdb(NUM2DBL(vdate1), NUM2DBL(vdate2),
|
976
|
+
NUM2DBL(vut), NUM2DBL(velong), NUM2DBL(vu), NUM2DBL(vv)));
|
977
|
+
}
|
978
|
+
|
979
|
+
static VALUE
|
980
|
+
celes_s_dtf2d(VALUE self, VALUE vscale, VALUE vy, VALUE vm, VALUE vd,
|
981
|
+
VALUE vhr, VALUE vmn, VALUE vsec){
|
982
|
+
int ret;
|
983
|
+
double d1, d2;
|
984
|
+
|
985
|
+
if(NIL_P(vscale)) vscale = rb_str_new2("");
|
986
|
+
ret = iauDtf2d(RSTRING_PTR(vscale), NUM2INT(vy), NUM2INT(vm),
|
987
|
+
NUM2INT(vd), NUM2INT(vhr), NUM2INT(vmn), NUM2DBL(vsec),
|
988
|
+
&d1, &d2);
|
989
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
990
|
+
|
991
|
+
if(ret == -1)
|
992
|
+
rb_raise(rb_eArgError, "bad year");
|
993
|
+
else if(ret == -2)
|
994
|
+
rb_raise(rb_eArgError, "bad month");
|
995
|
+
else if(ret == -3)
|
996
|
+
rb_raise(rb_eArgError, "bad day");
|
997
|
+
|
998
|
+
return rb_ary_new3(2, DBL2NUM(d1), DBL2NUM(d2));
|
999
|
+
}
|
1000
|
+
|
1001
|
+
static VALUE
|
1002
|
+
celes_s_taitt(VALUE self, VALUE vtai1, VALUE vtai2){
|
1003
|
+
double tt1, tt2;
|
1004
|
+
|
1005
|
+
iauTaitt(NUM2DBL(vtai1), NUM2DBL(vtai2), &tt1, &tt2);
|
1006
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1007
|
+
|
1008
|
+
return rb_ary_new3(2, DBL2NUM(tt1), DBL2NUM(tt2));
|
1009
|
+
}
|
1010
|
+
|
1011
|
+
static VALUE
|
1012
|
+
celes_s_taiut1(VALUE self, VALUE vtai1, VALUE vtai2, VALUE vdta){
|
1013
|
+
double ut11, ut12;
|
1014
|
+
|
1015
|
+
iauTaiut1(NUM2DBL(vtai1), NUM2DBL(vtai2), NUM2DBL(vdta), &ut11, &ut12);
|
1016
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1017
|
+
|
1018
|
+
return rb_ary_new3(2, DBL2NUM(ut11), DBL2NUM(ut12));
|
1019
|
+
}
|
1020
|
+
|
1021
|
+
static VALUE
|
1022
|
+
celes_s_taiutc(VALUE self, VALUE vtai1, VALUE vtai2){
|
1023
|
+
int ret;
|
1024
|
+
double utc1, utc2;
|
1025
|
+
|
1026
|
+
ret = iauTaiutc(NUM2DBL(vtai1), NUM2DBL(vtai2), &utc1, &utc2);
|
1027
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
1028
|
+
|
1029
|
+
if(ret == -1)
|
1030
|
+
rb_raise(rb_eArgError, "unacceptable date");
|
1031
|
+
|
1032
|
+
return rb_ary_new3(2, DBL2NUM(utc1), DBL2NUM(utc2));
|
1033
|
+
}
|
1034
|
+
|
1035
|
+
static VALUE
|
1036
|
+
celes_s_tcbtdb(VALUE self, VALUE vtcb1, VALUE vtcb2){
|
1037
|
+
double tdb1, tdb2;
|
1038
|
+
|
1039
|
+
iauTcbtdb(NUM2DBL(vtcb1), NUM2DBL(vtcb2), &tdb1, &tdb2);
|
1040
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1041
|
+
|
1042
|
+
return rb_ary_new3(2, DBL2NUM(tdb1), DBL2NUM(tdb2));
|
1043
|
+
}
|
1044
|
+
|
1045
|
+
static VALUE
|
1046
|
+
celes_s_tcgtt(VALUE self, VALUE vtcg1, VALUE vtcg2){
|
1047
|
+
double tt1, tt2;
|
1048
|
+
|
1049
|
+
iauTcgtt(NUM2DBL(vtcg1), NUM2DBL(vtcg2), &tt1, &tt2);
|
1050
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1051
|
+
|
1052
|
+
return rb_ary_new3(2, DBL2NUM(tt1), DBL2NUM(tt2));
|
1053
|
+
}
|
1054
|
+
|
1055
|
+
static VALUE
|
1056
|
+
celes_s_tdbtcb(VALUE self, VALUE vtdb1, VALUE vtdb2){
|
1057
|
+
double tcb1, tcb2;
|
1058
|
+
|
1059
|
+
iauTdbtcb(NUM2DBL(vtdb1), NUM2DBL(vtdb2), &tcb1, &tcb2);
|
1060
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1061
|
+
|
1062
|
+
return rb_ary_new3(2, DBL2NUM(tcb1), DBL2NUM(tcb2));
|
1063
|
+
}
|
1064
|
+
|
1065
|
+
static VALUE
|
1066
|
+
celes_s_tdbtt(VALUE self, VALUE vtdb1, VALUE vtdb2, VALUE vdtr){
|
1067
|
+
double tt1, tt2;
|
1068
|
+
|
1069
|
+
iauTdbtt(NUM2DBL(vtdb1), NUM2DBL(vtdb2), NUM2DBL(vdtr), &tt1, &tt2);
|
1070
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1071
|
+
|
1072
|
+
return rb_ary_new3(2, DBL2NUM(tt1), DBL2NUM(tt2));
|
1073
|
+
}
|
1074
|
+
|
1075
|
+
static VALUE
|
1076
|
+
celes_s_tttai(VALUE self, VALUE vtt1, VALUE vtt2){
|
1077
|
+
double tai1, tai2;
|
1078
|
+
|
1079
|
+
iauTttai(NUM2DBL(vtt1), NUM2DBL(vtt2), &tai1, &tai2);
|
1080
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1081
|
+
|
1082
|
+
return rb_ary_new3(2, DBL2NUM(tai1), DBL2NUM(tai2));
|
1083
|
+
}
|
1084
|
+
|
1085
|
+
static VALUE
|
1086
|
+
celes_s_tttcg(VALUE self, VALUE vtt1, VALUE vtt2){
|
1087
|
+
double tcg1, tcg2;
|
1088
|
+
|
1089
|
+
iauTttcg(NUM2DBL(vtt1), NUM2DBL(vtt2), &tcg1, &tcg2);
|
1090
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1091
|
+
|
1092
|
+
return rb_ary_new3(2, DBL2NUM(tcg1), DBL2NUM(tcg2));
|
1093
|
+
}
|
1094
|
+
|
1095
|
+
static VALUE
|
1096
|
+
celes_s_tttdb(VALUE self, VALUE vtt1, VALUE vtt2, VALUE vdtr){
|
1097
|
+
double tdb1, tdb2;
|
1098
|
+
|
1099
|
+
iauTttdb(NUM2DBL(vtt1), NUM2DBL(vtt2), NUM2DBL(vdtr), &tdb1, &tdb2);
|
1100
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1101
|
+
|
1102
|
+
return rb_ary_new3(2, DBL2NUM(tdb1), DBL2NUM(tdb2));
|
1103
|
+
}
|
1104
|
+
|
1105
|
+
static VALUE
|
1106
|
+
celes_s_ttut1(VALUE self, VALUE vtt1, VALUE vtt2, VALUE vdt){
|
1107
|
+
double ut11, ut12;
|
1108
|
+
|
1109
|
+
iauTtut1(NUM2DBL(vtt1), NUM2DBL(vtt2), NUM2DBL(vdt), &ut11, &ut12);
|
1110
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1111
|
+
|
1112
|
+
return rb_ary_new3(2, DBL2NUM(ut11), DBL2NUM(ut12));
|
1113
|
+
}
|
1114
|
+
|
1115
|
+
static VALUE
|
1116
|
+
celes_s_ut1tai(VALUE self, VALUE vut11, VALUE vut12, VALUE vdta){
|
1117
|
+
double tai1, tai2;
|
1118
|
+
|
1119
|
+
iauUt1tai(NUM2DBL(vut11), NUM2DBL(vut12), NUM2DBL(vdta), &tai1, &tai2);
|
1120
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1121
|
+
|
1122
|
+
return rb_ary_new3(2, DBL2NUM(tai1), DBL2NUM(tai2));
|
1123
|
+
}
|
1124
|
+
|
1125
|
+
static VALUE
|
1126
|
+
celes_s_ut1tt(VALUE self, VALUE vut11, VALUE vut12, VALUE vdt){
|
1127
|
+
double tt1, tt2;
|
1128
|
+
|
1129
|
+
iauUt1tt(NUM2DBL(vut11), NUM2DBL(vut12), NUM2DBL(vdt), &tt1, &tt2);
|
1130
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1131
|
+
|
1132
|
+
return rb_ary_new3(2, DBL2NUM(tt1), DBL2NUM(tt2));
|
1133
|
+
}
|
1134
|
+
|
1135
|
+
static VALUE
|
1136
|
+
celes_s_ut1utc(VALUE self, VALUE vut11, VALUE vut12, VALUE vdut1){
|
1137
|
+
int ret;
|
1138
|
+
double utc1, utc2;
|
1139
|
+
|
1140
|
+
ret = iauUt1utc(NUM2DBL(vut11), NUM2DBL(vut12),
|
1141
|
+
NUM2DBL(vdut1), &utc1, &utc2);
|
1142
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
1143
|
+
|
1144
|
+
if(ret == -1)
|
1145
|
+
rb_raise(rb_eArgError, "unacceptable date");
|
1146
|
+
|
1147
|
+
return rb_ary_new3(2, DBL2NUM(utc1), DBL2NUM(utc2));
|
1148
|
+
}
|
1149
|
+
|
1150
|
+
static VALUE
|
1151
|
+
celes_s_utctai(VALUE self, VALUE vutc1, VALUE vutc2){
|
1152
|
+
int ret;
|
1153
|
+
double tai1, tai2;
|
1154
|
+
|
1155
|
+
ret = iauUtctai(NUM2DBL(vutc1), NUM2DBL(vutc2), &tai1, &tai2);
|
1156
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
1157
|
+
|
1158
|
+
if(ret == -1)
|
1159
|
+
rb_raise(rb_eArgError, "unacceptable date");
|
1160
|
+
|
1161
|
+
return rb_ary_new3(2, DBL2NUM(tai1), DBL2NUM(tai2));
|
1162
|
+
}
|
1163
|
+
|
1164
|
+
static VALUE
|
1165
|
+
celes_s_utcut1(VALUE self, VALUE vutc1, VALUE vutc2, VALUE vdut1){
|
1166
|
+
int ret;
|
1167
|
+
double ut11, ut12;
|
1168
|
+
|
1169
|
+
ret = iauUtcut1(NUM2DBL(vutc1), NUM2DBL(vutc2),
|
1170
|
+
NUM2DBL(vdut1), &ut11, &ut12);
|
1171
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
1172
|
+
|
1173
|
+
if(ret == -1)
|
1174
|
+
rb_raise(rb_eArgError, "unacceptable date");
|
1175
|
+
|
1176
|
+
return rb_ary_new3(2, DBL2NUM(ut11), DBL2NUM(ut12));
|
1177
|
+
}
|
1178
|
+
|
1179
|
+
static VALUE
|
1180
|
+
celes_s_ee00(VALUE self, VALUE vdate1, VALUE vdate2,
|
1181
|
+
VALUE vepsa, VALUE vdpsi){
|
1182
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1183
|
+
|
1184
|
+
return DBL2NUM(iauEe00(NUM2DBL(vdate1), NUM2DBL(vdate2),
|
1185
|
+
NUM2DBL(vepsa), NUM2DBL(vdpsi)));
|
1186
|
+
}
|
1187
|
+
|
1188
|
+
static VALUE
|
1189
|
+
celes_s_ee00a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1190
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1191
|
+
|
1192
|
+
return DBL2NUM(iauEe00a(NUM2DBL(vdate1), NUM2DBL(vdate2)));
|
1193
|
+
}
|
1194
|
+
|
1195
|
+
static VALUE
|
1196
|
+
celes_s_ee00b(VALUE self, VALUE vdate1, VALUE vdate2){
|
1197
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1198
|
+
|
1199
|
+
return DBL2NUM(iauEe00b(NUM2DBL(vdate1), NUM2DBL(vdate2)));
|
1200
|
+
}
|
1201
|
+
|
1202
|
+
static VALUE
|
1203
|
+
celes_s_ee06a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1204
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1205
|
+
|
1206
|
+
return DBL2NUM(iauEe06a(NUM2DBL(vdate1), NUM2DBL(vdate2)));
|
1207
|
+
}
|
1208
|
+
|
1209
|
+
static VALUE
|
1210
|
+
celes_s_eect00(VALUE self, VALUE vdate1, VALUE vdate2){
|
1211
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1212
|
+
|
1213
|
+
return DBL2NUM(iauEect00(NUM2DBL(vdate1), NUM2DBL(vdate2)));
|
1214
|
+
}
|
1215
|
+
|
1216
|
+
static VALUE
|
1217
|
+
celes_s_eqeq94(VALUE self, VALUE vdate1, VALUE vdate2){
|
1218
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1219
|
+
|
1220
|
+
return DBL2NUM(iauEqeq94(NUM2DBL(vdate1), NUM2DBL(vdate2)));
|
1221
|
+
}
|
1222
|
+
|
1223
|
+
static VALUE
|
1224
|
+
celes_s_era00(VALUE self, VALUE vdj1, VALUE vdj2){
|
1225
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1226
|
+
|
1227
|
+
return DBL2NUM(iauEra00(NUM2DBL(vdj1), NUM2DBL(vdj2)));
|
1228
|
+
}
|
1229
|
+
|
1230
|
+
static VALUE
|
1231
|
+
celes_s_gmst00(VALUE self, VALUE vuta, VALUE vutb, VALUE vtta, VALUE vttb){
|
1232
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1233
|
+
|
1234
|
+
return DBL2NUM(iauGmst00(NUM2DBL(vuta), NUM2DBL(vutb),
|
1235
|
+
NUM2DBL(vtta), NUM2DBL(vttb)));
|
1236
|
+
}
|
1237
|
+
|
1238
|
+
static VALUE
|
1239
|
+
celes_s_gmst06(VALUE self, VALUE vuta, VALUE vutb, VALUE vtta, VALUE vttb){
|
1240
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1241
|
+
|
1242
|
+
return DBL2NUM(iauGmst06(NUM2DBL(vuta), NUM2DBL(vutb),
|
1243
|
+
NUM2DBL(vtta), NUM2DBL(vttb)));
|
1244
|
+
}
|
1245
|
+
|
1246
|
+
static VALUE
|
1247
|
+
celes_s_gmst82(VALUE self, VALUE vdj1, VALUE vdj2){
|
1248
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1249
|
+
|
1250
|
+
return DBL2NUM(iauGmst82(NUM2DBL(vdj1), NUM2DBL(vdj2)));
|
1251
|
+
}
|
1252
|
+
|
1253
|
+
static VALUE
|
1254
|
+
celes_s_gst00a(VALUE self, VALUE vuta, VALUE vutb, VALUE vtta, VALUE vttb){
|
1255
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1256
|
+
|
1257
|
+
return DBL2NUM(iauGst00a(NUM2DBL(vuta), NUM2DBL(vutb),
|
1258
|
+
NUM2DBL(vtta), NUM2DBL(vttb)));
|
1259
|
+
}
|
1260
|
+
|
1261
|
+
static VALUE
|
1262
|
+
celes_s_gst00b(VALUE self, VALUE vuta, VALUE vutb){
|
1263
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1264
|
+
|
1265
|
+
return DBL2NUM(iauGst00b(NUM2DBL(vuta), NUM2DBL(vutb)));
|
1266
|
+
}
|
1267
|
+
|
1268
|
+
static VALUE
|
1269
|
+
celes_s_gst06(VALUE self, VALUE vuta, VALUE vutb,
|
1270
|
+
VALUE vtta, VALUE vttb, VALUE vrnpb){
|
1271
|
+
double rnpb[3][3];
|
1272
|
+
|
1273
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1274
|
+
|
1275
|
+
cmat_cp33(vrnpb, rnpb);
|
1276
|
+
|
1277
|
+
return DBL2NUM(iauGst06(NUM2DBL(vuta), NUM2DBL(vutb),
|
1278
|
+
NUM2DBL(vtta), NUM2DBL(vttb), rnpb));
|
1279
|
+
}
|
1280
|
+
|
1281
|
+
static VALUE
|
1282
|
+
celes_s_gst06a(VALUE self, VALUE vuta, VALUE vutb, VALUE vtta, VALUE vttb){
|
1283
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1284
|
+
|
1285
|
+
return DBL2NUM(iauGst06a(NUM2DBL(vuta), NUM2DBL(vutb),
|
1286
|
+
NUM2DBL(vtta), NUM2DBL(vttb)));
|
1287
|
+
}
|
1288
|
+
|
1289
|
+
static VALUE
|
1290
|
+
celes_s_gst94(VALUE self, VALUE vuta, VALUE vutb){
|
1291
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1292
|
+
|
1293
|
+
return DBL2NUM(iauGst94(NUM2DBL(vuta), NUM2DBL(vutb)));
|
1294
|
+
}
|
1295
|
+
|
1296
|
+
static VALUE
|
1297
|
+
celes_s_epv00(VALUE self, VALUE vdate1, VALUE vdate2){
|
1298
|
+
int ret;
|
1299
|
+
double pvh[2][3], pvb[2][3];
|
1300
|
+
|
1301
|
+
ret = iauEpv00(NUM2DBL(vdate1), NUM2DBL(vdate2), pvh, pvb);
|
1302
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
1303
|
+
|
1304
|
+
return rb_ary_new3(2, vmat_new23(pvh), vmat_new23(pvb));
|
1305
|
+
}
|
1306
|
+
|
1307
|
+
static VALUE
|
1308
|
+
celes_s_plan94(VALUE self, VALUE vdate1, VALUE vdate2, VALUE vnp){
|
1309
|
+
int ret;
|
1310
|
+
double pv[2][3];
|
1311
|
+
|
1312
|
+
ret = iauPlan94(NUM2DBL(vdate1), NUM2DBL(vdate2), NUM2INT(vnp), pv);
|
1313
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
1314
|
+
|
1315
|
+
if(ret == -1)
|
1316
|
+
rb_raise(rb_eArgError, "illegal NP (outside 1-8)");
|
1317
|
+
|
1318
|
+
return vmat_new23(pv);
|
1319
|
+
}
|
1320
|
+
static VALUE
|
1321
|
+
celes_s_bi00(VALUE self){
|
1322
|
+
double dpsibi, depsbi, dra;
|
1323
|
+
|
1324
|
+
iauBi00(&dpsibi, &depsbi, &dra);
|
1325
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1326
|
+
|
1327
|
+
return rb_ary_new3(3, DBL2NUM(dpsibi), DBL2NUM(depsbi), DBL2NUM(dra));
|
1328
|
+
}
|
1329
|
+
|
1330
|
+
static VALUE
|
1331
|
+
celes_s_bp00(VALUE self, VALUE vdate1, VALUE vdate2){
|
1332
|
+
double rb[3][3], rp[3][3], rbp[3][3];
|
1333
|
+
|
1334
|
+
iauBp00(NUM2DBL(vdate1), NUM2DBL(vdate2), rb, rp, rbp);
|
1335
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1336
|
+
|
1337
|
+
return rb_ary_new3(3, vmat_new33(rb), vmat_new33(rp), vmat_new33(rbp));
|
1338
|
+
}
|
1339
|
+
|
1340
|
+
static VALUE
|
1341
|
+
celes_s_bp06(VALUE self, VALUE vdate1, VALUE vdate2){
|
1342
|
+
double rb[3][3], rp[3][3], rbp[3][3];
|
1343
|
+
|
1344
|
+
iauBp06(NUM2DBL(vdate1), NUM2DBL(vdate2), rb, rp, rbp);
|
1345
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1346
|
+
|
1347
|
+
return rb_ary_new3(3, vmat_new33(rb), vmat_new33(rp), vmat_new33(rbp));
|
1348
|
+
}
|
1349
|
+
|
1350
|
+
static VALUE
|
1351
|
+
celes_s_bpn2xy(VALUE self, VALUE vrbpn){
|
1352
|
+
double rbpn[3][3], x, y;
|
1353
|
+
|
1354
|
+
cmat_cp33(vrbpn, rbpn);
|
1355
|
+
iauBpn2xy(rbpn, &x, &y);
|
1356
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1357
|
+
|
1358
|
+
return rb_ary_new3(2, DBL2NUM(x), DBL2NUM(y));
|
1359
|
+
}
|
1360
|
+
|
1361
|
+
static VALUE
|
1362
|
+
celes_s_c2i00a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1363
|
+
double rc2i[3][3];
|
1364
|
+
|
1365
|
+
iauC2i00a(NUM2DBL(vdate1), NUM2DBL(vdate2), rc2i);
|
1366
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1367
|
+
|
1368
|
+
return vmat_new33(rc2i);
|
1369
|
+
}
|
1370
|
+
|
1371
|
+
static VALUE
|
1372
|
+
celes_s_c2i00b(VALUE self, VALUE vdate1, VALUE vdate2){
|
1373
|
+
double rc2i[3][3];
|
1374
|
+
|
1375
|
+
iauC2i00b(NUM2DBL(vdate1), NUM2DBL(vdate2), rc2i);
|
1376
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1377
|
+
|
1378
|
+
return vmat_new33(rc2i);
|
1379
|
+
}
|
1380
|
+
|
1381
|
+
static VALUE
|
1382
|
+
celes_s_c2i06a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1383
|
+
double rc2i[3][3];
|
1384
|
+
|
1385
|
+
iauC2i06a(NUM2DBL(vdate1), NUM2DBL(vdate2), rc2i);
|
1386
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1387
|
+
|
1388
|
+
return vmat_new33(rc2i);
|
1389
|
+
}
|
1390
|
+
|
1391
|
+
static VALUE
|
1392
|
+
celes_s_c2ibpn(VALUE self, VALUE vdate1, VALUE vdate2, VALUE vrbpn){
|
1393
|
+
double rbpn[3][3], rc2i[3][3];
|
1394
|
+
|
1395
|
+
cmat_cp33(vrbpn, rbpn);
|
1396
|
+
iauC2ibpn(NUM2DBL(vdate1), NUM2DBL(vdate2), rbpn, rc2i);
|
1397
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1398
|
+
|
1399
|
+
return vmat_new33(rc2i);
|
1400
|
+
}
|
1401
|
+
|
1402
|
+
static VALUE
|
1403
|
+
celes_s_c2ixy(VALUE self, VALUE vdate1, VALUE vdate2, VALUE vx, VALUE vy){
|
1404
|
+
double rc2i[3][3];
|
1405
|
+
|
1406
|
+
iauC2ixy(NUM2DBL(vdate1), NUM2DBL(vdate2),
|
1407
|
+
NUM2DBL(vx), NUM2DBL(vy), rc2i);
|
1408
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1409
|
+
|
1410
|
+
return vmat_new33(rc2i);
|
1411
|
+
}
|
1412
|
+
|
1413
|
+
static VALUE
|
1414
|
+
celes_s_c2ixys(VALUE self, VALUE vx, VALUE vy, VALUE vs){
|
1415
|
+
double rc2i[3][3];
|
1416
|
+
|
1417
|
+
iauC2ixys(NUM2DBL(vx), NUM2DBL(vy), NUM2DBL(vs), rc2i);
|
1418
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1419
|
+
|
1420
|
+
return vmat_new33(rc2i);
|
1421
|
+
}
|
1422
|
+
|
1423
|
+
static VALUE
|
1424
|
+
celes_s_c2t00a(VALUE self, VALUE vtta, VALUE vttb,
|
1425
|
+
VALUE vuta, VALUE vutb, VALUE vxp, VALUE vyp){
|
1426
|
+
double rc2t[3][3];
|
1427
|
+
|
1428
|
+
iauC2t00a(NUM2DBL(vtta), NUM2DBL(vttb), NUM2DBL(vuta), NUM2DBL(vutb),
|
1429
|
+
NUM2DBL(vxp), NUM2DBL(vyp), rc2t);
|
1430
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1431
|
+
|
1432
|
+
return vmat_new33(rc2t);
|
1433
|
+
}
|
1434
|
+
|
1435
|
+
static VALUE
|
1436
|
+
celes_s_c2t00b(VALUE self, VALUE vtta, VALUE vttb,
|
1437
|
+
VALUE vuta, VALUE vutb, VALUE vxp, VALUE vyp){
|
1438
|
+
double rc2t[3][3];
|
1439
|
+
|
1440
|
+
iauC2t00b(NUM2DBL(vtta), NUM2DBL(vttb), NUM2DBL(vuta), NUM2DBL(vutb),
|
1441
|
+
NUM2DBL(vxp), NUM2DBL(vyp), rc2t);
|
1442
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1443
|
+
|
1444
|
+
return vmat_new33(rc2t);
|
1445
|
+
}
|
1446
|
+
|
1447
|
+
static VALUE
|
1448
|
+
celes_s_c2t06a(VALUE self, VALUE vtta, VALUE vttb,
|
1449
|
+
VALUE vuta, VALUE vutb, VALUE vxp, VALUE vyp){
|
1450
|
+
double rc2t[3][3];
|
1451
|
+
|
1452
|
+
iauC2t06a(NUM2DBL(vtta), NUM2DBL(vttb), NUM2DBL(vuta), NUM2DBL(vutb),
|
1453
|
+
NUM2DBL(vxp), NUM2DBL(vyp), rc2t);
|
1454
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1455
|
+
|
1456
|
+
return vmat_new33(rc2t);
|
1457
|
+
}
|
1458
|
+
|
1459
|
+
static VALUE
|
1460
|
+
celes_s_c2tcio(VALUE self, VALUE vrc2i, VALUE vera, VALUE vrpom){
|
1461
|
+
double rc2i[3][3], rpom[3][3], rc2t[3][3];
|
1462
|
+
|
1463
|
+
cmat_cp33(vrc2i, rc2i);
|
1464
|
+
cmat_cp33(vrpom, rpom);
|
1465
|
+
iauC2tcio(rc2i, NUM2DBL(vera), rpom, rc2t);
|
1466
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1467
|
+
|
1468
|
+
return vmat_new33(rc2t);
|
1469
|
+
}
|
1470
|
+
|
1471
|
+
static VALUE
|
1472
|
+
celes_s_c2teqx(VALUE self, VALUE vrbpn, VALUE vgst, VALUE vrpom){
|
1473
|
+
double rbpn[3][3], rpom[3][3], rc2t[3][3];
|
1474
|
+
|
1475
|
+
cmat_cp33(vrbpn, rbpn);
|
1476
|
+
cmat_cp33(vrpom, rpom);
|
1477
|
+
iauC2teqx(rbpn, NUM2DBL(vgst), rpom, rc2t);
|
1478
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1479
|
+
|
1480
|
+
return vmat_new33(rc2t);
|
1481
|
+
}
|
1482
|
+
|
1483
|
+
static VALUE
|
1484
|
+
celes_s_c2tpe(VALUE self, VALUE vtta, VALUE vttb, VALUE vuta, VALUE vutb,
|
1485
|
+
VALUE vdpsi, VALUE vdeps, VALUE vxp, VALUE vyp){
|
1486
|
+
double rc2t[3][3];
|
1487
|
+
|
1488
|
+
iauC2tpe(NUM2DBL(vtta), NUM2DBL(vttb), NUM2DBL(vuta), NUM2DBL(vutb),
|
1489
|
+
NUM2DBL(vdpsi), NUM2DBL(vdeps), NUM2DBL(vxp), NUM2DBL(vyp),
|
1490
|
+
rc2t);
|
1491
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1492
|
+
|
1493
|
+
return vmat_new33(rc2t);
|
1494
|
+
}
|
1495
|
+
|
1496
|
+
static VALUE
|
1497
|
+
celes_s_c2txy(VALUE self, VALUE vtta, VALUE vttb, VALUE vuta, VALUE vutb,
|
1498
|
+
VALUE vx, VALUE vy, VALUE vxp, VALUE vyp){
|
1499
|
+
double rc2t[3][3];
|
1500
|
+
|
1501
|
+
iauC2txy(NUM2DBL(vtta), NUM2DBL(vttb), NUM2DBL(vuta), NUM2DBL(vutb),
|
1502
|
+
NUM2DBL(vx), NUM2DBL(vy), NUM2DBL(vxp), NUM2DBL(vyp), rc2t);
|
1503
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1504
|
+
|
1505
|
+
return vmat_new33(rc2t);
|
1506
|
+
}
|
1507
|
+
|
1508
|
+
static VALUE
|
1509
|
+
celes_s_eo06a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1510
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1511
|
+
|
1512
|
+
return DBL2NUM(iauEo06a(NUM2DBL(vdate1), NUM2DBL(vdate2)));
|
1513
|
+
}
|
1514
|
+
|
1515
|
+
static VALUE
|
1516
|
+
celes_s_eors(VALUE self, VALUE vrnpb, VALUE vs){
|
1517
|
+
double rnpb[3][3];
|
1518
|
+
|
1519
|
+
cmat_cp33(vrnpb, rnpb);
|
1520
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1521
|
+
|
1522
|
+
return DBL2NUM(iauEors(rnpb, NUM2DBL(vs)));
|
1523
|
+
}
|
1524
|
+
|
1525
|
+
static VALUE
|
1526
|
+
celes_s_fw2m(VALUE self, VALUE vgamb, VALUE vphib, VALUE vpsi, VALUE veps){
|
1527
|
+
double r[3][3];
|
1528
|
+
|
1529
|
+
iauFw2m(NUM2DBL(vgamb), NUM2DBL(vphib),
|
1530
|
+
NUM2DBL(vpsi), NUM2DBL(veps), r);
|
1531
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1532
|
+
|
1533
|
+
return vmat_new33(r);
|
1534
|
+
}
|
1535
|
+
|
1536
|
+
static VALUE
|
1537
|
+
celes_s_fw2xy(VALUE self, VALUE vgamb,
|
1538
|
+
VALUE vphib, VALUE vpsi, VALUE veps){
|
1539
|
+
double x, y;
|
1540
|
+
|
1541
|
+
iauFw2xy(NUM2DBL(vgamb), NUM2DBL(vphib),
|
1542
|
+
NUM2DBL(vpsi), NUM2DBL(veps), &x, &y);
|
1543
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1544
|
+
|
1545
|
+
return rb_ary_new3(2, DBL2NUM(x), DBL2NUM(y));
|
1546
|
+
}
|
1547
|
+
|
1548
|
+
static VALUE
|
1549
|
+
celes_s_num00a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1550
|
+
double rmatn[3][3];
|
1551
|
+
|
1552
|
+
iauNum00a(NUM2DBL(vdate1), NUM2DBL(vdate2), rmatn);
|
1553
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1554
|
+
|
1555
|
+
return vmat_new33(rmatn);
|
1556
|
+
}
|
1557
|
+
|
1558
|
+
static VALUE
|
1559
|
+
celes_s_num00b(VALUE self, VALUE vdate1, VALUE vdate2){
|
1560
|
+
double rmatn[3][3];
|
1561
|
+
|
1562
|
+
iauNum00b(NUM2DBL(vdate1), NUM2DBL(vdate2), rmatn);
|
1563
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1564
|
+
|
1565
|
+
return vmat_new33(rmatn);
|
1566
|
+
}
|
1567
|
+
|
1568
|
+
static VALUE
|
1569
|
+
celes_s_num06a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1570
|
+
double rmatn[3][3];
|
1571
|
+
|
1572
|
+
iauNum06a(NUM2DBL(vdate1), NUM2DBL(vdate2), rmatn);
|
1573
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1574
|
+
|
1575
|
+
return vmat_new33(rmatn);
|
1576
|
+
}
|
1577
|
+
|
1578
|
+
static VALUE
|
1579
|
+
celes_s_numat(VALUE self, VALUE vepsa, VALUE vdpsi, VALUE vdeps){
|
1580
|
+
double rmatn[3][3];
|
1581
|
+
|
1582
|
+
iauNumat(NUM2DBL(vepsa), NUM2DBL(vdpsi), NUM2DBL(vdeps), rmatn);
|
1583
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1584
|
+
|
1585
|
+
return vmat_new33(rmatn);
|
1586
|
+
}
|
1587
|
+
|
1588
|
+
static VALUE
|
1589
|
+
celes_s_nut00a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1590
|
+
double dpsi, deps;
|
1591
|
+
|
1592
|
+
iauNut00a(NUM2DBL(vdate1), NUM2DBL(vdate2), &dpsi, &deps);
|
1593
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1594
|
+
|
1595
|
+
return rb_ary_new3(2, DBL2NUM(dpsi), DBL2NUM(deps));
|
1596
|
+
}
|
1597
|
+
|
1598
|
+
static VALUE
|
1599
|
+
celes_s_nut00b(VALUE self, VALUE vdate1, VALUE vdate2){
|
1600
|
+
double dpsi, deps;
|
1601
|
+
|
1602
|
+
iauNut00b(NUM2DBL(vdate1), NUM2DBL(vdate2), &dpsi, &deps);
|
1603
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1604
|
+
|
1605
|
+
return rb_ary_new3(2, DBL2NUM(dpsi), DBL2NUM(deps));
|
1606
|
+
}
|
1607
|
+
|
1608
|
+
static VALUE
|
1609
|
+
celes_s_nut06a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1610
|
+
double dpsi, deps;
|
1611
|
+
|
1612
|
+
iauNut06a(NUM2DBL(vdate1), NUM2DBL(vdate2), &dpsi, &deps);
|
1613
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1614
|
+
|
1615
|
+
return rb_ary_new3(2, DBL2NUM(dpsi), DBL2NUM(deps));
|
1616
|
+
}
|
1617
|
+
|
1618
|
+
static VALUE
|
1619
|
+
celes_s_nut80(VALUE self, VALUE vdate1, VALUE vdate2){
|
1620
|
+
double dpsi, deps;
|
1621
|
+
|
1622
|
+
iauNut80(NUM2DBL(vdate1), NUM2DBL(vdate2), &dpsi, &deps);
|
1623
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1624
|
+
|
1625
|
+
return rb_ary_new3(2, DBL2NUM(dpsi), DBL2NUM(deps));
|
1626
|
+
}
|
1627
|
+
|
1628
|
+
static VALUE
|
1629
|
+
celes_s_nutm80(VALUE self, VALUE vdate1, VALUE vdate2){
|
1630
|
+
double rmatn[3][3];
|
1631
|
+
|
1632
|
+
iauNutm80(NUM2DBL(vdate1), NUM2DBL(vdate2), rmatn);
|
1633
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1634
|
+
|
1635
|
+
return vmat_new33(rmatn);
|
1636
|
+
}
|
1637
|
+
|
1638
|
+
static VALUE
|
1639
|
+
celes_s_obl06(VALUE self, VALUE vdate1, VALUE vdate2){
|
1640
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1641
|
+
|
1642
|
+
return DBL2NUM(iauObl06(NUM2DBL(vdate1), NUM2DBL(vdate2)));
|
1643
|
+
}
|
1644
|
+
|
1645
|
+
static VALUE
|
1646
|
+
celes_s_obl80(VALUE self, VALUE vdate1, VALUE vdate2){
|
1647
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1648
|
+
|
1649
|
+
return DBL2NUM(iauObl80(NUM2DBL(vdate1), NUM2DBL(vdate2)));
|
1650
|
+
}
|
1651
|
+
|
1652
|
+
static VALUE
|
1653
|
+
celes_s_pb06(VALUE self, VALUE vdate1, VALUE vdate2){
|
1654
|
+
double bzeta, bz, btheta;
|
1655
|
+
|
1656
|
+
iauPb06(NUM2DBL(vdate1), NUM2DBL(vdate2), &bzeta, &bz, &btheta);
|
1657
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1658
|
+
|
1659
|
+
return rb_ary_new3(3, DBL2NUM(bzeta), DBL2NUM(bz), DBL2NUM(btheta));
|
1660
|
+
}
|
1661
|
+
|
1662
|
+
static VALUE
|
1663
|
+
celes_s_pfw06(VALUE self, VALUE vdate1, VALUE vdate2){
|
1664
|
+
double gamb, phib, psib, epsa;
|
1665
|
+
|
1666
|
+
iauPfw06(NUM2DBL(vdate1), NUM2DBL(vdate2), &gamb, &phib, &psib, &epsa);
|
1667
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1668
|
+
|
1669
|
+
return rb_ary_new3(4, DBL2NUM(gamb),
|
1670
|
+
DBL2NUM(phib), DBL2NUM(psib), DBL2NUM(epsa));
|
1671
|
+
}
|
1672
|
+
|
1673
|
+
static VALUE
|
1674
|
+
celes_s_pmat00(VALUE self, VALUE vdate1, VALUE vdate2){
|
1675
|
+
double rbp[3][3];
|
1676
|
+
|
1677
|
+
iauPmat00(NUM2DBL(vdate1), NUM2DBL(vdate2), rbp);
|
1678
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1679
|
+
|
1680
|
+
return vmat_new33(rbp);
|
1681
|
+
}
|
1682
|
+
|
1683
|
+
static VALUE
|
1684
|
+
celes_s_pmat06(VALUE self, VALUE vdate1, VALUE vdate2){
|
1685
|
+
double rbp[3][3];
|
1686
|
+
|
1687
|
+
iauPmat06(NUM2DBL(vdate1), NUM2DBL(vdate2), rbp);
|
1688
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1689
|
+
|
1690
|
+
return vmat_new33(rbp);
|
1691
|
+
}
|
1692
|
+
|
1693
|
+
static VALUE
|
1694
|
+
celes_s_pmat76(VALUE self, VALUE vdate1, VALUE vdate2){
|
1695
|
+
double rmatp[3][3];
|
1696
|
+
|
1697
|
+
iauPmat76(NUM2DBL(vdate1), NUM2DBL(vdate2), rmatp);
|
1698
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1699
|
+
|
1700
|
+
return vmat_new33(rmatp);
|
1701
|
+
}
|
1702
|
+
|
1703
|
+
static VALUE
|
1704
|
+
celes_s_pn00(VALUE self, VALUE vdate1, VALUE vdate2,
|
1705
|
+
VALUE vdpsi, VALUE vdeps){
|
1706
|
+
double epsa, rb[3][3], rp[3][3], rbp[3][3], rn[3][3], rbpn[3][3];
|
1707
|
+
|
1708
|
+
iauPn00(NUM2DBL(vdate1), NUM2DBL(vdate2),
|
1709
|
+
NUM2DBL(vdpsi), NUM2DBL(vdeps), &epsa,
|
1710
|
+
rb, rp, rbp, rn, rbpn);
|
1711
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1712
|
+
|
1713
|
+
return rb_ary_new3(6, DBL2NUM(epsa), vmat_new33(rb),
|
1714
|
+
vmat_new33(rp), vmat_new33(rbp), vmat_new33(rn), vmat_new33(rbpn));
|
1715
|
+
}
|
1716
|
+
|
1717
|
+
static VALUE
|
1718
|
+
celes_s_pn00a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1719
|
+
double dpsi, deps, epsa, rb[3][3],
|
1720
|
+
rp[3][3], rbp[3][3], rn[3][3], rbpn[3][3];
|
1721
|
+
|
1722
|
+
iauPn00a(NUM2DBL(vdate1), NUM2DBL(vdate2), &dpsi, &deps, &epsa,
|
1723
|
+
rb, rp, rbp, rn, rbpn);
|
1724
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1725
|
+
|
1726
|
+
return rb_ary_new3(8, DBL2NUM(dpsi), DBL2NUM(deps), DBL2NUM(epsa),
|
1727
|
+
vmat_new33(rb), vmat_new33(rp), vmat_new33(rbp),
|
1728
|
+
vmat_new33(rn), vmat_new33(rbpn));
|
1729
|
+
}
|
1730
|
+
|
1731
|
+
static VALUE
|
1732
|
+
celes_s_pn00b(VALUE self, VALUE vdate1, VALUE vdate2){
|
1733
|
+
double dpsi, deps, epsa, rb[3][3],
|
1734
|
+
rp[3][3], rbp[3][3], rn[3][3], rbpn[3][3];
|
1735
|
+
|
1736
|
+
iauPn00b(NUM2DBL(vdate1), NUM2DBL(vdate2), &dpsi, &deps, &epsa,
|
1737
|
+
rb, rp, rbp, rn, rbpn);
|
1738
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1739
|
+
|
1740
|
+
return rb_ary_new3(8, DBL2NUM(dpsi), DBL2NUM(deps), DBL2NUM(epsa),
|
1741
|
+
vmat_new33(rb), vmat_new33(rp), vmat_new33(rbp),
|
1742
|
+
vmat_new33(rn), vmat_new33(rbpn));
|
1743
|
+
}
|
1744
|
+
|
1745
|
+
static VALUE
|
1746
|
+
celes_s_pn06(VALUE self, VALUE vdate1, VALUE vdate2,
|
1747
|
+
VALUE vdpsi, VALUE vdeps){
|
1748
|
+
double epsa, rb[3][3], rp[3][3], rbp[3][3], rn[3][3], rbpn[3][3];
|
1749
|
+
|
1750
|
+
iauPn06(NUM2DBL(vdate1), NUM2DBL(vdate2),
|
1751
|
+
NUM2DBL(vdpsi), NUM2DBL(vdeps), &epsa,
|
1752
|
+
rb, rp, rbp, rn, rbpn);
|
1753
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1754
|
+
|
1755
|
+
return rb_ary_new3(6, DBL2NUM(epsa), vmat_new33(rb),
|
1756
|
+
vmat_new33(rp), vmat_new33(rbp), vmat_new33(rn), vmat_new33(rbpn));
|
1757
|
+
}
|
1758
|
+
|
1759
|
+
static VALUE
|
1760
|
+
celes_s_pn06a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1761
|
+
double dpsi, deps, epsa, rb[3][3],
|
1762
|
+
rp[3][3], rbp[3][3], rn[3][3], rbpn[3][3];
|
1763
|
+
|
1764
|
+
iauPn06a(NUM2DBL(vdate1), NUM2DBL(vdate2), &dpsi, &deps, &epsa,
|
1765
|
+
rb, rp, rbp, rn, rbpn);
|
1766
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1767
|
+
|
1768
|
+
return rb_ary_new3(8, DBL2NUM(dpsi), DBL2NUM(deps), DBL2NUM(epsa),
|
1769
|
+
vmat_new33(rb), vmat_new33(rp), vmat_new33(rbp),
|
1770
|
+
vmat_new33(rn), vmat_new33(rbpn));
|
1771
|
+
}
|
1772
|
+
|
1773
|
+
static VALUE
|
1774
|
+
celes_s_pnm00a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1775
|
+
double rbpn[3][3];
|
1776
|
+
|
1777
|
+
iauPnm00a(NUM2DBL(vdate1), NUM2DBL(vdate2), rbpn);
|
1778
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1779
|
+
|
1780
|
+
return vmat_new33(rbpn);
|
1781
|
+
}
|
1782
|
+
|
1783
|
+
static VALUE
|
1784
|
+
celes_s_pnm00b(VALUE self, VALUE vdate1, VALUE vdate2){
|
1785
|
+
double rbpn[3][3];
|
1786
|
+
|
1787
|
+
iauPnm00b(NUM2DBL(vdate1), NUM2DBL(vdate2), rbpn);
|
1788
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1789
|
+
|
1790
|
+
return vmat_new33(rbpn);
|
1791
|
+
}
|
1792
|
+
|
1793
|
+
static VALUE
|
1794
|
+
celes_s_pnm06a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1795
|
+
double rnpb[3][3];
|
1796
|
+
|
1797
|
+
iauPnm06a(NUM2DBL(vdate1), NUM2DBL(vdate2), rnpb);
|
1798
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1799
|
+
|
1800
|
+
return vmat_new33(rnpb);
|
1801
|
+
}
|
1802
|
+
|
1803
|
+
static VALUE
|
1804
|
+
celes_s_pnm80(VALUE self, VALUE vdate1, VALUE vdate2){
|
1805
|
+
double rmatpn[3][3];
|
1806
|
+
|
1807
|
+
iauPnm80(NUM2DBL(vdate1), NUM2DBL(vdate2), rmatpn);
|
1808
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1809
|
+
|
1810
|
+
return vmat_new33(rmatpn);
|
1811
|
+
}
|
1812
|
+
|
1813
|
+
static VALUE
|
1814
|
+
celes_s_p06e(VALUE self, VALUE vdate1, VALUE vdate2){
|
1815
|
+
double eps0, psia, oma, bpa, bqa, pia, bpia,
|
1816
|
+
epsa, chia, za, zetaa, thetaa, pa, gam, phi, psi;
|
1817
|
+
|
1818
|
+
iauP06e(NUM2DBL(vdate1), NUM2DBL(vdate2), &eps0, &psia,
|
1819
|
+
&oma, &bpa, &bqa, &pia, &bpia, &epsa, &chia, &za,
|
1820
|
+
&zetaa, &thetaa, &pa, &gam, &phi, &psi);
|
1821
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1822
|
+
|
1823
|
+
return rb_ary_new3(16, DBL2NUM(eps0), DBL2NUM(psia),
|
1824
|
+
DBL2NUM(oma), DBL2NUM(bpa), DBL2NUM(bqa), DBL2NUM(pia),
|
1825
|
+
DBL2NUM(bpia), DBL2NUM(epsa), DBL2NUM(chia), DBL2NUM(za),
|
1826
|
+
DBL2NUM(zetaa), DBL2NUM(thetaa), DBL2NUM(pa), DBL2NUM(gam),
|
1827
|
+
DBL2NUM(phi), DBL2NUM(psi));
|
1828
|
+
}
|
1829
|
+
|
1830
|
+
static VALUE
|
1831
|
+
celes_s_pom00(VALUE self, VALUE vxp, VALUE vyp, VALUE vsp){
|
1832
|
+
double rpom[3][3];
|
1833
|
+
|
1834
|
+
iauPom00(NUM2DBL(vxp), NUM2DBL(vyp), NUM2DBL(vsp), rpom);
|
1835
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1836
|
+
|
1837
|
+
return vmat_new33(rpom);
|
1838
|
+
}
|
1839
|
+
|
1840
|
+
static VALUE
|
1841
|
+
celes_s_pr00(VALUE self, VALUE vdate1, VALUE vdate2){
|
1842
|
+
double dpsipr, depspr;
|
1843
|
+
|
1844
|
+
iauPr00(NUM2DBL(vdate1), NUM2DBL(vdate2), &dpsipr, &depspr);
|
1845
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1846
|
+
|
1847
|
+
return rb_ary_new3(2, DBL2NUM(dpsipr), DBL2NUM(depspr));
|
1848
|
+
}
|
1849
|
+
|
1850
|
+
static VALUE
|
1851
|
+
celes_s_prec76(VALUE self, VALUE vep01, VALUE vep02,
|
1852
|
+
VALUE vep11, VALUE vep12){
|
1853
|
+
double zeta, z, theta;
|
1854
|
+
|
1855
|
+
iauPrec76(NUM2DBL(vep01), NUM2DBL(vep02),
|
1856
|
+
NUM2DBL(vep11), NUM2DBL(vep12), &zeta, &z, &theta);
|
1857
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1858
|
+
|
1859
|
+
return rb_ary_new3(3, DBL2NUM(zeta), DBL2NUM(z), DBL2NUM(theta));
|
1860
|
+
}
|
1861
|
+
|
1862
|
+
static VALUE
|
1863
|
+
celes_s_s00(VALUE self, VALUE vdate1, VALUE vdate2, VALUE vx, VALUE vy){
|
1864
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1865
|
+
|
1866
|
+
return DBL2NUM(iauS00(NUM2DBL(vdate1), NUM2DBL(vdate2),
|
1867
|
+
NUM2DBL(vx), NUM2DBL(vy)));
|
1868
|
+
}
|
1869
|
+
|
1870
|
+
static VALUE
|
1871
|
+
celes_s_s00a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1872
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1873
|
+
|
1874
|
+
return DBL2NUM(iauS00a(NUM2DBL(vdate1), NUM2DBL(vdate2)));
|
1875
|
+
}
|
1876
|
+
|
1877
|
+
static VALUE
|
1878
|
+
celes_s_s00b(VALUE self, VALUE vdate1, VALUE vdate2){
|
1879
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1880
|
+
|
1881
|
+
return DBL2NUM(iauS00b(NUM2DBL(vdate1), NUM2DBL(vdate2)));
|
1882
|
+
}
|
1883
|
+
|
1884
|
+
static VALUE
|
1885
|
+
celes_s_s06(VALUE self, VALUE vdate1, VALUE vdate2, VALUE vx, VALUE vy){
|
1886
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1887
|
+
|
1888
|
+
return DBL2NUM(iauS06(NUM2DBL(vdate1), NUM2DBL(vdate2),
|
1889
|
+
NUM2DBL(vx), NUM2DBL(vy)));
|
1890
|
+
}
|
1891
|
+
|
1892
|
+
static VALUE
|
1893
|
+
celes_s_s06a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1894
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1895
|
+
|
1896
|
+
return DBL2NUM(iauS06a(NUM2DBL(vdate1), NUM2DBL(vdate2)));
|
1897
|
+
}
|
1898
|
+
|
1899
|
+
static VALUE
|
1900
|
+
celes_s_sp00(VALUE self, VALUE vdate1, VALUE vdate2){
|
1901
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1902
|
+
|
1903
|
+
return DBL2NUM(iauSp00(NUM2DBL(vdate1), NUM2DBL(vdate2)));
|
1904
|
+
}
|
1905
|
+
|
1906
|
+
static VALUE
|
1907
|
+
celes_s_xy06(VALUE self, VALUE vdate1, VALUE vdate2){
|
1908
|
+
double x, y;
|
1909
|
+
|
1910
|
+
iauXy06(NUM2DBL(vdate1), NUM2DBL(vdate2), &x, &y);
|
1911
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1912
|
+
|
1913
|
+
return rb_ary_new3(2, DBL2NUM(x), DBL2NUM(y));
|
1914
|
+
}
|
1915
|
+
|
1916
|
+
static VALUE
|
1917
|
+
celes_s_xys00a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1918
|
+
double x, y, s;
|
1919
|
+
|
1920
|
+
iauXys00a(NUM2DBL(vdate1), NUM2DBL(vdate2), &x, &y, &s);
|
1921
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1922
|
+
|
1923
|
+
return rb_ary_new3(3, DBL2NUM(x), DBL2NUM(y), DBL2NUM(s));
|
1924
|
+
}
|
1925
|
+
|
1926
|
+
static VALUE
|
1927
|
+
celes_s_xys00b(VALUE self, VALUE vdate1, VALUE vdate2){
|
1928
|
+
double x, y, s;
|
1929
|
+
|
1930
|
+
iauXys00b(NUM2DBL(vdate1), NUM2DBL(vdate2), &x, &y, &s);
|
1931
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1932
|
+
|
1933
|
+
return rb_ary_new3(3, DBL2NUM(x), DBL2NUM(y), DBL2NUM(s));
|
1934
|
+
}
|
1935
|
+
|
1936
|
+
static VALUE
|
1937
|
+
celes_s_xys06a(VALUE self, VALUE vdate1, VALUE vdate2){
|
1938
|
+
double x, y, s;
|
1939
|
+
|
1940
|
+
iauXys06a(NUM2DBL(vdate1), NUM2DBL(vdate2), &x, &y, &s);
|
1941
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1942
|
+
|
1943
|
+
return rb_ary_new3(3, DBL2NUM(x), DBL2NUM(y), DBL2NUM(s));
|
1944
|
+
}
|
1945
|
+
|
1946
|
+
static VALUE
|
1947
|
+
celes_s_fad03(VALUE self, VALUE vt){
|
1948
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1949
|
+
|
1950
|
+
return DBL2NUM(iauFad03(NUM2DBL(vt)));
|
1951
|
+
}
|
1952
|
+
|
1953
|
+
static VALUE
|
1954
|
+
celes_s_fae03(VALUE self, VALUE vt){
|
1955
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1956
|
+
|
1957
|
+
return DBL2NUM(iauFae03(NUM2DBL(vt)));
|
1958
|
+
}
|
1959
|
+
|
1960
|
+
static VALUE
|
1961
|
+
celes_s_faf03(VALUE self, VALUE vt){
|
1962
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1963
|
+
|
1964
|
+
return DBL2NUM(iauFaf03(NUM2DBL(vt)));
|
1965
|
+
}
|
1966
|
+
|
1967
|
+
static VALUE
|
1968
|
+
celes_s_faju03(VALUE self, VALUE vt){
|
1969
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1970
|
+
|
1971
|
+
return DBL2NUM(iauFaju03(NUM2DBL(vt)));
|
1972
|
+
}
|
1973
|
+
|
1974
|
+
static VALUE
|
1975
|
+
celes_s_fal03(VALUE self, VALUE vt){
|
1976
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1977
|
+
|
1978
|
+
return DBL2NUM(iauFal03(NUM2DBL(vt)));
|
1979
|
+
}
|
1980
|
+
|
1981
|
+
static VALUE
|
1982
|
+
celes_s_falp03(VALUE self, VALUE vt){
|
1983
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1984
|
+
|
1985
|
+
return DBL2NUM(iauFalp03(NUM2DBL(vt)));
|
1986
|
+
}
|
1987
|
+
|
1988
|
+
static VALUE
|
1989
|
+
celes_s_fama03(VALUE self, VALUE vt){
|
1990
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1991
|
+
|
1992
|
+
return DBL2NUM(iauFama03(NUM2DBL(vt)));
|
1993
|
+
}
|
1994
|
+
|
1995
|
+
static VALUE
|
1996
|
+
celes_s_fame03(VALUE self, VALUE vt){
|
1997
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
1998
|
+
|
1999
|
+
return DBL2NUM(iauFame03(NUM2DBL(vt)));
|
2000
|
+
}
|
2001
|
+
|
2002
|
+
static VALUE
|
2003
|
+
celes_s_fane03(VALUE self, VALUE vt){
|
2004
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
2005
|
+
|
2006
|
+
return DBL2NUM(iauFane03(NUM2DBL(vt)));
|
2007
|
+
}
|
2008
|
+
|
2009
|
+
static VALUE
|
2010
|
+
celes_s_faom03(VALUE self, VALUE vt){
|
2011
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
2012
|
+
|
2013
|
+
return DBL2NUM(iauFaom03(NUM2DBL(vt)));
|
2014
|
+
}
|
2015
|
+
|
2016
|
+
static VALUE
|
2017
|
+
celes_s_fapa03(VALUE self, VALUE vt){
|
2018
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
2019
|
+
|
2020
|
+
return DBL2NUM(iauFapa03(NUM2DBL(vt)));
|
2021
|
+
}
|
2022
|
+
|
2023
|
+
static VALUE
|
2024
|
+
celes_s_fasa03(VALUE self, VALUE vt){
|
2025
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
2026
|
+
|
2027
|
+
return DBL2NUM(iauFasa03(NUM2DBL(vt)));
|
2028
|
+
}
|
2029
|
+
|
2030
|
+
static VALUE
|
2031
|
+
celes_s_faur03(VALUE self, VALUE vt){
|
2032
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
2033
|
+
|
2034
|
+
return DBL2NUM(iauFaur03(NUM2DBL(vt)));
|
2035
|
+
}
|
2036
|
+
|
2037
|
+
static VALUE
|
2038
|
+
celes_s_fave03(VALUE self, VALUE vt){
|
2039
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
2040
|
+
|
2041
|
+
return DBL2NUM(iauFave03(NUM2DBL(vt)));
|
2042
|
+
}
|
2043
|
+
static VALUE
|
2044
|
+
celes_s_pvstar(VALUE self, VALUE vpv){
|
2045
|
+
int ret;
|
2046
|
+
double pv[2][3], ra, dec, pmr, pmd, px, rv;
|
2047
|
+
|
2048
|
+
cmat_cp23(vpv, pv);
|
2049
|
+
ret = iauPvstar(pv, &ra, &dec, &pmr, &pmd, &px, &rv);
|
2050
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
2051
|
+
|
2052
|
+
if(ret == -1)
|
2053
|
+
rb_raise(rb_eArgError, "superluminal speed");
|
2054
|
+
else if(ret == -2)
|
2055
|
+
rb_raise(rb_eArgError, "null position vector");
|
2056
|
+
|
2057
|
+
return rb_ary_new3(6, DBL2NUM(ra), DBL2NUM(dec),
|
2058
|
+
DBL2NUM(pmr), DBL2NUM(pmd), DBL2NUM(px), DBL2NUM(rv));
|
2059
|
+
}
|
2060
|
+
|
2061
|
+
static VALUE
|
2062
|
+
celes_s_starpv(VALUE self, VALUE vra, VALUE vdec,
|
2063
|
+
VALUE vpmr, VALUE vpmd, VALUE vpx, VALUE vrv){
|
2064
|
+
int ret;
|
2065
|
+
double pv[2][3];
|
2066
|
+
|
2067
|
+
ret = iauStarpv(NUM2DBL(vra), NUM2DBL(vdec), NUM2DBL(vpmr),
|
2068
|
+
NUM2DBL(vpmd), NUM2DBL(vpx), NUM2DBL(vrv), pv);
|
2069
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
2070
|
+
|
2071
|
+
return vmat_new23(pv);
|
2072
|
+
}
|
2073
|
+
static VALUE
|
2074
|
+
celes_s_fk52h(VALUE self, VALUE vr5, VALUE vd5,
|
2075
|
+
VALUE vdr5, VALUE vdd5, VALUE vpx5, VALUE vrv5){
|
2076
|
+
double rh, dh, drh, ddh, pxh, rvh;
|
2077
|
+
|
2078
|
+
iauFk52h(NUM2DBL(vr5), NUM2DBL(vd5), NUM2DBL(vdr5),
|
2079
|
+
NUM2DBL(vdd5), NUM2DBL(vpx5), NUM2DBL(vrv5),
|
2080
|
+
&rh, &dh, &drh, &ddh, &pxh, &rvh);
|
2081
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
2082
|
+
|
2083
|
+
return rb_ary_new3(6, DBL2NUM(rh), DBL2NUM(dh),
|
2084
|
+
DBL2NUM(drh), DBL2NUM(ddh), DBL2NUM(pxh), DBL2NUM(rvh));
|
2085
|
+
}
|
2086
|
+
|
2087
|
+
static VALUE
|
2088
|
+
celes_s_fk5hip(VALUE self){
|
2089
|
+
double r5h[3][3], s5h[3];
|
2090
|
+
|
2091
|
+
iauFk5hip(r5h, s5h);
|
2092
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
2093
|
+
|
2094
|
+
return rb_ary_new3(2, vmat_new33(r5h), vvec_new(s5h));
|
2095
|
+
}
|
2096
|
+
|
2097
|
+
static VALUE
|
2098
|
+
celes_s_fk5hz(VALUE self, VALUE vr5, VALUE vd5,
|
2099
|
+
VALUE vdate1, VALUE vdate2){
|
2100
|
+
double rh, dh;
|
2101
|
+
|
2102
|
+
iauFk5hz(NUM2DBL(vr5), NUM2DBL(vd5),
|
2103
|
+
NUM2DBL(vdate1), NUM2DBL(vdate2), &rh, &dh);
|
2104
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
2105
|
+
|
2106
|
+
return rb_ary_new3(2, DBL2NUM(rh), DBL2NUM(dh));
|
2107
|
+
}
|
2108
|
+
|
2109
|
+
static VALUE
|
2110
|
+
celes_s_h2fk5(VALUE self, VALUE vrh, VALUE vdh,
|
2111
|
+
VALUE vdrh, VALUE vddh, VALUE vpxh, VALUE vrvh){
|
2112
|
+
double r5, d5, dr5, dd5, px5, rv5;
|
2113
|
+
|
2114
|
+
iauH2fk5(NUM2DBL(vrh), NUM2DBL(vdh), NUM2DBL(vdrh),
|
2115
|
+
NUM2DBL(vddh), NUM2DBL(vpxh), NUM2DBL(vrvh),
|
2116
|
+
&r5, &d5, &dr5, &dd5, &px5, &rv5);
|
2117
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
2118
|
+
|
2119
|
+
return rb_ary_new3(6, DBL2NUM(r5), DBL2NUM(d5),
|
2120
|
+
DBL2NUM(dr5), DBL2NUM(dd5), DBL2NUM(px5), DBL2NUM(rv5));
|
2121
|
+
}
|
2122
|
+
|
2123
|
+
static VALUE
|
2124
|
+
celes_s_hfk5z(VALUE self, VALUE vrh, VALUE vdh,
|
2125
|
+
VALUE vdate1, VALUE vdate2){
|
2126
|
+
double r5, d5, dr5, dd5;
|
2127
|
+
|
2128
|
+
iauHfk5z(NUM2DBL(vrh), NUM2DBL(vdh), NUM2DBL(vdate1), NUM2DBL(vdate2),
|
2129
|
+
&r5, &d5, &dr5, &dd5);
|
2130
|
+
rb_ivar_set(self, id_status, INT2FIX(0));
|
2131
|
+
|
2132
|
+
return rb_ary_new3(4, DBL2NUM(r5), DBL2NUM(d5),
|
2133
|
+
DBL2NUM(dr5), DBL2NUM(dd5));
|
2134
|
+
}
|
2135
|
+
|
2136
|
+
static VALUE
|
2137
|
+
celes_s_starpm(VALUE self, VALUE vra1, VALUE vdec1,
|
2138
|
+
VALUE vpmr1, VALUE vpmd1, VALUE vpx1, VALUE vrv1,
|
2139
|
+
VALUE vep1a, VALUE vep1b, VALUE vep2a, VALUE vep2b){
|
2140
|
+
int ret;
|
2141
|
+
double ra2, dec2, pmr2, pmd2, px2, rv2;
|
2142
|
+
|
2143
|
+
ret = iauStarpm(NUM2DBL(vra1), NUM2DBL(vdec1),
|
2144
|
+
NUM2DBL(vpmr1), NUM2DBL(vpmd1), NUM2DBL(vpx1), NUM2DBL(vrv1),
|
2145
|
+
NUM2DBL(vep1a), NUM2DBL(vep1b), NUM2DBL(vep2a), NUM2DBL(vep2b),
|
2146
|
+
&ra2, &dec2, &pmr2, &pmd2, &px2, &rv2);
|
2147
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
2148
|
+
|
2149
|
+
if(ret == -1)
|
2150
|
+
rb_raise(rb_eArgError, "system error");
|
2151
|
+
|
2152
|
+
return rb_ary_new3(6,
|
2153
|
+
DBL2NUM(ra2), DBL2NUM(dec2), DBL2NUM(pmr2),
|
2154
|
+
DBL2NUM(pmd2), DBL2NUM(px2), DBL2NUM(rv2));
|
2155
|
+
}
|
2156
|
+
static VALUE
|
2157
|
+
celes_s_eform(VALUE self, VALUE vn){
|
2158
|
+
int ret;
|
2159
|
+
double a, f;
|
2160
|
+
|
2161
|
+
ret = iauEform(NUM2INT(vn), &a, &f);
|
2162
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
2163
|
+
|
2164
|
+
if(ret == -1)
|
2165
|
+
rb_raise(rb_eArgError, "illegal identifier");
|
2166
|
+
|
2167
|
+
return rb_ary_new3(2, DBL2NUM(a), DBL2NUM(f));
|
2168
|
+
}
|
2169
|
+
|
2170
|
+
static VALUE
|
2171
|
+
celes_s_gc2gd(VALUE self, VALUE vn, VALUE vxyz){
|
2172
|
+
int ret;
|
2173
|
+
double xyz[3], elong, phi, height;
|
2174
|
+
|
2175
|
+
cvec_cp(vxyz, xyz);
|
2176
|
+
ret = iauGc2gd(NUM2INT(vn), xyz, &elong, &phi, &height);
|
2177
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
2178
|
+
|
2179
|
+
if(ret == -1)
|
2180
|
+
rb_raise(rb_eArgError, "illegal identifier");
|
2181
|
+
else if(ret == -2)
|
2182
|
+
rb_raise(rb_eArgError, "internal error");
|
2183
|
+
|
2184
|
+
return rb_ary_new3(3, DBL2NUM(elong), DBL2NUM(phi), DBL2NUM(height));
|
2185
|
+
}
|
2186
|
+
|
2187
|
+
static VALUE
|
2188
|
+
celes_s_gc2gde(VALUE self, VALUE va, VALUE vf, VALUE vxyz){
|
2189
|
+
int ret;
|
2190
|
+
double xyz[3], elong, phi, height;
|
2191
|
+
|
2192
|
+
cvec_cp(vxyz, xyz);
|
2193
|
+
ret = iauGc2gde(NUM2DBL(va), NUM2DBL(vf), xyz, &elong, &phi, &height);
|
2194
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
2195
|
+
|
2196
|
+
if(ret == -1)
|
2197
|
+
rb_raise(rb_eArgError, "illegal f");
|
2198
|
+
else if(ret == -2)
|
2199
|
+
rb_raise(rb_eArgError, "illegal a");
|
2200
|
+
|
2201
|
+
return rb_ary_new3(3, DBL2NUM(elong), DBL2NUM(phi), DBL2NUM(height));
|
2202
|
+
}
|
2203
|
+
|
2204
|
+
static VALUE
|
2205
|
+
celes_s_gd2gc(VALUE self, VALUE vn,
|
2206
|
+
VALUE velong, VALUE vphi, VALUE vheight){
|
2207
|
+
int ret;
|
2208
|
+
double xyz[3];
|
2209
|
+
|
2210
|
+
ret = iauGd2gc(NUM2INT(vn), NUM2DBL(velong),
|
2211
|
+
NUM2DBL(vphi), NUM2DBL(vheight), xyz);
|
2212
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
2213
|
+
|
2214
|
+
if(ret == -1)
|
2215
|
+
rb_raise(rb_eArgError, "illegal identifier");
|
2216
|
+
else if(ret == -2)
|
2217
|
+
rb_raise(rb_eArgError, "illegal case");
|
2218
|
+
|
2219
|
+
return vvec_new(xyz);
|
2220
|
+
}
|
2221
|
+
|
2222
|
+
static VALUE
|
2223
|
+
celes_s_gd2gce(VALUE self, VALUE va, VALUE vf,
|
2224
|
+
VALUE velong, VALUE vphi, VALUE vheight){
|
2225
|
+
int ret;
|
2226
|
+
double xyz[3];
|
2227
|
+
|
2228
|
+
ret = iauGd2gce(NUM2DBL(va), NUM2DBL(vf),
|
2229
|
+
NUM2DBL(velong), NUM2DBL(vphi), NUM2DBL(vheight), xyz);
|
2230
|
+
rb_ivar_set(self, id_status, INT2FIX(ret));
|
2231
|
+
|
2232
|
+
if(ret == -1)
|
2233
|
+
rb_raise(rb_eArgError, "illegal case");
|
2234
|
+
|
2235
|
+
return vvec_new(xyz);
|
2236
|
+
}
|
2237
|
+
|
2238
|
+
|
2239
|
+
void
|
2240
|
+
Init_celes_core(void){
|
2241
|
+
mCeles = rb_define_module("Celes");
|
2242
|
+
id_status = rb_intern("@status");
|
2243
|
+
|
2244
|
+
rb_define_module_function(mCeles, "status", celes_s_status, 0);
|
2245
|
+
|
2246
|
+
rb_define_module_function(mCeles, "zp!", celes_s_zp_b, 1);
|
2247
|
+
rb_define_module_function(mCeles, "zp", celes_s_zp, 0);
|
2248
|
+
rb_define_module_function(mCeles, "zr!", celes_s_zr_b, 1);
|
2249
|
+
rb_define_module_function(mCeles, "zr", celes_s_zr, 0);
|
2250
|
+
rb_define_module_function(mCeles, "ir!", celes_s_ir_b, 1);
|
2251
|
+
rb_define_module_function(mCeles, "ir", celes_s_ir, 0);
|
2252
|
+
rb_define_module_function(mCeles, "cp", celes_s_cp, 1);
|
2253
|
+
rb_define_module_function(mCeles, "cr", celes_s_cr, 1);
|
2254
|
+
rb_define_module_function(mCeles, "rx!", celes_s_rx_b, 2);
|
2255
|
+
rb_define_module_function(mCeles, "rx", celes_s_rx, 2);
|
2256
|
+
rb_define_module_function(mCeles, "ry!", celes_s_ry_b, 2);
|
2257
|
+
rb_define_module_function(mCeles, "ry", celes_s_ry, 2);
|
2258
|
+
rb_define_module_function(mCeles, "rz!", celes_s_rz_b, 2);
|
2259
|
+
rb_define_module_function(mCeles, "rz", celes_s_rz, 2);
|
2260
|
+
rb_define_module_function(mCeles, "s2c", celes_s_s2c, 2);
|
2261
|
+
rb_define_module_function(mCeles, "c2s", celes_s_c2s, 1);
|
2262
|
+
rb_define_module_function(mCeles, "s2p", celes_s_s2p, 3);
|
2263
|
+
rb_define_module_function(mCeles, "p2s", celes_s_p2s, 1);
|
2264
|
+
rb_define_module_function(mCeles, "ppp", celes_s_ppp, 2);
|
2265
|
+
rb_define_module_function(mCeles, "pmp", celes_s_pmp, 2);
|
2266
|
+
rb_define_module_function(mCeles, "ppsp", celes_s_ppsp, 3);
|
2267
|
+
rb_define_module_function(mCeles, "pdp", celes_s_pdp, 2);
|
2268
|
+
rb_define_module_function(mCeles, "pxp", celes_s_pxp, 2);
|
2269
|
+
rb_define_module_function(mCeles, "pm", celes_s_pm, 1);
|
2270
|
+
rb_define_module_function(mCeles, "pn", celes_s_pn, 1);
|
2271
|
+
rb_define_module_function(mCeles, "sxp", celes_s_sxp, 2);
|
2272
|
+
rb_define_module_function(mCeles, "rxr", celes_s_rxr, 2);
|
2273
|
+
rb_define_module_function(mCeles, "tr", celes_s_tr, 1);
|
2274
|
+
rb_define_module_function(mCeles, "rxp", celes_s_rxp, 2);
|
2275
|
+
rb_define_module_function(mCeles, "trxp", celes_s_trxp, 2);
|
2276
|
+
rb_define_module_function(mCeles, "sepp", celes_s_sepp, 2);
|
2277
|
+
rb_define_module_function(mCeles, "seps", celes_s_seps, 4);
|
2278
|
+
rb_define_module_function(mCeles, "pap", celes_s_pap, 2);
|
2279
|
+
rb_define_module_function(mCeles, "pas", celes_s_pas, 4);
|
2280
|
+
rb_define_module_function(mCeles, "rv2m", celes_s_rv2m, 1);
|
2281
|
+
rb_define_module_function(mCeles, "rm2v", celes_s_rm2v, 1);
|
2282
|
+
rb_define_module_function(mCeles, "zpv!", celes_s_zpv_b, 1);
|
2283
|
+
rb_define_module_function(mCeles, "zpv", celes_s_zpv, 0);
|
2284
|
+
rb_define_module_function(mCeles, "cpv", celes_s_cpv, 1);
|
2285
|
+
rb_define_module_function(mCeles, "p2pv", celes_s_p2pv, 1);
|
2286
|
+
rb_define_module_function(mCeles, "pv2p", celes_s_pv2p, 1);
|
2287
|
+
rb_define_module_function(mCeles, "s2pv", celes_s_s2pv, 6);
|
2288
|
+
rb_define_module_function(mCeles, "pv2s", celes_s_pv2s, 1);
|
2289
|
+
rb_define_module_function(mCeles, "pvppv", celes_s_pvppv, 2);
|
2290
|
+
rb_define_module_function(mCeles, "pvmpv", celes_s_pvmpv, 2);
|
2291
|
+
rb_define_module_function(mCeles, "pvdpv", celes_s_pvdpv, 2);
|
2292
|
+
rb_define_module_function(mCeles, "pvxpv", celes_s_pvxpv, 2);
|
2293
|
+
rb_define_module_function(mCeles, "pvm", celes_s_pvm, 1);
|
2294
|
+
rb_define_module_function(mCeles, "sxpv", celes_s_sxpv, 2);
|
2295
|
+
rb_define_module_function(mCeles, "s2xpv", celes_s_s2xpv, 3);
|
2296
|
+
rb_define_module_function(mCeles, "pvu", celes_s_pvu, 2);
|
2297
|
+
rb_define_module_function(mCeles, "pvup", celes_s_pvup, 2);
|
2298
|
+
rb_define_module_function(mCeles, "rxpv", celes_s_rxpv, 2);
|
2299
|
+
rb_define_module_function(mCeles, "trxpv", celes_s_trxpv, 2);
|
2300
|
+
|
2301
|
+
rb_define_module_function(mCeles, "anp", celes_s_anp, 1);
|
2302
|
+
rb_define_module_function(mCeles, "anpm", celes_s_anpm, 1);
|
2303
|
+
rb_define_module_function(mCeles, "a2tf", celes_s_a2tf, 2);
|
2304
|
+
rb_define_module_function(mCeles, "a2af", celes_s_a2af, 2);
|
2305
|
+
rb_define_module_function(mCeles, "af2a", celes_s_af2a, 4);
|
2306
|
+
rb_define_module_function(mCeles, "d2tf", celes_s_d2tf, 2);
|
2307
|
+
rb_define_module_function(mCeles, "tf2a", celes_s_tf2a, 4);
|
2308
|
+
rb_define_module_function(mCeles, "tf2d", celes_s_tf2d, 4);
|
2309
|
+
|
2310
|
+
rb_define_module_function(mCeles, "cal2jd", celes_s_cal2jd, 3);
|
2311
|
+
rb_define_module_function(mCeles, "epb", celes_s_epb, 2);
|
2312
|
+
rb_define_module_function(mCeles, "epb2jd", celes_s_epb2jd, 1);
|
2313
|
+
rb_define_module_function(mCeles, "epj", celes_s_epj, 2);
|
2314
|
+
rb_define_module_function(mCeles, "epj2jd", celes_s_epj2jd, 1);
|
2315
|
+
rb_define_module_function(mCeles, "jd2cal", celes_s_jd2cal, 2);
|
2316
|
+
rb_define_module_function(mCeles, "jdcalf", celes_s_jdcalf, 3);
|
2317
|
+
|
2318
|
+
rb_define_module_function(mCeles, "d2dtf", celes_s_d2dtf, 4);
|
2319
|
+
rb_define_module_function(mCeles, "dat", celes_s_dat, 4);
|
2320
|
+
rb_define_module_function(mCeles, "dtdb", celes_s_dtdb, 6);
|
2321
|
+
rb_define_module_function(mCeles, "dtf2d", celes_s_dtf2d, 7);
|
2322
|
+
rb_define_module_function(mCeles, "taitt", celes_s_taitt, 2);
|
2323
|
+
rb_define_module_function(mCeles, "taiut1", celes_s_taiut1, 3);
|
2324
|
+
rb_define_module_function(mCeles, "taiutc", celes_s_taiutc, 2);
|
2325
|
+
rb_define_module_function(mCeles, "tcbtdb", celes_s_tcbtdb, 2);
|
2326
|
+
rb_define_module_function(mCeles, "tcgtt" , celes_s_tcgtt, 2);
|
2327
|
+
rb_define_module_function(mCeles, "tdbtcb", celes_s_tdbtcb, 2);
|
2328
|
+
rb_define_module_function(mCeles, "tdbtt" , celes_s_tdbtt, 3);
|
2329
|
+
rb_define_module_function(mCeles, "tttai" , celes_s_tttai, 2);
|
2330
|
+
rb_define_module_function(mCeles, "tttcg" , celes_s_tttcg, 2);
|
2331
|
+
rb_define_module_function(mCeles, "tttdb" , celes_s_tttdb, 3);
|
2332
|
+
rb_define_module_function(mCeles, "ttut1" , celes_s_ttut1, 3);
|
2333
|
+
rb_define_module_function(mCeles, "ut1tai", celes_s_ut1tai, 3);
|
2334
|
+
rb_define_module_function(mCeles, "ut1tt", celes_s_ut1tt, 3);
|
2335
|
+
rb_define_module_function(mCeles, "ut1utc", celes_s_ut1utc, 3);
|
2336
|
+
rb_define_module_function(mCeles, "utctai", celes_s_utctai, 2);
|
2337
|
+
rb_define_module_function(mCeles, "utcut1", celes_s_utcut1, 3);
|
2338
|
+
|
2339
|
+
rb_define_module_function(mCeles, "ee00", celes_s_ee00, 4);
|
2340
|
+
rb_define_module_function(mCeles, "ee00a", celes_s_ee00a, 2);
|
2341
|
+
rb_define_module_function(mCeles, "ee00b", celes_s_ee00b, 2);
|
2342
|
+
rb_define_module_function(mCeles, "ee06a", celes_s_ee06a, 2);
|
2343
|
+
rb_define_module_function(mCeles, "eect00", celes_s_eect00, 2);
|
2344
|
+
rb_define_module_function(mCeles, "eqeq94", celes_s_eqeq94, 2);
|
2345
|
+
rb_define_module_function(mCeles, "era00", celes_s_era00, 2);
|
2346
|
+
rb_define_module_function(mCeles, "gmst00", celes_s_gmst00, 4);
|
2347
|
+
rb_define_module_function(mCeles, "gmst06", celes_s_gmst06, 4);
|
2348
|
+
rb_define_module_function(mCeles, "gmst82", celes_s_gmst82, 2);
|
2349
|
+
rb_define_module_function(mCeles, "gst00a", celes_s_gst00a, 4);
|
2350
|
+
rb_define_module_function(mCeles, "gst00b", celes_s_gst00b, 2);
|
2351
|
+
rb_define_module_function(mCeles, "gst06", celes_s_gst06, 5);
|
2352
|
+
rb_define_module_function(mCeles, "gst06a", celes_s_gst06a, 4);
|
2353
|
+
rb_define_module_function(mCeles, "gst94", celes_s_gst94, 2);
|
2354
|
+
|
2355
|
+
rb_define_module_function(mCeles, "epv00", celes_s_epv00, 2);
|
2356
|
+
rb_define_module_function(mCeles, "plan94", celes_s_plan94, 3);
|
2357
|
+
|
2358
|
+
rb_define_module_function(mCeles, "bi00", celes_s_bi00, 0);
|
2359
|
+
rb_define_module_function(mCeles, "bp00", celes_s_bp00, 2);
|
2360
|
+
rb_define_module_function(mCeles, "bp06", celes_s_bp06, 2);
|
2361
|
+
rb_define_module_function(mCeles, "bpn2xy", celes_s_bpn2xy, 1);
|
2362
|
+
rb_define_module_function(mCeles, "c2i00a", celes_s_c2i00a, 2);
|
2363
|
+
rb_define_module_function(mCeles, "c2i00b", celes_s_c2i00b, 2);
|
2364
|
+
rb_define_module_function(mCeles, "c2i06a", celes_s_c2i06a, 2);
|
2365
|
+
rb_define_module_function(mCeles, "c2ibpn", celes_s_c2ibpn, 3);
|
2366
|
+
rb_define_module_function(mCeles, "c2ixy", celes_s_c2ixy, 4);
|
2367
|
+
rb_define_module_function(mCeles, "c2ixys", celes_s_c2ixys, 3);
|
2368
|
+
rb_define_module_function(mCeles, "c2t00a", celes_s_c2t00a, 6);
|
2369
|
+
rb_define_module_function(mCeles, "c2t00b", celes_s_c2t00b, 6);
|
2370
|
+
rb_define_module_function(mCeles, "c2t06a", celes_s_c2t06a, 6);
|
2371
|
+
rb_define_module_function(mCeles, "c2tcio", celes_s_c2tcio, 3);
|
2372
|
+
rb_define_module_function(mCeles, "c2teqx", celes_s_c2teqx, 3);
|
2373
|
+
rb_define_module_function(mCeles, "c2tpe", celes_s_c2tpe, 8);
|
2374
|
+
rb_define_module_function(mCeles, "c2txy", celes_s_c2txy, 8);
|
2375
|
+
rb_define_module_function(mCeles, "eo06a", celes_s_eo06a, 2);
|
2376
|
+
rb_define_module_function(mCeles, "eors", celes_s_eors, 2);
|
2377
|
+
rb_define_module_function(mCeles, "fw2m", celes_s_fw2m, 4);
|
2378
|
+
rb_define_module_function(mCeles, "fw2xy", celes_s_fw2xy, 4);
|
2379
|
+
rb_define_module_function(mCeles, "num00a", celes_s_num00a, 2);
|
2380
|
+
rb_define_module_function(mCeles, "num00b", celes_s_num00b, 2);
|
2381
|
+
rb_define_module_function(mCeles, "num06a", celes_s_num06a, 2);
|
2382
|
+
rb_define_module_function(mCeles, "numat", celes_s_numat, 3);
|
2383
|
+
rb_define_module_function(mCeles, "nut00a", celes_s_nut00a, 2);
|
2384
|
+
rb_define_module_function(mCeles, "nut00b", celes_s_nut00b, 2);
|
2385
|
+
rb_define_module_function(mCeles, "nut06a", celes_s_nut06a, 2);
|
2386
|
+
rb_define_module_function(mCeles, "nut80", celes_s_nut80, 2);
|
2387
|
+
rb_define_module_function(mCeles, "nutm80", celes_s_nutm80, 2);
|
2388
|
+
rb_define_module_function(mCeles, "obl06", celes_s_obl06, 2);
|
2389
|
+
rb_define_module_function(mCeles, "obl80", celes_s_obl80, 2);
|
2390
|
+
rb_define_module_function(mCeles, "pb06", celes_s_pb06, 2);
|
2391
|
+
rb_define_module_function(mCeles, "pfw06", celes_s_pfw06, 2);
|
2392
|
+
rb_define_module_function(mCeles, "pmat00", celes_s_pmat00, 2);
|
2393
|
+
rb_define_module_function(mCeles, "pmat06", celes_s_pmat06, 2);
|
2394
|
+
rb_define_module_function(mCeles, "pmat76", celes_s_pmat76, 2);
|
2395
|
+
rb_define_module_function(mCeles, "pn00", celes_s_pn00, 4);
|
2396
|
+
rb_define_module_function(mCeles, "pn00a", celes_s_pn00a, 2);
|
2397
|
+
rb_define_module_function(mCeles, "pn00b", celes_s_pn00b, 2);
|
2398
|
+
rb_define_module_function(mCeles, "pn06", celes_s_pn06, 4);
|
2399
|
+
rb_define_module_function(mCeles, "pn06a", celes_s_pn06a, 2);
|
2400
|
+
rb_define_module_function(mCeles, "pnm00a", celes_s_pnm00a, 2);
|
2401
|
+
rb_define_module_function(mCeles, "pnm00b", celes_s_pnm00b, 2);
|
2402
|
+
rb_define_module_function(mCeles, "pnm06a", celes_s_pnm06a, 2);
|
2403
|
+
rb_define_module_function(mCeles, "pnm80", celes_s_pnm80, 2);
|
2404
|
+
rb_define_module_function(mCeles, "p06e", celes_s_p06e, 2);
|
2405
|
+
rb_define_module_function(mCeles, "pom00", celes_s_pom00, 3);
|
2406
|
+
rb_define_module_function(mCeles, "pr00", celes_s_pr00, 2);
|
2407
|
+
rb_define_module_function(mCeles, "prec76", celes_s_prec76, 4);
|
2408
|
+
rb_define_module_function(mCeles, "s00", celes_s_s00, 4);
|
2409
|
+
rb_define_module_function(mCeles, "s00a", celes_s_s00a, 2);
|
2410
|
+
rb_define_module_function(mCeles, "s00b", celes_s_s00b, 2);
|
2411
|
+
rb_define_module_function(mCeles, "s06", celes_s_s06, 4);
|
2412
|
+
rb_define_module_function(mCeles, "s06a", celes_s_s06a, 2);
|
2413
|
+
rb_define_module_function(mCeles, "sp00", celes_s_sp00, 2);
|
2414
|
+
rb_define_module_function(mCeles, "xy06", celes_s_xy06, 2);
|
2415
|
+
rb_define_module_function(mCeles, "xys00a", celes_s_xys00a, 2);
|
2416
|
+
rb_define_module_function(mCeles, "xys00b", celes_s_xys00b, 2);
|
2417
|
+
rb_define_module_function(mCeles, "xys06a", celes_s_xys06a, 2);
|
2418
|
+
|
2419
|
+
rb_define_module_function(mCeles, "fad03", celes_s_fad03, 1);
|
2420
|
+
rb_define_module_function(mCeles, "fae03", celes_s_fae03, 1);
|
2421
|
+
rb_define_module_function(mCeles, "faf03", celes_s_faf03, 1);
|
2422
|
+
rb_define_module_function(mCeles, "faju03", celes_s_faju03, 1);
|
2423
|
+
rb_define_module_function(mCeles, "fal03", celes_s_fal03, 1);
|
2424
|
+
rb_define_module_function(mCeles, "falp03", celes_s_falp03, 1);
|
2425
|
+
rb_define_module_function(mCeles, "fama03", celes_s_fama03, 1);
|
2426
|
+
rb_define_module_function(mCeles, "fame03", celes_s_fame03, 1);
|
2427
|
+
rb_define_module_function(mCeles, "fane03", celes_s_fane03, 1);
|
2428
|
+
rb_define_module_function(mCeles, "faom03", celes_s_faom03, 1);
|
2429
|
+
rb_define_module_function(mCeles, "fapa03", celes_s_fapa03, 1);
|
2430
|
+
rb_define_module_function(mCeles, "fasa03", celes_s_fasa03, 1);
|
2431
|
+
rb_define_module_function(mCeles, "faur03", celes_s_faur03, 1);
|
2432
|
+
rb_define_module_function(mCeles, "fave03", celes_s_fave03, 1);
|
2433
|
+
|
2434
|
+
rb_define_module_function(mCeles, "pvstar", celes_s_pvstar, 1);
|
2435
|
+
rb_define_module_function(mCeles, "starpv", celes_s_starpv, 6);
|
2436
|
+
|
2437
|
+
rb_define_module_function(mCeles, "fk52h", celes_s_fk52h, 6);
|
2438
|
+
rb_define_module_function(mCeles, "fk5hip", celes_s_fk5hip, 0);
|
2439
|
+
rb_define_module_function(mCeles, "fk5hz", celes_s_fk5hz, 4);
|
2440
|
+
rb_define_module_function(mCeles, "h2fk5", celes_s_h2fk5, 6);
|
2441
|
+
rb_define_module_function(mCeles, "hfk5z", celes_s_hfk5z, 4);
|
2442
|
+
rb_define_module_function(mCeles, "starpm", celes_s_starpm, 10);
|
2443
|
+
|
2444
|
+
rb_define_module_function(mCeles, "eform", celes_s_eform, 1);
|
2445
|
+
rb_define_module_function(mCeles, "gc2gd", celes_s_gc2gd, 2);
|
2446
|
+
rb_define_module_function(mCeles, "gc2gde", celes_s_gc2gde, 3);
|
2447
|
+
rb_define_module_function(mCeles, "gd2gc", celes_s_gd2gc, 4);
|
2448
|
+
rb_define_module_function(mCeles, "gd2gce", celes_s_gd2gce, 5);
|
2449
|
+
|
2450
|
+
rb_define_const(mCeles, "DPI", DBL2NUM(DPI));
|
2451
|
+
rb_define_const(mCeles, "D2PI", DBL2NUM(D2PI));
|
2452
|
+
rb_define_const(mCeles, "DD2R", DBL2NUM(DD2R));
|
2453
|
+
rb_define_const(mCeles, "DR2AS", DBL2NUM(DR2AS));
|
2454
|
+
rb_define_const(mCeles, "DAS2R", DBL2NUM(DAS2R));
|
2455
|
+
rb_define_const(mCeles, "DS2R", DBL2NUM(DS2R));
|
2456
|
+
rb_define_const(mCeles, "TURNAS", DBL2NUM(TURNAS));
|
2457
|
+
rb_define_const(mCeles, "DMAS2R", DBL2NUM(DMAS2R));
|
2458
|
+
rb_define_const(mCeles, "DTY", DBL2NUM(DTY));
|
2459
|
+
rb_define_const(mCeles, "DAYSEC", DBL2NUM(DAYSEC));
|
2460
|
+
rb_define_const(mCeles, "DJY", DBL2NUM(DJY));
|
2461
|
+
rb_define_const(mCeles, "DJC", DBL2NUM(DJC));
|
2462
|
+
rb_define_const(mCeles, "DJM", DBL2NUM(DJM));
|
2463
|
+
rb_define_const(mCeles, "DJ00", DBL2NUM(DJ00));
|
2464
|
+
rb_define_const(mCeles, "DJM0", DBL2NUM(DJM0));
|
2465
|
+
rb_define_const(mCeles, "DJM00", DBL2NUM(DJM00));
|
2466
|
+
rb_define_const(mCeles, "DJM77", DBL2NUM(DJM77));
|
2467
|
+
rb_define_const(mCeles, "TTMTAI", DBL2NUM(TTMTAI));
|
2468
|
+
rb_define_const(mCeles, "DAU", DBL2NUM(DAU));
|
2469
|
+
rb_define_const(mCeles, "DC", DBL2NUM(DC));
|
2470
|
+
rb_define_const(mCeles, "ELG", DBL2NUM(ELG));
|
2471
|
+
rb_define_const(mCeles, "ELB", DBL2NUM(ELB));
|
2472
|
+
rb_define_const(mCeles, "TDB0", DBL2NUM(TDB0));
|
2473
|
+
rb_define_const(mCeles, "WGS84", INT2NUM(WGS84));
|
2474
|
+
rb_define_const(mCeles, "GRS80", INT2NUM(GRS80));
|
2475
|
+
rb_define_const(mCeles, "WGS72", INT2NUM(WGS72));
|
2476
|
+
}
|
2477
|
+
|
2478
|
+
|
2479
|
+
|
2480
|
+
|
2481
|
+
/*----------------------------------------------------------------------
|
2482
|
+
**
|
2483
|
+
** Celes is a wrapper of the SOFA Library for Ruby.
|
2484
|
+
**
|
2485
|
+
**
|
2486
|
+
**
|
2487
|
+
**
|
2488
|
+
**
|
2489
|
+
** Copyright (C) 2013, Naoki Arita
|
2490
|
+
** All rights reserved.
|
2491
|
+
**
|
2492
|
+
** Redistribution and use in source and binary forms, with or without
|
2493
|
+
** modification, are permitted provided that the following conditions
|
2494
|
+
** are met:
|
2495
|
+
**
|
2496
|
+
** 1 Redistributions of source code must retain the above copyright
|
2497
|
+
** notice, this list of conditions and the following disclaimer.
|
2498
|
+
**
|
2499
|
+
** 2 Redistributions in binary form must reproduce the above copyright
|
2500
|
+
** notice, this list of conditions and the following disclaimer in
|
2501
|
+
** the documentation and/or other materials provided with the
|
2502
|
+
** distribution.
|
2503
|
+
**
|
2504
|
+
** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
|
2505
|
+
** the International Astronomical Union nor the names of its
|
2506
|
+
** contributors may be used to endorse or promote products derived
|
2507
|
+
** from this software without specific prior written permission.
|
2508
|
+
**
|
2509
|
+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
2510
|
+
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
2511
|
+
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
2512
|
+
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
2513
|
+
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
2514
|
+
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
2515
|
+
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
2516
|
+
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
2517
|
+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
2518
|
+
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
2519
|
+
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
2520
|
+
** POSSIBILITY OF SUCH DAMAGE.
|
2521
|
+
**
|
2522
|
+
**--------------------------------------------------------------------*/
|