line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
/* -*- C -*- |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
perl-PAL glue |
4
|
|
|
|
|
|
|
t.jenness@jach.hawaii.edu |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
Copyright (C) 2012, 2014 Tim Jenness. All rights reserved. |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
9
|
|
|
|
|
|
|
modify it under the terms of the GNU General Public License as |
10
|
|
|
|
|
|
|
published by the Free Software Foundation; either version 3 of |
11
|
|
|
|
|
|
|
the License, or (at your option) any later version. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
This program is distributed in the hope that it will be |
14
|
|
|
|
|
|
|
useful, but WITHOUT ANY WARRANTY; without even the implied |
15
|
|
|
|
|
|
|
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
16
|
|
|
|
|
|
|
PURPOSE. See the GNU General Public License for more details. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License |
19
|
|
|
|
|
|
|
along with this program; if not, write to the Free Software |
20
|
|
|
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
21
|
|
|
|
|
|
|
USA. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
PAL does not have the single precision SLA variants. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
*/ |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
#include "EXTERN.h" /* std perl include */ |
29
|
|
|
|
|
|
|
#include "perl.h" /* std perl include */ |
30
|
|
|
|
|
|
|
#include "XSUB.h" /* XSUB include */ |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#include "pal.h" |
34
|
|
|
|
|
|
|
#include "arrays.h" |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
/* macros to return C arrays of fixed size to list on stack */ |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
#define RETMATRIX(rmat) { \ |
39
|
|
|
|
|
|
|
int ii; \ |
40
|
|
|
|
|
|
|
for (ii=0; ii<3; ii++) { \ |
41
|
|
|
|
|
|
|
int jj; \ |
42
|
|
|
|
|
|
|
for (jj=0; jj<3; jj++) { \ |
43
|
|
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(rmat[ii][jj]))); \ |
44
|
|
|
|
|
|
|
} \ |
45
|
|
|
|
|
|
|
} \ |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
/* type is "nv" for floats and "iv" for ints */ |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
#define RETVEC(vec,n,type) { \ |
51
|
|
|
|
|
|
|
int ii; \ |
52
|
|
|
|
|
|
|
for (ii=0; ii
|
53
|
|
|
|
|
|
|
XPUSHs(sv_2mortal(newSV##type(vec[ii]))); \ |
54
|
|
|
|
|
|
|
} \ |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
/* Copy 9 element vector to 3x3 matrix */ |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
#define VECTOMAT(vec,mat) { \ |
60
|
|
|
|
|
|
|
int ii; \ |
61
|
|
|
|
|
|
|
for (ii=0; ii<3; ii++) { \ |
62
|
|
|
|
|
|
|
int jj; \ |
63
|
|
|
|
|
|
|
for (jj=0; jj<3; jj++) { \ |
64
|
|
|
|
|
|
|
mat[ii][jj] = vec[ii*3+jj]; \ |
65
|
|
|
|
|
|
|
} \ |
66
|
|
|
|
|
|
|
} \ |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
/* Extract Perl array into 2D array */ |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
#define ARRAYTOMAT(arr,mat,nr,nc) { \ |
72
|
|
|
|
|
|
|
int ii; int jj; SV ** elem; \ |
73
|
|
|
|
|
|
|
for (ii = 0; ii < nr; ii ++) { \ |
74
|
|
|
|
|
|
|
for (jj = 0; jj < nc; jj ++) { \ |
75
|
|
|
|
|
|
|
elem = av_fetch(arr, ii * nc + jj, 0); \ |
76
|
|
|
|
|
|
|
mat[ii][jj] = SvNV(*elem); \ |
77
|
|
|
|
|
|
|
} \ |
78
|
|
|
|
|
|
|
} \ |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
MODULE = Astro::PAL PACKAGE = Astro::PAL |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
# Add a few routines |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
void |
88
|
|
|
|
|
|
|
palAddet(rm, dm, eq) |
89
|
|
|
|
|
|
|
double rm |
90
|
|
|
|
|
|
|
double dm |
91
|
|
|
|
|
|
|
double eq |
92
|
|
|
|
|
|
|
PREINIT: |
93
|
|
|
|
|
|
|
double rc; |
94
|
|
|
|
|
|
|
double dc; |
95
|
|
|
|
|
|
|
PPCODE: |
96
|
1
|
|
|
|
|
|
palAddet(rm, dm, eq, &rc, &dc); |
97
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(rc))); |
98
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dc))); |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
double |
101
|
|
|
|
|
|
|
palAirmas(zd) |
102
|
|
|
|
|
|
|
double zd |
103
|
|
|
|
|
|
|
CODE: |
104
|
0
|
|
|
|
|
|
RETVAL = palAirmas(zd); |
105
|
|
|
|
|
|
|
OUTPUT: |
106
|
|
|
|
|
|
|
RETVAL |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
void |
109
|
|
|
|
|
|
|
palAltaz(ha, dec, phi) |
110
|
|
|
|
|
|
|
double ha |
111
|
|
|
|
|
|
|
double dec |
112
|
|
|
|
|
|
|
double phi |
113
|
|
|
|
|
|
|
PREINIT: |
114
|
|
|
|
|
|
|
double az; |
115
|
|
|
|
|
|
|
double azd; |
116
|
|
|
|
|
|
|
double azdd; |
117
|
|
|
|
|
|
|
double el; |
118
|
|
|
|
|
|
|
double eld; |
119
|
|
|
|
|
|
|
double eldd; |
120
|
|
|
|
|
|
|
double pa; |
121
|
|
|
|
|
|
|
double pad; |
122
|
|
|
|
|
|
|
double padd; |
123
|
|
|
|
|
|
|
PPCODE: |
124
|
1
|
|
|
|
|
|
palAltaz(ha, dec, phi, &az, &azd, &azdd, &el, &eld, &eldd, &pa, &pad, &padd); |
125
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(az))); |
126
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(azd))); |
127
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(azdd))); |
128
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(el))); |
129
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(eld))); |
130
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(eldd))); |
131
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(pa))); |
132
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(pad))); |
133
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(padd))); |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
void |
136
|
|
|
|
|
|
|
palAmp(ra, da, date, eq) |
137
|
|
|
|
|
|
|
double ra |
138
|
|
|
|
|
|
|
double da |
139
|
|
|
|
|
|
|
double date |
140
|
|
|
|
|
|
|
double eq |
141
|
|
|
|
|
|
|
PREINIT: |
142
|
|
|
|
|
|
|
double rm; |
143
|
|
|
|
|
|
|
double dm; |
144
|
|
|
|
|
|
|
PPCODE: |
145
|
0
|
|
|
|
|
|
palAmp(ra, da, date, eq, &rm, &dm); |
146
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(rm))); |
147
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dm))); |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
# FLAG: Need to add a check for number of components in amprms |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
void |
153
|
|
|
|
|
|
|
palAmpqk(ra, da, amprms) |
154
|
|
|
|
|
|
|
double ra |
155
|
|
|
|
|
|
|
double da |
156
|
|
|
|
|
|
|
double * amprms |
157
|
|
|
|
|
|
|
PREINIT: |
158
|
|
|
|
|
|
|
double rm; |
159
|
|
|
|
|
|
|
double dm; |
160
|
|
|
|
|
|
|
PPCODE: |
161
|
0
|
|
|
|
|
|
palAmpqk(ra, da, amprms, &rm, &dm); |
162
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(rm))); |
163
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dm))); |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
void |
166
|
|
|
|
|
|
|
palAop(rap,dap,date,dut,elongm,phim,hm,xp,yp,tdk,pmb,rh,wl,tlr) |
167
|
|
|
|
|
|
|
double rap |
168
|
|
|
|
|
|
|
double dap |
169
|
|
|
|
|
|
|
double date |
170
|
|
|
|
|
|
|
double dut |
171
|
|
|
|
|
|
|
double elongm |
172
|
|
|
|
|
|
|
double phim |
173
|
|
|
|
|
|
|
double hm |
174
|
|
|
|
|
|
|
double xp |
175
|
|
|
|
|
|
|
double yp |
176
|
|
|
|
|
|
|
double tdk |
177
|
|
|
|
|
|
|
double pmb |
178
|
|
|
|
|
|
|
double rh |
179
|
|
|
|
|
|
|
double wl |
180
|
|
|
|
|
|
|
double tlr |
181
|
|
|
|
|
|
|
PREINIT: |
182
|
|
|
|
|
|
|
double aob; |
183
|
|
|
|
|
|
|
double zob; |
184
|
|
|
|
|
|
|
double hob; |
185
|
|
|
|
|
|
|
double dob; |
186
|
|
|
|
|
|
|
double rob; |
187
|
|
|
|
|
|
|
PPCODE: |
188
|
3
|
|
|
|
|
|
palAop(rap,dap,date,dut,elongm,phim,hm,xp,yp,tdk,pmb,rh,wl,tlr,&aob,&zob,&hob,&dob,&rob); |
189
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(aob))); |
190
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(zob))); |
191
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(hob))); |
192
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dob))); |
193
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(rob))); |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
void |
196
|
|
|
|
|
|
|
palAoppa(date,dut,elongm,phim,hm,xp,yp,tdk,pmb,rh,wl,tlr) |
197
|
|
|
|
|
|
|
double date |
198
|
|
|
|
|
|
|
double dut |
199
|
|
|
|
|
|
|
double elongm |
200
|
|
|
|
|
|
|
double phim |
201
|
|
|
|
|
|
|
double hm |
202
|
|
|
|
|
|
|
double xp |
203
|
|
|
|
|
|
|
double yp |
204
|
|
|
|
|
|
|
double tdk |
205
|
|
|
|
|
|
|
double pmb |
206
|
|
|
|
|
|
|
double rh |
207
|
|
|
|
|
|
|
double wl |
208
|
|
|
|
|
|
|
double tlr |
209
|
|
|
|
|
|
|
PREINIT: |
210
|
|
|
|
|
|
|
double aoprms[14]; |
211
|
|
|
|
|
|
|
int i; |
212
|
|
|
|
|
|
|
PPCODE: |
213
|
1
|
|
|
|
|
|
palAoppa(date,dut,elongm,phim,hm,xp,yp,tdk,pmb,rh,wl,tlr,aoprms); |
214
|
15
|
50
|
|
|
|
|
RETVEC( aoprms, 14, nv ); |
|
|
100
|
|
|
|
|
|
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
# Documented to update element 13 of AOPRMS by using |
217
|
|
|
|
|
|
|
# the information in element 12. To make things easy in the XS |
218
|
|
|
|
|
|
|
# layer we do all this on the perl side and just pass the |
219
|
|
|
|
|
|
|
# relevant information in. |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
void |
222
|
|
|
|
|
|
|
pal_Aoppat(date, elem12) |
223
|
|
|
|
|
|
|
double date |
224
|
|
|
|
|
|
|
double elem12 |
225
|
|
|
|
|
|
|
PREINIT: |
226
|
|
|
|
|
|
|
double aoprms[14]; |
227
|
|
|
|
|
|
|
int i; |
228
|
|
|
|
|
|
|
PPCODE: |
229
|
1
|
|
|
|
|
|
aoprms[12] = elem12; |
230
|
1
|
|
|
|
|
|
palAoppat(date, aoprms); |
231
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(aoprms[13]))); |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
void |
234
|
|
|
|
|
|
|
pal_Aopqk(rap, dap, aoprms) |
235
|
|
|
|
|
|
|
double rap |
236
|
|
|
|
|
|
|
double dap |
237
|
|
|
|
|
|
|
double * aoprms |
238
|
|
|
|
|
|
|
PREINIT: |
239
|
|
|
|
|
|
|
double aob; |
240
|
|
|
|
|
|
|
double zob; |
241
|
|
|
|
|
|
|
double hob; |
242
|
|
|
|
|
|
|
double dob; |
243
|
|
|
|
|
|
|
double rob; |
244
|
|
|
|
|
|
|
PPCODE: |
245
|
0
|
|
|
|
|
|
palAopqk(rap, dap, aoprms, &aob,&zob,&hob,&dob,&rob); |
246
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(aob))); |
247
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(zob))); |
248
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(hob))); |
249
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dob))); |
250
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(rob))); |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
void |
253
|
|
|
|
|
|
|
palAtmdsp(tdk, pmb, rh, wl1, a1, b1, wl2) |
254
|
|
|
|
|
|
|
double tdk |
255
|
|
|
|
|
|
|
double pmb |
256
|
|
|
|
|
|
|
double rh |
257
|
|
|
|
|
|
|
double wl1 |
258
|
|
|
|
|
|
|
double a1 |
259
|
|
|
|
|
|
|
double b1 |
260
|
|
|
|
|
|
|
double wl2 |
261
|
|
|
|
|
|
|
PREINIT: |
262
|
|
|
|
|
|
|
double a2; |
263
|
|
|
|
|
|
|
double b2; |
264
|
|
|
|
|
|
|
PPCODE: |
265
|
1
|
|
|
|
|
|
palAtmdsp(tdk, pmb, rh, wl1, a1, b1, wl2, &a2, &b2); |
266
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(a2))); |
267
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(b2))); |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
void |
270
|
|
|
|
|
|
|
palCaldj(iy, im, id) |
271
|
|
|
|
|
|
|
int iy |
272
|
|
|
|
|
|
|
int im |
273
|
|
|
|
|
|
|
int id |
274
|
|
|
|
|
|
|
PREINIT: |
275
|
|
|
|
|
|
|
double djm; |
276
|
|
|
|
|
|
|
int j; |
277
|
|
|
|
|
|
|
PPCODE: |
278
|
0
|
|
|
|
|
|
palCaldj(iy, im, id, &djm, &j); |
279
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(djm))); |
280
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(j))); |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
void |
283
|
|
|
|
|
|
|
palCldj(iy, im, id) |
284
|
|
|
|
|
|
|
int iy |
285
|
|
|
|
|
|
|
int im |
286
|
|
|
|
|
|
|
int id |
287
|
|
|
|
|
|
|
PREINIT: |
288
|
|
|
|
|
|
|
double djm; |
289
|
|
|
|
|
|
|
int status; |
290
|
|
|
|
|
|
|
PPCODE: |
291
|
5
|
|
|
|
|
|
palCldj(iy, im, id, &djm, &status); |
292
|
5
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(djm))); |
293
|
5
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(status))); |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
void |
296
|
|
|
|
|
|
|
palDaf2r(ideg, iamin, asec) |
297
|
|
|
|
|
|
|
int ideg |
298
|
|
|
|
|
|
|
int iamin |
299
|
|
|
|
|
|
|
double asec |
300
|
|
|
|
|
|
|
PREINIT: |
301
|
|
|
|
|
|
|
double rad; |
302
|
|
|
|
|
|
|
int j; |
303
|
|
|
|
|
|
|
PPCODE: |
304
|
5
|
|
|
|
|
|
palDaf2r(ideg, iamin, asec, &rad, &j); |
305
|
5
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(rad))); |
306
|
5
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(j))); |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
# Note that nstrt is given but also returned |
309
|
|
|
|
|
|
|
# We return it as a new value rather than modifying in place. |
310
|
|
|
|
|
|
|
# (nstrt, dreslt, jf) = palDafin( string, nstrt ) |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
void |
313
|
|
|
|
|
|
|
palDafin(string, nstrt) |
314
|
|
|
|
|
|
|
char * string |
315
|
|
|
|
|
|
|
int nstrt |
316
|
|
|
|
|
|
|
PREINIT: |
317
|
|
|
|
|
|
|
double dreslt; |
318
|
|
|
|
|
|
|
int jf; |
319
|
|
|
|
|
|
|
PPCODE: |
320
|
3
|
|
|
|
|
|
palDafin(string, &nstrt, &dreslt, &jf); |
321
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(nstrt))); |
322
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dreslt))); |
323
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(jf))); |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
double |
326
|
|
|
|
|
|
|
palDat(utc) |
327
|
|
|
|
|
|
|
double utc |
328
|
|
|
|
|
|
|
CODE: |
329
|
0
|
|
|
|
|
|
RETVAL = palDat(utc); |
330
|
|
|
|
|
|
|
OUTPUT: |
331
|
|
|
|
|
|
|
RETVAL |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
# Return the 9 elements directly so they can be |
335
|
|
|
|
|
|
|
# captured in an array |
336
|
|
|
|
|
|
|
# @rmat = palDav2m( axvec ); |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
void |
339
|
|
|
|
|
|
|
palDav2m(axvec) |
340
|
|
|
|
|
|
|
double * axvec |
341
|
|
|
|
|
|
|
PREINIT: |
342
|
|
|
|
|
|
|
int i,j; |
343
|
|
|
|
|
|
|
double rmat[3][3]; |
344
|
|
|
|
|
|
|
PPCODE: |
345
|
0
|
|
|
|
|
|
palDav2m(axvec, rmat); |
346
|
0
|
0
|
|
|
|
|
RETMATRIX(rmat); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
double |
349
|
|
|
|
|
|
|
palDbear(a1, b1, a2, b2) |
350
|
|
|
|
|
|
|
double a1 |
351
|
|
|
|
|
|
|
double b1 |
352
|
|
|
|
|
|
|
double a2 |
353
|
|
|
|
|
|
|
double b2 |
354
|
|
|
|
|
|
|
CODE: |
355
|
1
|
|
|
|
|
|
RETVAL = palDbear(a1, b1, a2, b2); |
356
|
|
|
|
|
|
|
OUTPUT: |
357
|
|
|
|
|
|
|
RETVAL |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
void |
360
|
|
|
|
|
|
|
palDcc2s(v) |
361
|
|
|
|
|
|
|
double * v |
362
|
|
|
|
|
|
|
PREINIT: |
363
|
|
|
|
|
|
|
double a; |
364
|
|
|
|
|
|
|
double b; |
365
|
|
|
|
|
|
|
PPCODE: |
366
|
364
|
|
|
|
|
|
palDcc2s(v, &a, &b); |
367
|
364
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(a))); |
368
|
364
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(b))); |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
void |
371
|
|
|
|
|
|
|
palDcmpf(coeffs) |
372
|
|
|
|
|
|
|
double * coeffs |
373
|
|
|
|
|
|
|
PREINIT: |
374
|
|
|
|
|
|
|
double xz; |
375
|
|
|
|
|
|
|
double yz; |
376
|
|
|
|
|
|
|
double xs; |
377
|
|
|
|
|
|
|
double ys; |
378
|
|
|
|
|
|
|
double perp; |
379
|
|
|
|
|
|
|
double orient; |
380
|
|
|
|
|
|
|
PPCODE: |
381
|
1
|
|
|
|
|
|
palDcmpf(coeffs, &xz, &yz, &xs, &ys, &perp, &orient); |
382
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(xz))); |
383
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(yz))); |
384
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(xs))); |
385
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(ys))); |
386
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(perp))); |
387
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(orient))); |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
# Returns a list for v[3] |
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
void |
393
|
|
|
|
|
|
|
palDcs2c(a, b) |
394
|
|
|
|
|
|
|
double a |
395
|
|
|
|
|
|
|
double b |
396
|
|
|
|
|
|
|
PREINIT: |
397
|
|
|
|
|
|
|
double v[3]; |
398
|
|
|
|
|
|
|
PPCODE: |
399
|
4
|
|
|
|
|
|
palDcs2c(a, b, v); |
400
|
16
|
50
|
|
|
|
|
RETVEC( v, 3, nv ); |
|
|
100
|
|
|
|
|
|
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
# Converts decimal day to hours minutes and seconds |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
void |
405
|
|
|
|
|
|
|
palDd2tf(ndp, days) |
406
|
|
|
|
|
|
|
int ndp |
407
|
|
|
|
|
|
|
double days |
408
|
|
|
|
|
|
|
PREINIT: |
409
|
|
|
|
|
|
|
char sign; |
410
|
|
|
|
|
|
|
int ihmsf[4]; |
411
|
|
|
|
|
|
|
PPCODE: |
412
|
1
|
|
|
|
|
|
palDd2tf(ndp, days, &sign, ihmsf); |
413
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVpvn(&sign, 1))); |
414
|
5
|
50
|
|
|
|
|
RETVEC( ihmsf, 4, iv ); |
|
|
100
|
|
|
|
|
|
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
# Equatorial to horizontal |
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
void |
419
|
|
|
|
|
|
|
palDe2h(ha, dec, phi) |
420
|
|
|
|
|
|
|
double ha |
421
|
|
|
|
|
|
|
double dec |
422
|
|
|
|
|
|
|
double phi |
423
|
|
|
|
|
|
|
PREINIT: |
424
|
|
|
|
|
|
|
double az; |
425
|
|
|
|
|
|
|
double el; |
426
|
|
|
|
|
|
|
PPCODE: |
427
|
1
|
|
|
|
|
|
palDe2h(ha, dec, phi, &az, &el); |
428
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(az))); |
429
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(el))); |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
# Returns 9 elements directly on stack |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
void |
434
|
|
|
|
|
|
|
palDeuler(order, phi, theta, psi) |
435
|
|
|
|
|
|
|
char * order |
436
|
|
|
|
|
|
|
double phi |
437
|
|
|
|
|
|
|
double theta |
438
|
|
|
|
|
|
|
double psi |
439
|
|
|
|
|
|
|
PREINIT: |
440
|
|
|
|
|
|
|
double rmat[3][3]; |
441
|
|
|
|
|
|
|
PPCODE: |
442
|
0
|
|
|
|
|
|
palDeuler(order, phi, theta, psi, rmat); |
443
|
0
|
0
|
|
|
|
|
RETMATRIX(rmat); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
# Note that nstrt is given and then returned on the stack |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
void |
448
|
|
|
|
|
|
|
palDfltin(string, nstrt) |
449
|
|
|
|
|
|
|
char * string |
450
|
|
|
|
|
|
|
int nstrt |
451
|
|
|
|
|
|
|
PREINIT: |
452
|
|
|
|
|
|
|
double dreslt; |
453
|
|
|
|
|
|
|
int jflag; |
454
|
|
|
|
|
|
|
PPCODE: |
455
|
5
|
|
|
|
|
|
palDfltin(string, &nstrt, &dreslt, &jflag); |
456
|
5
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(nstrt))); |
457
|
5
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dreslt))); |
458
|
5
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(jflag))); |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
# Horizontal to equatorial |
461
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
void |
463
|
|
|
|
|
|
|
palDh2e(az, el, phi) |
464
|
|
|
|
|
|
|
double az |
465
|
|
|
|
|
|
|
double el |
466
|
|
|
|
|
|
|
double phi |
467
|
|
|
|
|
|
|
PREINIT: |
468
|
|
|
|
|
|
|
double ha; |
469
|
|
|
|
|
|
|
double dec; |
470
|
|
|
|
|
|
|
PPCODE: |
471
|
0
|
|
|
|
|
|
palDh2e(az, el, phi, &ha, &dec); |
472
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(ha))); |
473
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dec))); |
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
# Returned 3-vector on stack |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
void |
478
|
|
|
|
|
|
|
palDimxv(dm, va) |
479
|
|
|
|
|
|
|
double * dm |
480
|
|
|
|
|
|
|
double * va |
481
|
|
|
|
|
|
|
PREINIT: |
482
|
|
|
|
|
|
|
double vb[3]; |
483
|
|
|
|
|
|
|
double rmat[3][3]; |
484
|
|
|
|
|
|
|
int i; |
485
|
|
|
|
|
|
|
PPCODE: |
486
|
0
|
0
|
|
|
|
|
VECTOMAT( dm, rmat ); |
|
|
0
|
|
|
|
|
|
487
|
0
|
|
|
|
|
|
palDimxv(rmat, va, vb); |
488
|
0
|
0
|
|
|
|
|
RETVEC( vb, 3, nv ); |
|
|
0
|
|
|
|
|
|
489
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
# Note that we return j on the stack first |
491
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
void |
493
|
|
|
|
|
|
|
palDjcal(ndp, djm) |
494
|
|
|
|
|
|
|
int ndp |
495
|
|
|
|
|
|
|
double djm |
496
|
|
|
|
|
|
|
PREINIT: |
497
|
|
|
|
|
|
|
int iymdf[4]; |
498
|
|
|
|
|
|
|
int j; |
499
|
|
|
|
|
|
|
PPCODE: |
500
|
0
|
|
|
|
|
|
palDjcal(ndp, djm, iymdf, &j); |
501
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(j))); |
502
|
0
|
0
|
|
|
|
|
RETVEC(iymdf, 4, iv); |
|
|
0
|
|
|
|
|
|
503
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
# MJD to UT |
505
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
void |
507
|
|
|
|
|
|
|
palDjcl(mjd) |
508
|
|
|
|
|
|
|
double mjd |
509
|
|
|
|
|
|
|
PREINIT: |
510
|
|
|
|
|
|
|
int iy; |
511
|
|
|
|
|
|
|
int im; |
512
|
|
|
|
|
|
|
int id; |
513
|
|
|
|
|
|
|
double fd; |
514
|
|
|
|
|
|
|
int j; |
515
|
|
|
|
|
|
|
PPCODE: |
516
|
1
|
|
|
|
|
|
palDjcl(mjd, &iy, &im, &id, &fd, &j); |
517
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(iy))); |
518
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(im))); |
519
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(id))); |
520
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(fd))); |
521
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(j))); |
522
|
|
|
|
|
|
|
|
523
|
|
|
|
|
|
|
void |
524
|
|
|
|
|
|
|
palDm2av(rmatv) |
525
|
|
|
|
|
|
|
double * rmatv |
526
|
|
|
|
|
|
|
PREINIT: |
527
|
|
|
|
|
|
|
double rmat[3][3]; |
528
|
|
|
|
|
|
|
double axvec[3]; |
529
|
|
|
|
|
|
|
PPCODE: |
530
|
0
|
0
|
|
|
|
|
VECTOMAT( rmatv, rmat ); |
|
|
0
|
|
|
|
|
|
531
|
0
|
|
|
|
|
|
palDm2av( rmat, axvec); |
532
|
0
|
0
|
|
|
|
|
RETVEC( axvec, 3, nv ); |
|
|
0
|
|
|
|
|
|
533
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
###### FLAG: Do palDmat at the end |
536
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
void |
538
|
|
|
|
|
|
|
palDmoon(date) |
539
|
|
|
|
|
|
|
double date |
540
|
|
|
|
|
|
|
PREINIT: |
541
|
|
|
|
|
|
|
double pv[6]; |
542
|
|
|
|
|
|
|
PPCODE: |
543
|
181
|
|
|
|
|
|
palDmoon(date, pv); |
544
|
1267
|
50
|
|
|
|
|
RETVEC( pv, 6, nv ); |
|
|
100
|
|
|
|
|
|
545
|
|
|
|
|
|
|
|
546
|
|
|
|
|
|
|
#### FLAG : Matrix manipulation should be using PDLs |
547
|
|
|
|
|
|
|
|
548
|
|
|
|
|
|
|
void |
549
|
|
|
|
|
|
|
palDmxm(a, b) |
550
|
|
|
|
|
|
|
double * a |
551
|
|
|
|
|
|
|
double * b |
552
|
|
|
|
|
|
|
PREINIT: |
553
|
|
|
|
|
|
|
double amat[3][3]; |
554
|
|
|
|
|
|
|
double bmat[3][3]; |
555
|
|
|
|
|
|
|
double cmat[3][3]; |
556
|
|
|
|
|
|
|
PPCODE: |
557
|
0
|
0
|
|
|
|
|
VECTOMAT( a, amat ); |
|
|
0
|
|
|
|
|
|
558
|
0
|
0
|
|
|
|
|
VECTOMAT( b, bmat ); |
|
|
0
|
|
|
|
|
|
559
|
0
|
|
|
|
|
|
palDmxm(amat,bmat,cmat); |
560
|
0
|
0
|
|
|
|
|
RETMATRIX(cmat); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
void |
563
|
|
|
|
|
|
|
palDmxv(dm, va) |
564
|
|
|
|
|
|
|
double * dm |
565
|
|
|
|
|
|
|
double * va |
566
|
|
|
|
|
|
|
PREINIT: |
567
|
|
|
|
|
|
|
double dmat[3][3]; |
568
|
|
|
|
|
|
|
double vb[3]; |
569
|
|
|
|
|
|
|
PPCODE: |
570
|
2379
|
100
|
|
|
|
|
VECTOMAT( dm, dmat ); |
|
|
100
|
|
|
|
|
|
571
|
183
|
|
|
|
|
|
palDmxv(dmat, va, vb); |
572
|
732
|
50
|
|
|
|
|
RETVEC( vb, 3, nv ); |
|
|
100
|
|
|
|
|
|
573
|
|
|
|
|
|
|
|
574
|
|
|
|
|
|
|
double |
575
|
|
|
|
|
|
|
palDpav(v1, v2) |
576
|
|
|
|
|
|
|
double * v1 |
577
|
|
|
|
|
|
|
double * v2 |
578
|
|
|
|
|
|
|
CODE: |
579
|
0
|
|
|
|
|
|
RETVAL = palDpav(v1, v2); |
580
|
|
|
|
|
|
|
OUTPUT: |
581
|
|
|
|
|
|
|
RETVAL |
582
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
# Converts radians to DMS |
584
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
void |
586
|
|
|
|
|
|
|
palDr2af(ndp, angle) |
587
|
|
|
|
|
|
|
int ndp |
588
|
|
|
|
|
|
|
double angle |
589
|
|
|
|
|
|
|
PREINIT: |
590
|
|
|
|
|
|
|
char sign; |
591
|
|
|
|
|
|
|
int idmsf[4]; |
592
|
|
|
|
|
|
|
PPCODE: |
593
|
31
|
|
|
|
|
|
palDr2af(ndp, angle, &sign, idmsf); |
594
|
31
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVpvn(&sign, 1))); |
595
|
155
|
50
|
|
|
|
|
RETVEC( idmsf, 4, iv ); |
|
|
100
|
|
|
|
|
|
596
|
|
|
|
|
|
|
|
597
|
|
|
|
|
|
|
# Converts radians to HMS |
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
void |
600
|
|
|
|
|
|
|
palDr2tf(ndp, angle) |
601
|
|
|
|
|
|
|
int ndp |
602
|
|
|
|
|
|
|
double angle |
603
|
|
|
|
|
|
|
PREINIT: |
604
|
|
|
|
|
|
|
char sign; |
605
|
|
|
|
|
|
|
int ihmsf[4]; |
606
|
|
|
|
|
|
|
PPCODE: |
607
|
29
|
|
|
|
|
|
palDr2tf(ndp, angle, &sign, ihmsf); |
608
|
29
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVpvn(&sign, 1))); |
609
|
145
|
50
|
|
|
|
|
RETVEC( ihmsf, 4, iv ); |
|
|
100
|
|
|
|
|
|
610
|
|
|
|
|
|
|
|
611
|
|
|
|
|
|
|
double |
612
|
|
|
|
|
|
|
palDrange(angle) |
613
|
|
|
|
|
|
|
double angle |
614
|
|
|
|
|
|
|
CODE: |
615
|
0
|
|
|
|
|
|
RETVAL = palDrange(angle); |
616
|
|
|
|
|
|
|
OUTPUT: |
617
|
|
|
|
|
|
|
RETVAL |
618
|
|
|
|
|
|
|
|
619
|
|
|
|
|
|
|
double |
620
|
|
|
|
|
|
|
palDranrm(angle) |
621
|
|
|
|
|
|
|
double angle |
622
|
|
|
|
|
|
|
CODE: |
623
|
29
|
|
|
|
|
|
RETVAL = palDranrm(angle); |
624
|
|
|
|
|
|
|
OUTPUT: |
625
|
|
|
|
|
|
|
RETVAL |
626
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
void |
628
|
|
|
|
|
|
|
palDs2tp(ra, dec, raz, decz) |
629
|
|
|
|
|
|
|
double ra |
630
|
|
|
|
|
|
|
double dec |
631
|
|
|
|
|
|
|
double raz |
632
|
|
|
|
|
|
|
double decz |
633
|
|
|
|
|
|
|
PREINIT: |
634
|
|
|
|
|
|
|
double xi; |
635
|
|
|
|
|
|
|
double eta; |
636
|
|
|
|
|
|
|
int j; |
637
|
|
|
|
|
|
|
PPCODE: |
638
|
0
|
|
|
|
|
|
palDs2tp(ra, dec, raz, decz, &xi, &eta, &j); |
639
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(xi))); |
640
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(eta))); |
641
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(j))); |
642
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
double |
644
|
|
|
|
|
|
|
palDsep(a1, b1, a2, b2) |
645
|
|
|
|
|
|
|
double a1 |
646
|
|
|
|
|
|
|
double b1 |
647
|
|
|
|
|
|
|
double a2 |
648
|
|
|
|
|
|
|
double b2 |
649
|
|
|
|
|
|
|
CODE: |
650
|
181
|
|
|
|
|
|
RETVAL = palDsep(a1, b1, a2, b2); |
651
|
|
|
|
|
|
|
OUTPUT: |
652
|
|
|
|
|
|
|
RETVAL |
653
|
|
|
|
|
|
|
|
654
|
|
|
|
|
|
|
double |
655
|
|
|
|
|
|
|
palDsepv( v1, v2 ) |
656
|
|
|
|
|
|
|
double * v1 |
657
|
|
|
|
|
|
|
double * v2 |
658
|
|
|
|
|
|
|
CODE: |
659
|
0
|
|
|
|
|
|
RETVAL = palDsepv( v1, v2 ); |
660
|
|
|
|
|
|
|
OUTPUT: |
661
|
|
|
|
|
|
|
RETVAL |
662
|
|
|
|
|
|
|
|
663
|
|
|
|
|
|
|
double |
664
|
|
|
|
|
|
|
palDt(epoch) |
665
|
|
|
|
|
|
|
double epoch |
666
|
|
|
|
|
|
|
CODE: |
667
|
0
|
|
|
|
|
|
RETVAL = palDt(epoch); |
668
|
|
|
|
|
|
|
OUTPUT: |
669
|
|
|
|
|
|
|
RETVAL |
670
|
|
|
|
|
|
|
|
671
|
|
|
|
|
|
|
void |
672
|
|
|
|
|
|
|
palDtf2d(ihour, imin, sec) |
673
|
|
|
|
|
|
|
int ihour |
674
|
|
|
|
|
|
|
int imin |
675
|
|
|
|
|
|
|
double sec |
676
|
|
|
|
|
|
|
PREINIT: |
677
|
|
|
|
|
|
|
double days; |
678
|
|
|
|
|
|
|
int j; |
679
|
|
|
|
|
|
|
PPCODE: |
680
|
183
|
|
|
|
|
|
palDtf2d(ihour, imin, sec, &days, &j); |
681
|
183
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(days))); |
682
|
183
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(j))); |
683
|
|
|
|
|
|
|
|
684
|
|
|
|
|
|
|
# Converts HMS to radians |
685
|
|
|
|
|
|
|
|
686
|
|
|
|
|
|
|
void |
687
|
|
|
|
|
|
|
palDtf2r(ihour, imin, sec) |
688
|
|
|
|
|
|
|
int ihour |
689
|
|
|
|
|
|
|
int imin |
690
|
|
|
|
|
|
|
double sec |
691
|
|
|
|
|
|
|
PREINIT: |
692
|
|
|
|
|
|
|
double rad; |
693
|
|
|
|
|
|
|
int j; |
694
|
|
|
|
|
|
|
PPCODE: |
695
|
5
|
|
|
|
|
|
palDtf2r(ihour, imin, sec, &rad, &j); |
696
|
5
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(rad))); |
697
|
5
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(j))); |
698
|
|
|
|
|
|
|
|
699
|
|
|
|
|
|
|
|
700
|
|
|
|
|
|
|
void |
701
|
|
|
|
|
|
|
palDtp2s(xi, eta, raz, decz) |
702
|
|
|
|
|
|
|
double xi |
703
|
|
|
|
|
|
|
double eta |
704
|
|
|
|
|
|
|
double raz |
705
|
|
|
|
|
|
|
double decz |
706
|
|
|
|
|
|
|
PREINIT: |
707
|
|
|
|
|
|
|
double ra; |
708
|
|
|
|
|
|
|
double dec; |
709
|
|
|
|
|
|
|
PPCODE: |
710
|
0
|
|
|
|
|
|
palDtp2s(xi, eta, raz, decz, &ra, &dec); |
711
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(ra))); |
712
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dec))); |
713
|
|
|
|
|
|
|
|
714
|
|
|
|
|
|
|
void |
715
|
|
|
|
|
|
|
palDtps2c(xi, eta, ra, dec) |
716
|
|
|
|
|
|
|
double xi |
717
|
|
|
|
|
|
|
double eta |
718
|
|
|
|
|
|
|
double ra |
719
|
|
|
|
|
|
|
double dec |
720
|
|
|
|
|
|
|
PREINIT: |
721
|
|
|
|
|
|
|
double raz1; |
722
|
|
|
|
|
|
|
double decz1; |
723
|
|
|
|
|
|
|
double raz2; |
724
|
|
|
|
|
|
|
double decz2; |
725
|
|
|
|
|
|
|
int n; |
726
|
|
|
|
|
|
|
PPCODE: |
727
|
0
|
|
|
|
|
|
palDtps2c(xi, eta, ra, dec, &raz1, &decz1, &raz2, &decz2, &n); |
728
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(raz1))); |
729
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(decz1))); |
730
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(raz2))); |
731
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(decz2))); |
732
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(n))); |
733
|
|
|
|
|
|
|
|
734
|
|
|
|
|
|
|
double |
735
|
|
|
|
|
|
|
palDtt(dju) |
736
|
|
|
|
|
|
|
double dju |
737
|
|
|
|
|
|
|
CODE: |
738
|
4
|
|
|
|
|
|
RETVAL = palDtt(dju); |
739
|
|
|
|
|
|
|
OUTPUT: |
740
|
|
|
|
|
|
|
RETVAL |
741
|
|
|
|
|
|
|
|
742
|
|
|
|
|
|
|
double |
743
|
|
|
|
|
|
|
palDvdv(va, vb) |
744
|
|
|
|
|
|
|
double * va |
745
|
|
|
|
|
|
|
double * vb |
746
|
|
|
|
|
|
|
CODE: |
747
|
0
|
|
|
|
|
|
RETVAL = palDvdv(va, vb); |
748
|
|
|
|
|
|
|
OUTPUT: |
749
|
|
|
|
|
|
|
RETVAL |
750
|
|
|
|
|
|
|
|
751
|
|
|
|
|
|
|
# vm is returned on the stack first |
752
|
|
|
|
|
|
|
|
753
|
|
|
|
|
|
|
void |
754
|
|
|
|
|
|
|
palDvn(v) |
755
|
|
|
|
|
|
|
double * v |
756
|
|
|
|
|
|
|
PREINIT: |
757
|
|
|
|
|
|
|
double uv[3]; |
758
|
|
|
|
|
|
|
double vm; |
759
|
|
|
|
|
|
|
PPCODE: |
760
|
0
|
|
|
|
|
|
palDvn(v, uv, &vm); |
761
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(vm))); |
762
|
0
|
0
|
|
|
|
|
RETVEC(uv, 3, nv ); |
|
|
0
|
|
|
|
|
|
763
|
|
|
|
|
|
|
|
764
|
|
|
|
|
|
|
void |
765
|
|
|
|
|
|
|
palDvxv(va, vb) |
766
|
|
|
|
|
|
|
double * va |
767
|
|
|
|
|
|
|
double * vb |
768
|
|
|
|
|
|
|
PREINIT: |
769
|
|
|
|
|
|
|
double vc[3]; |
770
|
|
|
|
|
|
|
PPCODE: |
771
|
0
|
|
|
|
|
|
palDvxv(va,vb,vc); |
772
|
0
|
0
|
|
|
|
|
RETVEC(vc, 3, nv ); |
|
|
0
|
|
|
|
|
|
773
|
|
|
|
|
|
|
|
774
|
|
|
|
|
|
|
void |
775
|
|
|
|
|
|
|
palEcmat(date) |
776
|
|
|
|
|
|
|
double date |
777
|
|
|
|
|
|
|
PREINIT: |
778
|
|
|
|
|
|
|
double rmat[3][3]; |
779
|
|
|
|
|
|
|
PPCODE: |
780
|
0
|
|
|
|
|
|
palEcmat(date, rmat); |
781
|
0
|
0
|
|
|
|
|
RETMATRIX(rmat); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
782
|
|
|
|
|
|
|
|
783
|
|
|
|
|
|
|
void |
784
|
|
|
|
|
|
|
palEcleq(dl, db, date) |
785
|
|
|
|
|
|
|
double dl |
786
|
|
|
|
|
|
|
double db |
787
|
|
|
|
|
|
|
double date |
788
|
|
|
|
|
|
|
PREINIT: |
789
|
|
|
|
|
|
|
double dr; |
790
|
|
|
|
|
|
|
double dd; |
791
|
|
|
|
|
|
|
PPCODE: |
792
|
1
|
|
|
|
|
|
palEcleq(dl, db, date, &dr, &dd); |
793
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dr))); |
794
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dd))); |
795
|
|
|
|
|
|
|
|
796
|
|
|
|
|
|
|
# TODO: palEl2ue goes here |
797
|
|
|
|
|
|
|
|
798
|
|
|
|
|
|
|
|
799
|
|
|
|
|
|
|
double |
800
|
|
|
|
|
|
|
palEpb(date) |
801
|
|
|
|
|
|
|
double date |
802
|
|
|
|
|
|
|
CODE: |
803
|
1
|
|
|
|
|
|
RETVAL = palEpb(date); |
804
|
|
|
|
|
|
|
OUTPUT: |
805
|
|
|
|
|
|
|
RETVAL |
806
|
|
|
|
|
|
|
|
807
|
|
|
|
|
|
|
double |
808
|
|
|
|
|
|
|
palEpb2d(epb) |
809
|
|
|
|
|
|
|
double epb |
810
|
|
|
|
|
|
|
CODE: |
811
|
1
|
|
|
|
|
|
RETVAL = palEpb2d(epb); |
812
|
|
|
|
|
|
|
OUTPUT: |
813
|
|
|
|
|
|
|
RETVAL |
814
|
|
|
|
|
|
|
|
815
|
|
|
|
|
|
|
double |
816
|
|
|
|
|
|
|
palEpco(k0, k, e) |
817
|
|
|
|
|
|
|
char k0 |
818
|
|
|
|
|
|
|
char k |
819
|
|
|
|
|
|
|
double e |
820
|
|
|
|
|
|
|
CODE: |
821
|
0
|
|
|
|
|
|
RETVAL = palEpco(k0, k, e); |
822
|
|
|
|
|
|
|
OUTPUT: |
823
|
|
|
|
|
|
|
RETVAL |
824
|
|
|
|
|
|
|
|
825
|
|
|
|
|
|
|
double |
826
|
|
|
|
|
|
|
palEpj(date) |
827
|
|
|
|
|
|
|
double date |
828
|
|
|
|
|
|
|
CODE: |
829
|
181
|
|
|
|
|
|
RETVAL = palEpj(date); |
830
|
|
|
|
|
|
|
OUTPUT: |
831
|
|
|
|
|
|
|
RETVAL |
832
|
|
|
|
|
|
|
|
833
|
|
|
|
|
|
|
|
834
|
|
|
|
|
|
|
double |
835
|
|
|
|
|
|
|
palEpj2d(epj) |
836
|
|
|
|
|
|
|
double epj |
837
|
|
|
|
|
|
|
CODE: |
838
|
2
|
|
|
|
|
|
RETVAL = palEpj2d(epj); |
839
|
|
|
|
|
|
|
OUTPUT: |
840
|
|
|
|
|
|
|
RETVAL |
841
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
# palEpv returns 4 3-vectors so we must put them |
843
|
|
|
|
|
|
|
# into individual arrays and return references on the stack. |
844
|
|
|
|
|
|
|
|
845
|
|
|
|
|
|
|
void |
846
|
|
|
|
|
|
|
palEpv( date ) |
847
|
|
|
|
|
|
|
double date |
848
|
|
|
|
|
|
|
PREINIT: |
849
|
|
|
|
|
|
|
double ph[3]; |
850
|
|
|
|
|
|
|
double vh[3]; |
851
|
|
|
|
|
|
|
double pb[3]; |
852
|
|
|
|
|
|
|
double vb[3]; |
853
|
|
|
|
|
|
|
AV * pph; |
854
|
|
|
|
|
|
|
AV * pvh; |
855
|
|
|
|
|
|
|
AV * ppb; |
856
|
|
|
|
|
|
|
AV * pvb; |
857
|
|
|
|
|
|
|
PPCODE: |
858
|
0
|
|
|
|
|
|
palEpv( date, ph, vh, pb, vb ); |
859
|
|
|
|
|
|
|
|
860
|
0
|
|
|
|
|
|
pph = newAV(); |
861
|
0
|
|
|
|
|
|
unpack1D( newRV_noinc((SV*)pph), ph, 'd', 3 ); |
862
|
0
|
0
|
|
|
|
|
XPUSHs( newRV_noinc((SV*)pph)); |
863
|
0
|
|
|
|
|
|
pvh = newAV(); |
864
|
0
|
|
|
|
|
|
unpack1D( newRV_noinc((SV*)pvh), vh, 'd', 3 ); |
865
|
0
|
0
|
|
|
|
|
XPUSHs( newRV_noinc((SV*)pvh)); |
866
|
0
|
|
|
|
|
|
ppb = newAV(); |
867
|
0
|
|
|
|
|
|
unpack1D( newRV_noinc((SV*)ppb), pb, 'd', 3 ); |
868
|
0
|
0
|
|
|
|
|
XPUSHs( newRV_noinc((SV*)ppb)); |
869
|
0
|
|
|
|
|
|
pvb = newAV(); |
870
|
0
|
|
|
|
|
|
unpack1D( newRV_noinc((SV*)pvb), vb, 'd', 3 ); |
871
|
0
|
0
|
|
|
|
|
XPUSHs( newRV_noinc((SV*)pvb)); |
872
|
|
|
|
|
|
|
|
873
|
|
|
|
|
|
|
|
874
|
|
|
|
|
|
|
void |
875
|
|
|
|
|
|
|
palEqecl(dr, dd, date) |
876
|
|
|
|
|
|
|
double dr |
877
|
|
|
|
|
|
|
double dd |
878
|
|
|
|
|
|
|
double date |
879
|
|
|
|
|
|
|
PREINIT: |
880
|
|
|
|
|
|
|
double dl; |
881
|
|
|
|
|
|
|
double db; |
882
|
|
|
|
|
|
|
PPCODE: |
883
|
0
|
|
|
|
|
|
palEqecl(dr, dd, date, &dl, &db); |
884
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dl))); |
885
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(db))); |
886
|
|
|
|
|
|
|
|
887
|
|
|
|
|
|
|
# Equation of the equinoxes |
888
|
|
|
|
|
|
|
|
889
|
|
|
|
|
|
|
double |
890
|
|
|
|
|
|
|
palEqeqx(date) |
891
|
|
|
|
|
|
|
double date |
892
|
|
|
|
|
|
|
CODE: |
893
|
3
|
|
|
|
|
|
RETVAL = palEqeqx(date); |
894
|
|
|
|
|
|
|
OUTPUT: |
895
|
|
|
|
|
|
|
RETVAL |
896
|
|
|
|
|
|
|
|
897
|
|
|
|
|
|
|
void |
898
|
|
|
|
|
|
|
palEqgal(dr, dd) |
899
|
|
|
|
|
|
|
double dr |
900
|
|
|
|
|
|
|
double dd |
901
|
|
|
|
|
|
|
PREINIT: |
902
|
|
|
|
|
|
|
double dl; |
903
|
|
|
|
|
|
|
double db; |
904
|
|
|
|
|
|
|
PPCODE: |
905
|
0
|
|
|
|
|
|
palEqgal(dr, dd, &dl, &db); |
906
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dl))); |
907
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(db))); |
908
|
|
|
|
|
|
|
|
909
|
|
|
|
|
|
|
void |
910
|
|
|
|
|
|
|
palEtrms(ep) |
911
|
|
|
|
|
|
|
double ep |
912
|
|
|
|
|
|
|
PREINIT: |
913
|
|
|
|
|
|
|
double ev[3]; |
914
|
|
|
|
|
|
|
PPCODE: |
915
|
0
|
|
|
|
|
|
palEtrms(ep, ev); |
916
|
0
|
0
|
|
|
|
|
RETVEC(ev, 3, nv ); |
|
|
0
|
|
|
|
|
|
917
|
|
|
|
|
|
|
|
918
|
|
|
|
|
|
|
void |
919
|
|
|
|
|
|
|
palEvp(date, deqx) |
920
|
|
|
|
|
|
|
double date |
921
|
|
|
|
|
|
|
double deqx |
922
|
|
|
|
|
|
|
PREINIT: |
923
|
|
|
|
|
|
|
double dvb[3]; |
924
|
|
|
|
|
|
|
double dpb[3]; |
925
|
|
|
|
|
|
|
double dvh[3]; |
926
|
|
|
|
|
|
|
double dph[3]; |
927
|
|
|
|
|
|
|
AV * pdvb; |
928
|
|
|
|
|
|
|
AV * pdpb; |
929
|
|
|
|
|
|
|
AV * pdvh; |
930
|
|
|
|
|
|
|
AV * pdph; |
931
|
|
|
|
|
|
|
PPCODE: |
932
|
1
|
|
|
|
|
|
palEvp(date, deqx, dvb, dpb, dvh, dph); |
933
|
|
|
|
|
|
|
|
934
|
1
|
|
|
|
|
|
pdvb = newAV(); |
935
|
1
|
|
|
|
|
|
unpack1D( newRV_noinc((SV*)pdvb), dvb, 'd', 3 ); |
936
|
1
|
50
|
|
|
|
|
XPUSHs( newRV_noinc((SV*)pdvb)); |
937
|
1
|
|
|
|
|
|
pdpb = newAV(); |
938
|
1
|
|
|
|
|
|
unpack1D( newRV_noinc((SV*)pdpb), dpb, 'd', 3 ); |
939
|
1
|
50
|
|
|
|
|
XPUSHs( newRV_noinc((SV*)pdpb)); |
940
|
1
|
|
|
|
|
|
pdvh = newAV(); |
941
|
1
|
|
|
|
|
|
unpack1D( newRV_noinc((SV*)pdvh), dvh, 'd', 3 ); |
942
|
1
|
50
|
|
|
|
|
XPUSHs( newRV_noinc((SV*)pdvh)); |
943
|
1
|
|
|
|
|
|
pdph = newAV(); |
944
|
1
|
|
|
|
|
|
unpack1D( newRV_noinc((SV*)pdph), dph, 'd', 3 ); |
945
|
1
|
50
|
|
|
|
|
XPUSHs( newRV_noinc((SV*)pdph)); |
946
|
|
|
|
|
|
|
|
947
|
|
|
|
|
|
|
|
948
|
|
|
|
|
|
|
void |
949
|
|
|
|
|
|
|
palFk45z(r1950, d1950, bepoch) |
950
|
|
|
|
|
|
|
double r1950 |
951
|
|
|
|
|
|
|
double d1950 |
952
|
|
|
|
|
|
|
double bepoch |
953
|
|
|
|
|
|
|
PREINIT: |
954
|
|
|
|
|
|
|
double r2000; |
955
|
|
|
|
|
|
|
double d2000; |
956
|
|
|
|
|
|
|
PPCODE: |
957
|
4
|
|
|
|
|
|
palFk45z(r1950, d1950, bepoch, &r2000, &d2000); |
958
|
4
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(r2000))); |
959
|
4
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(d2000))); |
960
|
|
|
|
|
|
|
|
961
|
|
|
|
|
|
|
|
962
|
|
|
|
|
|
|
void |
963
|
|
|
|
|
|
|
palFk524(r2000,d2000,dr2000,dd2000,p2000,v2000) |
964
|
|
|
|
|
|
|
double r2000 |
965
|
|
|
|
|
|
|
double d2000 |
966
|
|
|
|
|
|
|
double dr2000 |
967
|
|
|
|
|
|
|
double dd2000 |
968
|
|
|
|
|
|
|
double p2000 |
969
|
|
|
|
|
|
|
double v2000 |
970
|
|
|
|
|
|
|
PREINIT: |
971
|
|
|
|
|
|
|
double r1950; |
972
|
|
|
|
|
|
|
double d1950; |
973
|
|
|
|
|
|
|
double dr1950; |
974
|
|
|
|
|
|
|
double dd1950; |
975
|
|
|
|
|
|
|
double p1950; |
976
|
|
|
|
|
|
|
double v1950; |
977
|
|
|
|
|
|
|
PPCODE: |
978
|
0
|
|
|
|
|
|
palFk524(r2000,d2000,dr2000,dd2000,p2000,v2000, |
979
|
|
|
|
|
|
|
&r1950,&d1950,&dr1950,&dd1950,&p1950,&v1950); |
980
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(r1950))); |
981
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(d1950))); |
982
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dr1950))); |
983
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dd1950))); |
984
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(p1950))); |
985
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(v1950))); |
986
|
|
|
|
|
|
|
|
987
|
|
|
|
|
|
|
void |
988
|
|
|
|
|
|
|
palFk54z(r2000, d2000, bepoch) |
989
|
|
|
|
|
|
|
double r2000 |
990
|
|
|
|
|
|
|
double d2000 |
991
|
|
|
|
|
|
|
double bepoch |
992
|
|
|
|
|
|
|
PREINIT: |
993
|
|
|
|
|
|
|
double r1950; |
994
|
|
|
|
|
|
|
double d1950; |
995
|
|
|
|
|
|
|
double dr1950; |
996
|
|
|
|
|
|
|
double dd1950; |
997
|
|
|
|
|
|
|
PPCODE: |
998
|
0
|
|
|
|
|
|
palFk54z(r2000, d2000, bepoch, &r1950, &d1950, &dr1950, &dd1950); |
999
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(r1950))); |
1000
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(d1950))); |
1001
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dr1950))); |
1002
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dd1950))); |
1003
|
|
|
|
|
|
|
|
1004
|
|
|
|
|
|
|
void |
1005
|
|
|
|
|
|
|
palFitxy(itype, xye, xym) |
1006
|
|
|
|
|
|
|
int itype |
1007
|
|
|
|
|
|
|
AV * xye |
1008
|
|
|
|
|
|
|
AV * xym |
1009
|
|
|
|
|
|
|
PREINIT: |
1010
|
|
|
|
|
|
|
int np; |
1011
|
|
|
|
|
|
|
double coeffs[6]; |
1012
|
|
|
|
|
|
|
int j; |
1013
|
|
|
|
|
|
|
AV * pcoeffs; |
1014
|
|
|
|
|
|
|
PPCODE: |
1015
|
2
|
|
|
|
|
|
np = (av_len(xye) + 1) / 2; |
1016
|
2
|
|
|
|
|
|
double mxye[np][2]; |
1017
|
2
|
|
|
|
|
|
double mxym[np][2]; |
1018
|
50
|
50
|
|
|
|
|
ARRAYTOMAT(xye, mxye, np, 2); |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1019
|
50
|
50
|
|
|
|
|
ARRAYTOMAT(xym, mxym, np, 2); |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1020
|
2
|
|
|
|
|
|
palFitxy(itype, np, mxye, mxym, coeffs, &j); |
1021
|
2
|
|
|
|
|
|
pcoeffs = newAV(); |
1022
|
2
|
|
|
|
|
|
unpack1D(newRV_noinc((SV*)pcoeffs), coeffs, 'd', 6); |
1023
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(j))); |
1024
|
2
|
50
|
|
|
|
|
XPUSHs(newRV_noinc((SV*)pcoeffs)); |
1025
|
|
|
|
|
|
|
|
1026
|
|
|
|
|
|
|
void |
1027
|
|
|
|
|
|
|
palGaleq(dl, db) |
1028
|
|
|
|
|
|
|
double dl |
1029
|
|
|
|
|
|
|
double db |
1030
|
|
|
|
|
|
|
PREINIT: |
1031
|
|
|
|
|
|
|
double dr; |
1032
|
|
|
|
|
|
|
double dd; |
1033
|
|
|
|
|
|
|
PPCODE: |
1034
|
0
|
|
|
|
|
|
palGaleq(dl, db, &dr, &dd); |
1035
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dr))); |
1036
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dd))); |
1037
|
|
|
|
|
|
|
|
1038
|
|
|
|
|
|
|
|
1039
|
|
|
|
|
|
|
void |
1040
|
|
|
|
|
|
|
palGalsup(dl, db) |
1041
|
|
|
|
|
|
|
double dl |
1042
|
|
|
|
|
|
|
double db |
1043
|
|
|
|
|
|
|
PREINIT: |
1044
|
|
|
|
|
|
|
double dsl; |
1045
|
|
|
|
|
|
|
double dsb; |
1046
|
|
|
|
|
|
|
PPCODE: |
1047
|
0
|
|
|
|
|
|
palGalsup(dl, db, &dsl, &dsb); |
1048
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dsl))); |
1049
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dsb))); |
1050
|
|
|
|
|
|
|
|
1051
|
|
|
|
|
|
|
void |
1052
|
|
|
|
|
|
|
palGe50( dl, db ) |
1053
|
|
|
|
|
|
|
double dl |
1054
|
|
|
|
|
|
|
double db |
1055
|
|
|
|
|
|
|
PREINIT: |
1056
|
|
|
|
|
|
|
double dr; |
1057
|
|
|
|
|
|
|
double dd; |
1058
|
|
|
|
|
|
|
PPCODE: |
1059
|
0
|
|
|
|
|
|
palGe50(dl, db, &dr, &dd); |
1060
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dr))); |
1061
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dd))); |
1062
|
|
|
|
|
|
|
|
1063
|
|
|
|
|
|
|
void |
1064
|
|
|
|
|
|
|
palGeoc(p, h) |
1065
|
|
|
|
|
|
|
double p |
1066
|
|
|
|
|
|
|
double h |
1067
|
|
|
|
|
|
|
PREINIT: |
1068
|
|
|
|
|
|
|
double r; |
1069
|
|
|
|
|
|
|
double z; |
1070
|
|
|
|
|
|
|
PPCODE: |
1071
|
0
|
|
|
|
|
|
palGeoc(p, h, &r, &z); |
1072
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(r))); |
1073
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(z))); |
1074
|
|
|
|
|
|
|
|
1075
|
|
|
|
|
|
|
# UT to GMST |
1076
|
|
|
|
|
|
|
|
1077
|
|
|
|
|
|
|
double |
1078
|
|
|
|
|
|
|
palGmst(ut1) |
1079
|
|
|
|
|
|
|
double ut1 |
1080
|
|
|
|
|
|
|
CODE: |
1081
|
1
|
|
|
|
|
|
RETVAL = palGmst(ut1); |
1082
|
|
|
|
|
|
|
OUTPUT: |
1083
|
|
|
|
|
|
|
RETVAL |
1084
|
|
|
|
|
|
|
|
1085
|
|
|
|
|
|
|
double |
1086
|
|
|
|
|
|
|
palGmsta(date, ut) |
1087
|
|
|
|
|
|
|
double date |
1088
|
|
|
|
|
|
|
double ut |
1089
|
|
|
|
|
|
|
CODE: |
1090
|
2
|
|
|
|
|
|
RETVAL = palGmsta(date, ut); |
1091
|
|
|
|
|
|
|
OUTPUT: |
1092
|
|
|
|
|
|
|
RETVAL |
1093
|
|
|
|
|
|
|
|
1094
|
|
|
|
|
|
|
void |
1095
|
|
|
|
|
|
|
palHfk5z(rh, dh, epoch) |
1096
|
|
|
|
|
|
|
double rh |
1097
|
|
|
|
|
|
|
double dh |
1098
|
|
|
|
|
|
|
double epoch |
1099
|
|
|
|
|
|
|
PREINIT: |
1100
|
|
|
|
|
|
|
double r5; |
1101
|
|
|
|
|
|
|
double d5; |
1102
|
|
|
|
|
|
|
double dr5; |
1103
|
|
|
|
|
|
|
double dd5; |
1104
|
|
|
|
|
|
|
PPCODE: |
1105
|
0
|
|
|
|
|
|
palHfk5z(rh,dh,epoch,&r5,&d5,&dr5,&dd5); |
1106
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(r5))); |
1107
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(d5))); |
1108
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dr5))); |
1109
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dd5))); |
1110
|
|
|
|
|
|
|
|
1111
|
|
|
|
|
|
|
# Note that nstrt is given and then returned on the stack |
1112
|
|
|
|
|
|
|
|
1113
|
|
|
|
|
|
|
void |
1114
|
|
|
|
|
|
|
palIntin(string, nstrt) |
1115
|
|
|
|
|
|
|
char * string |
1116
|
|
|
|
|
|
|
int nstrt |
1117
|
|
|
|
|
|
|
PREINIT: |
1118
|
|
|
|
|
|
|
long ireslt; |
1119
|
|
|
|
|
|
|
int jflag; |
1120
|
|
|
|
|
|
|
PPCODE: |
1121
|
6
|
|
|
|
|
|
palIntin(string, &nstrt, &ireslt, &jflag); |
1122
|
6
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(nstrt))); |
1123
|
6
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(ireslt))); |
1124
|
6
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(jflag))); |
1125
|
|
|
|
|
|
|
|
1126
|
|
|
|
|
|
|
void |
1127
|
|
|
|
|
|
|
palInvf(fwds) |
1128
|
|
|
|
|
|
|
double * fwds |
1129
|
|
|
|
|
|
|
PREINIT: |
1130
|
|
|
|
|
|
|
double bkwds[6]; |
1131
|
|
|
|
|
|
|
int j; |
1132
|
|
|
|
|
|
|
AV * pbkwds; |
1133
|
|
|
|
|
|
|
PPCODE: |
1134
|
1
|
|
|
|
|
|
palInvf(fwds, bkwds, &j); |
1135
|
1
|
|
|
|
|
|
pbkwds = newAV(); |
1136
|
1
|
|
|
|
|
|
unpack1D(newRV_noinc((SV*)pbkwds), bkwds, 'd', 6); |
1137
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(j))); |
1138
|
1
|
50
|
|
|
|
|
XPUSHs(newRV_noinc((SV*)pbkwds)); |
1139
|
|
|
|
|
|
|
|
1140
|
|
|
|
|
|
|
void |
1141
|
|
|
|
|
|
|
palMap(rm, dm, pr, pd, px, rv, eq, date) |
1142
|
|
|
|
|
|
|
double rm |
1143
|
|
|
|
|
|
|
double dm |
1144
|
|
|
|
|
|
|
double pr |
1145
|
|
|
|
|
|
|
double pd |
1146
|
|
|
|
|
|
|
double px |
1147
|
|
|
|
|
|
|
double rv |
1148
|
|
|
|
|
|
|
double eq |
1149
|
|
|
|
|
|
|
double date |
1150
|
|
|
|
|
|
|
PREINIT: |
1151
|
|
|
|
|
|
|
double ra; |
1152
|
|
|
|
|
|
|
double da; |
1153
|
|
|
|
|
|
|
PPCODE: |
1154
|
1
|
|
|
|
|
|
palMap(rm, dm, pr, pd, px, rv, eq, date, &ra, &da); |
1155
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(ra))); |
1156
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(da))); |
1157
|
|
|
|
|
|
|
|
1158
|
|
|
|
|
|
|
|
1159
|
|
|
|
|
|
|
void |
1160
|
|
|
|
|
|
|
palMappa(eq, date) |
1161
|
|
|
|
|
|
|
double eq |
1162
|
|
|
|
|
|
|
double date |
1163
|
|
|
|
|
|
|
PREINIT: |
1164
|
|
|
|
|
|
|
double amprms[21]; |
1165
|
|
|
|
|
|
|
PPCODE: |
1166
|
0
|
|
|
|
|
|
palMappa(eq, date, amprms); |
1167
|
0
|
0
|
|
|
|
|
RETVEC( amprms, 21, nv ); |
|
|
0
|
|
|
|
|
|
1168
|
|
|
|
|
|
|
|
1169
|
|
|
|
|
|
|
void |
1170
|
|
|
|
|
|
|
palMapqk(rm, dm, pr, pd, px, rv, amprms) |
1171
|
|
|
|
|
|
|
double rm |
1172
|
|
|
|
|
|
|
double dm |
1173
|
|
|
|
|
|
|
double pr |
1174
|
|
|
|
|
|
|
double pd |
1175
|
|
|
|
|
|
|
double px |
1176
|
|
|
|
|
|
|
double rv |
1177
|
|
|
|
|
|
|
double * amprms |
1178
|
|
|
|
|
|
|
PREINIT: |
1179
|
|
|
|
|
|
|
double ra; |
1180
|
|
|
|
|
|
|
double da; |
1181
|
|
|
|
|
|
|
PPCODE: |
1182
|
0
|
|
|
|
|
|
palMapqk(rm, dm, pr, pd, px, rv, amprms, &ra, &da); |
1183
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(ra))); |
1184
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(da))); |
1185
|
|
|
|
|
|
|
|
1186
|
|
|
|
|
|
|
void |
1187
|
|
|
|
|
|
|
palMapqkz(rm, dm, amprms) |
1188
|
|
|
|
|
|
|
double rm |
1189
|
|
|
|
|
|
|
double dm |
1190
|
|
|
|
|
|
|
double * amprms |
1191
|
|
|
|
|
|
|
PREINIT: |
1192
|
|
|
|
|
|
|
double ra; |
1193
|
|
|
|
|
|
|
double da; |
1194
|
|
|
|
|
|
|
PPCODE: |
1195
|
0
|
|
|
|
|
|
palMapqkz(rm, dm, amprms, &ra, &da); |
1196
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(ra))); |
1197
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(da))); |
1198
|
|
|
|
|
|
|
|
1199
|
|
|
|
|
|
|
void |
1200
|
|
|
|
|
|
|
palNut(date) |
1201
|
|
|
|
|
|
|
double date |
1202
|
|
|
|
|
|
|
PREINIT: |
1203
|
|
|
|
|
|
|
double rmatn[3][3]; |
1204
|
|
|
|
|
|
|
PPCODE: |
1205
|
1
|
|
|
|
|
|
palNut(date, rmatn); |
1206
|
13
|
50
|
|
|
|
|
RETMATRIX(rmatn); |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1207
|
|
|
|
|
|
|
|
1208
|
|
|
|
|
|
|
void |
1209
|
|
|
|
|
|
|
palNutc(date) |
1210
|
|
|
|
|
|
|
double date |
1211
|
|
|
|
|
|
|
PREINIT: |
1212
|
|
|
|
|
|
|
double dpsi; |
1213
|
|
|
|
|
|
|
double deps; |
1214
|
|
|
|
|
|
|
double eps0; |
1215
|
|
|
|
|
|
|
PPCODE: |
1216
|
0
|
|
|
|
|
|
palNutc(date, &dpsi, &deps, &eps0); |
1217
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dpsi))); |
1218
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(deps))); |
1219
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(eps0))); |
1220
|
|
|
|
|
|
|
|
1221
|
|
|
|
|
|
|
|
1222
|
|
|
|
|
|
|
void |
1223
|
|
|
|
|
|
|
palOap(type, ob1, ob2, date, dut, elongm, phim, hm, xp, yp, tdk, pmb, rh, wl, tlr) |
1224
|
|
|
|
|
|
|
char * type |
1225
|
|
|
|
|
|
|
double ob1 |
1226
|
|
|
|
|
|
|
double ob2 |
1227
|
|
|
|
|
|
|
double date |
1228
|
|
|
|
|
|
|
double dut |
1229
|
|
|
|
|
|
|
double elongm |
1230
|
|
|
|
|
|
|
double phim |
1231
|
|
|
|
|
|
|
double hm |
1232
|
|
|
|
|
|
|
double xp |
1233
|
|
|
|
|
|
|
double yp |
1234
|
|
|
|
|
|
|
double tdk |
1235
|
|
|
|
|
|
|
double pmb |
1236
|
|
|
|
|
|
|
double rh |
1237
|
|
|
|
|
|
|
double wl |
1238
|
|
|
|
|
|
|
double tlr |
1239
|
|
|
|
|
|
|
PREINIT: |
1240
|
|
|
|
|
|
|
double rap; |
1241
|
|
|
|
|
|
|
double dap; |
1242
|
|
|
|
|
|
|
PPCODE: |
1243
|
3
|
|
|
|
|
|
palOap(type, ob1, ob2, date, dut, elongm, phim, hm, xp, yp, tdk, pmb, rh, wl, tlr, &rap, &dap); |
1244
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(rap))); |
1245
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dap))); |
1246
|
|
|
|
|
|
|
|
1247
|
|
|
|
|
|
|
void |
1248
|
|
|
|
|
|
|
palOapqk(type, ob1, ob2, aoprms) |
1249
|
|
|
|
|
|
|
char * type |
1250
|
|
|
|
|
|
|
double ob1 |
1251
|
|
|
|
|
|
|
double ob2 |
1252
|
|
|
|
|
|
|
double * aoprms |
1253
|
|
|
|
|
|
|
PREINIT: |
1254
|
|
|
|
|
|
|
double rap; |
1255
|
|
|
|
|
|
|
double dap; |
1256
|
|
|
|
|
|
|
PPCODE: |
1257
|
3
|
|
|
|
|
|
palOapqk(type, ob1, ob2, aoprms, &rap, &dap); |
1258
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(rap))); |
1259
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dap))); |
1260
|
|
|
|
|
|
|
|
1261
|
|
|
|
|
|
|
# Note that we have a perl layer on top to handle |
1262
|
|
|
|
|
|
|
# the input arguments. Also note that we return |
1263
|
|
|
|
|
|
|
# an empty list if status is not good. |
1264
|
|
|
|
|
|
|
|
1265
|
|
|
|
|
|
|
void |
1266
|
|
|
|
|
|
|
_palObs(n, c) |
1267
|
|
|
|
|
|
|
int n |
1268
|
|
|
|
|
|
|
char * c |
1269
|
|
|
|
|
|
|
PREINIT: |
1270
|
|
|
|
|
|
|
char ident[11]; |
1271
|
|
|
|
|
|
|
char name[41]; |
1272
|
|
|
|
|
|
|
double w; |
1273
|
|
|
|
|
|
|
double p; |
1274
|
|
|
|
|
|
|
double h; |
1275
|
|
|
|
|
|
|
int j; |
1276
|
|
|
|
|
|
|
PPCODE: |
1277
|
11
|
50
|
|
|
|
|
if (n<0) n = 0; /* palObs uses a size_t */ |
1278
|
11
|
|
|
|
|
|
j = palObs(n, c, ident, sizeof(ident), name, sizeof(name), |
1279
|
|
|
|
|
|
|
&w, &p, &h); |
1280
|
11
|
100
|
|
|
|
|
if (j == 0) { |
1281
|
9
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVpvn(ident, strlen(ident)))); |
1282
|
9
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVpvn(name, strlen(name)))); |
1283
|
9
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(w))); |
1284
|
9
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(p))); |
1285
|
9
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(h))); |
1286
|
|
|
|
|
|
|
} else { |
1287
|
2
|
|
|
|
|
|
XSRETURN_EMPTY; |
1288
|
|
|
|
|
|
|
} |
1289
|
|
|
|
|
|
|
|
1290
|
|
|
|
|
|
|
double |
1291
|
|
|
|
|
|
|
palPa(ha, dec, phi) |
1292
|
|
|
|
|
|
|
double ha |
1293
|
|
|
|
|
|
|
double dec |
1294
|
|
|
|
|
|
|
double phi |
1295
|
|
|
|
|
|
|
CODE: |
1296
|
0
|
|
|
|
|
|
RETVAL = palPa(ha, dec, phi); |
1297
|
|
|
|
|
|
|
OUTPUT: |
1298
|
|
|
|
|
|
|
RETVAL |
1299
|
|
|
|
|
|
|
|
1300
|
|
|
|
|
|
|
void |
1301
|
|
|
|
|
|
|
palPcd(disco, x, y) |
1302
|
|
|
|
|
|
|
double disco |
1303
|
|
|
|
|
|
|
double x |
1304
|
|
|
|
|
|
|
double y |
1305
|
|
|
|
|
|
|
PPCODE: |
1306
|
2
|
|
|
|
|
|
palPcd(disco, &x, &y); |
1307
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(x))); |
1308
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(y))); |
1309
|
|
|
|
|
|
|
|
1310
|
|
|
|
|
|
|
void |
1311
|
|
|
|
|
|
|
palPertel(jform,date0,date1,epoch0,orbi0,anode0,perih0,aorq0,e0,am0) |
1312
|
|
|
|
|
|
|
int jform |
1313
|
|
|
|
|
|
|
double date0 |
1314
|
|
|
|
|
|
|
double date1 |
1315
|
|
|
|
|
|
|
double epoch0 |
1316
|
|
|
|
|
|
|
double orbi0 |
1317
|
|
|
|
|
|
|
double anode0 |
1318
|
|
|
|
|
|
|
double perih0 |
1319
|
|
|
|
|
|
|
double aorq0 |
1320
|
|
|
|
|
|
|
double e0 |
1321
|
|
|
|
|
|
|
double am0 |
1322
|
|
|
|
|
|
|
PREINIT: |
1323
|
|
|
|
|
|
|
double epoch1; |
1324
|
|
|
|
|
|
|
double orbi1; |
1325
|
|
|
|
|
|
|
double anode1; |
1326
|
|
|
|
|
|
|
double perih1; |
1327
|
|
|
|
|
|
|
double aorq1; |
1328
|
|
|
|
|
|
|
double e1; |
1329
|
|
|
|
|
|
|
double am1; |
1330
|
|
|
|
|
|
|
int jstat; |
1331
|
|
|
|
|
|
|
PPCODE: |
1332
|
2
|
|
|
|
|
|
jstat = 0; |
1333
|
2
|
|
|
|
|
|
palPertel(jform,date0,date1,epoch0,orbi0,anode0,perih0,aorq0,e0,am0, |
1334
|
|
|
|
|
|
|
&epoch1,&orbi1,&anode1,&perih1,&aorq1,&e1,&am1,&jstat); |
1335
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(epoch1))); |
1336
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(orbi1))); |
1337
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(anode1))); |
1338
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(perih1))); |
1339
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(aorq1))); |
1340
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(e1))); |
1341
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(am1))); |
1342
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(jstat))); |
1343
|
|
|
|
|
|
|
|
1344
|
|
|
|
|
|
|
# Returns updated u |
1345
|
|
|
|
|
|
|
|
1346
|
|
|
|
|
|
|
void |
1347
|
|
|
|
|
|
|
palPertue(date, u) |
1348
|
|
|
|
|
|
|
double date |
1349
|
|
|
|
|
|
|
double * u |
1350
|
|
|
|
|
|
|
PREINIT: |
1351
|
|
|
|
|
|
|
int jstat; |
1352
|
|
|
|
|
|
|
PPCODE: |
1353
|
0
|
|
|
|
|
|
jstat = 0; |
1354
|
0
|
|
|
|
|
|
palPertue(date,u,&jstat); |
1355
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(jstat))); |
1356
|
0
|
0
|
|
|
|
|
RETVEC( u, 13, nv ); |
|
|
0
|
|
|
|
|
|
1357
|
|
|
|
|
|
|
|
1358
|
|
|
|
|
|
|
void |
1359
|
|
|
|
|
|
|
palPlanel(date, jform, epoch, orbinc, anode, perih, aorq, e, aorl, dm) |
1360
|
|
|
|
|
|
|
double date |
1361
|
|
|
|
|
|
|
int jform |
1362
|
|
|
|
|
|
|
double epoch |
1363
|
|
|
|
|
|
|
double orbinc |
1364
|
|
|
|
|
|
|
double anode |
1365
|
|
|
|
|
|
|
double perih |
1366
|
|
|
|
|
|
|
double aorq |
1367
|
|
|
|
|
|
|
double e |
1368
|
|
|
|
|
|
|
double aorl |
1369
|
|
|
|
|
|
|
double dm |
1370
|
|
|
|
|
|
|
PREINIT: |
1371
|
|
|
|
|
|
|
double pv[6]; |
1372
|
|
|
|
|
|
|
int jstat; |
1373
|
|
|
|
|
|
|
PPCODE: |
1374
|
0
|
|
|
|
|
|
palPlanel(date, jform, epoch, orbinc, anode, perih, aorq, e, aorl, dm, pv, &jstat); |
1375
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(jstat))); |
1376
|
0
|
0
|
|
|
|
|
RETVEC( pv, 6, nv ); |
|
|
0
|
|
|
|
|
|
1377
|
|
|
|
|
|
|
|
1378
|
|
|
|
|
|
|
void |
1379
|
|
|
|
|
|
|
palPlanet(date, np) |
1380
|
|
|
|
|
|
|
double date |
1381
|
|
|
|
|
|
|
int np |
1382
|
|
|
|
|
|
|
PREINIT: |
1383
|
|
|
|
|
|
|
double pv[6]; |
1384
|
|
|
|
|
|
|
int jstat; |
1385
|
|
|
|
|
|
|
PPCODE: |
1386
|
540
|
|
|
|
|
|
palPlanet(date, np, pv, &jstat); |
1387
|
540
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(jstat))); |
1388
|
3780
|
50
|
|
|
|
|
RETVEC( pv, 6, nv ); |
|
|
100
|
|
|
|
|
|
1389
|
|
|
|
|
|
|
|
1390
|
|
|
|
|
|
|
void |
1391
|
|
|
|
|
|
|
palPlante(date, elong, phi, jform, epoch, orbinc, anode, perih, aorq,e, aorl, dm) |
1392
|
|
|
|
|
|
|
double date |
1393
|
|
|
|
|
|
|
double elong |
1394
|
|
|
|
|
|
|
double phi |
1395
|
|
|
|
|
|
|
int jform |
1396
|
|
|
|
|
|
|
double epoch |
1397
|
|
|
|
|
|
|
double orbinc |
1398
|
|
|
|
|
|
|
double anode |
1399
|
|
|
|
|
|
|
double perih |
1400
|
|
|
|
|
|
|
double aorq |
1401
|
|
|
|
|
|
|
double e |
1402
|
|
|
|
|
|
|
double aorl |
1403
|
|
|
|
|
|
|
double dm |
1404
|
|
|
|
|
|
|
PREINIT: |
1405
|
|
|
|
|
|
|
double ra; |
1406
|
|
|
|
|
|
|
double dec; |
1407
|
|
|
|
|
|
|
double r; |
1408
|
|
|
|
|
|
|
int jstat; |
1409
|
|
|
|
|
|
|
PPCODE: |
1410
|
1
|
|
|
|
|
|
palPlante(date, elong, phi, jform, epoch, orbinc, anode, perih, aorq,e, aorl, dm, &ra, &dec, &r, &jstat); |
1411
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(ra))); |
1412
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dec))); |
1413
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(r))); |
1414
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSViv(jstat))); |
1415
|
|
|
|
|
|
|
|
1416
|
|
|
|
|
|
|
# TODO: palPlantu |
1417
|
|
|
|
|
|
|
|
1418
|
|
|
|
|
|
|
void |
1419
|
|
|
|
|
|
|
palPm(r0,d0,pr,pd,px,rv,ep0,ep1) |
1420
|
|
|
|
|
|
|
double r0 |
1421
|
|
|
|
|
|
|
double d0 |
1422
|
|
|
|
|
|
|
double pr |
1423
|
|
|
|
|
|
|
double pd |
1424
|
|
|
|
|
|
|
double px |
1425
|
|
|
|
|
|
|
double rv |
1426
|
|
|
|
|
|
|
double ep0 |
1427
|
|
|
|
|
|
|
double ep1 |
1428
|
|
|
|
|
|
|
PREINIT: |
1429
|
|
|
|
|
|
|
double r1; |
1430
|
|
|
|
|
|
|
double d1; |
1431
|
|
|
|
|
|
|
PPCODE: |
1432
|
1
|
|
|
|
|
|
palPm(r0,d0,pr,pd,px,rv,ep0,ep1,&r1,&d1); |
1433
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(r1))); |
1434
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(d1))); |
1435
|
|
|
|
|
|
|
|
1436
|
|
|
|
|
|
|
void |
1437
|
|
|
|
|
|
|
palPolmo(elongm, phim, xp, yp) |
1438
|
|
|
|
|
|
|
double elongm |
1439
|
|
|
|
|
|
|
double phim |
1440
|
|
|
|
|
|
|
double xp |
1441
|
|
|
|
|
|
|
double yp |
1442
|
|
|
|
|
|
|
PREINIT: |
1443
|
|
|
|
|
|
|
double elong; |
1444
|
|
|
|
|
|
|
double phi; |
1445
|
|
|
|
|
|
|
double daz; |
1446
|
|
|
|
|
|
|
PPCODE: |
1447
|
1
|
|
|
|
|
|
palPolmo(elongm, phim, xp, yp, &elong, &phi, &daz); |
1448
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(elong))); |
1449
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(phi))); |
1450
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(daz))); |
1451
|
|
|
|
|
|
|
|
1452
|
|
|
|
|
|
|
void |
1453
|
|
|
|
|
|
|
palPrebn(bep0, bep1) |
1454
|
|
|
|
|
|
|
double bep0 |
1455
|
|
|
|
|
|
|
double bep1 |
1456
|
|
|
|
|
|
|
PREINIT: |
1457
|
|
|
|
|
|
|
double rmatp[3][3]; |
1458
|
|
|
|
|
|
|
PPCODE: |
1459
|
1
|
|
|
|
|
|
palPrebn(bep0, bep1, rmatp); |
1460
|
13
|
50
|
|
|
|
|
RETMATRIX(rmatp); |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1461
|
|
|
|
|
|
|
|
1462
|
|
|
|
|
|
|
void |
1463
|
|
|
|
|
|
|
palPrec(ep0, ep1) |
1464
|
|
|
|
|
|
|
double ep0 |
1465
|
|
|
|
|
|
|
double ep1 |
1466
|
|
|
|
|
|
|
PREINIT: |
1467
|
|
|
|
|
|
|
double rmatp[3][3]; |
1468
|
|
|
|
|
|
|
PPCODE: |
1469
|
181
|
|
|
|
|
|
palPrec(ep0, ep1, rmatp); |
1470
|
2353
|
50
|
|
|
|
|
RETMATRIX(rmatp); |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1471
|
|
|
|
|
|
|
|
1472
|
|
|
|
|
|
|
# Precession |
1473
|
|
|
|
|
|
|
|
1474
|
|
|
|
|
|
|
# Note that we return the (ra,dec) on the stack |
1475
|
|
|
|
|
|
|
# and do not modify the input arguments. |
1476
|
|
|
|
|
|
|
|
1477
|
|
|
|
|
|
|
void |
1478
|
|
|
|
|
|
|
palPreces(system, ep0, ep1, ra, dc) |
1479
|
|
|
|
|
|
|
char *system |
1480
|
|
|
|
|
|
|
double ep0 |
1481
|
|
|
|
|
|
|
double ep1 |
1482
|
|
|
|
|
|
|
double ra |
1483
|
|
|
|
|
|
|
double dc |
1484
|
|
|
|
|
|
|
PPCODE: |
1485
|
2
|
|
|
|
|
|
palPreces(system, ep0, ep1, &ra, &dc); |
1486
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(ra))); |
1487
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dc))); |
1488
|
|
|
|
|
|
|
|
1489
|
|
|
|
|
|
|
void |
1490
|
|
|
|
|
|
|
palPrenut(epoch, date, rmatpn) |
1491
|
|
|
|
|
|
|
double epoch |
1492
|
|
|
|
|
|
|
double date |
1493
|
|
|
|
|
|
|
PREINIT: |
1494
|
|
|
|
|
|
|
double rmatpn[3][3]; |
1495
|
|
|
|
|
|
|
PPCODE: |
1496
|
0
|
|
|
|
|
|
palPrenut(epoch, date, rmatpn); |
1497
|
0
|
0
|
|
|
|
|
RETMATRIX(rmatpn); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1498
|
|
|
|
|
|
|
|
1499
|
|
|
|
|
|
|
void |
1500
|
|
|
|
|
|
|
palPvobs(p, h, stl) |
1501
|
|
|
|
|
|
|
double p |
1502
|
|
|
|
|
|
|
double h |
1503
|
|
|
|
|
|
|
double stl |
1504
|
|
|
|
|
|
|
PREINIT: |
1505
|
|
|
|
|
|
|
double pv[6]; |
1506
|
|
|
|
|
|
|
PPCODE: |
1507
|
1
|
|
|
|
|
|
palPvobs(p, h, stl, pv); |
1508
|
7
|
50
|
|
|
|
|
RETVEC(pv, 6, nv); |
|
|
100
|
|
|
|
|
|
1509
|
|
|
|
|
|
|
|
1510
|
|
|
|
|
|
|
void |
1511
|
|
|
|
|
|
|
palPxy(xye, xym, coeffs) |
1512
|
|
|
|
|
|
|
AV * xye |
1513
|
|
|
|
|
|
|
AV * xym |
1514
|
|
|
|
|
|
|
double * coeffs |
1515
|
|
|
|
|
|
|
PREINIT: |
1516
|
|
|
|
|
|
|
int np; |
1517
|
|
|
|
|
|
|
double xrms; |
1518
|
|
|
|
|
|
|
double yrms; |
1519
|
|
|
|
|
|
|
double rrms; |
1520
|
|
|
|
|
|
|
AV * pxyp; |
1521
|
|
|
|
|
|
|
PPCODE: |
1522
|
1
|
|
|
|
|
|
np = (av_len(xye) + 1) / 2; |
1523
|
1
|
|
|
|
|
|
double mxye[np][2]; |
1524
|
1
|
|
|
|
|
|
double mxym[np][2]; |
1525
|
1
|
|
|
|
|
|
double xyp[np][2]; |
1526
|
25
|
50
|
|
|
|
|
ARRAYTOMAT(xye, mxye, np, 2); |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1527
|
25
|
50
|
|
|
|
|
ARRAYTOMAT(xym, mxym, np, 2); |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1528
|
1
|
|
|
|
|
|
palPxy(np, mxye, mxym, coeffs, xyp, &xrms, &yrms, &rrms); |
1529
|
1
|
|
|
|
|
|
pxyp = newAV(); |
1530
|
1
|
|
|
|
|
|
unpack1D(newRV_noinc((SV*)pxyp), xyp, 'd', np * 2); |
1531
|
1
|
50
|
|
|
|
|
XPUSHs(newRV_noinc((SV*)pxyp)); |
1532
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(xrms))); |
1533
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(yrms))); |
1534
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(rrms))); |
1535
|
|
|
|
|
|
|
|
1536
|
|
|
|
|
|
|
void |
1537
|
|
|
|
|
|
|
palRdplan(date, np, elong, phi) |
1538
|
|
|
|
|
|
|
double date |
1539
|
|
|
|
|
|
|
int np |
1540
|
|
|
|
|
|
|
double elong |
1541
|
|
|
|
|
|
|
double phi |
1542
|
|
|
|
|
|
|
PREINIT: |
1543
|
|
|
|
|
|
|
double ra; |
1544
|
|
|
|
|
|
|
double dec; |
1545
|
|
|
|
|
|
|
double diam; |
1546
|
|
|
|
|
|
|
PPCODE: |
1547
|
9
|
|
|
|
|
|
palRdplan(date, np, elong, phi, &ra, &dec, &diam); |
1548
|
9
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(ra))); |
1549
|
9
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dec))); |
1550
|
9
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(diam))); |
1551
|
|
|
|
|
|
|
|
1552
|
|
|
|
|
|
|
void |
1553
|
|
|
|
|
|
|
palRefco(hm, tdk, pmb, rh, wl, phi, tlr, eps) |
1554
|
|
|
|
|
|
|
double hm |
1555
|
|
|
|
|
|
|
double tdk |
1556
|
|
|
|
|
|
|
double pmb |
1557
|
|
|
|
|
|
|
double rh |
1558
|
|
|
|
|
|
|
double wl |
1559
|
|
|
|
|
|
|
double phi |
1560
|
|
|
|
|
|
|
double tlr |
1561
|
|
|
|
|
|
|
double eps |
1562
|
|
|
|
|
|
|
PREINIT: |
1563
|
|
|
|
|
|
|
double refa; |
1564
|
|
|
|
|
|
|
double refb; |
1565
|
|
|
|
|
|
|
PPCODE: |
1566
|
2
|
|
|
|
|
|
palRefco(hm, tdk, pmb, rh, wl, phi, tlr, eps, &refa, &refb); |
1567
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(refa))); |
1568
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(refb))); |
1569
|
|
|
|
|
|
|
|
1570
|
|
|
|
|
|
|
void |
1571
|
|
|
|
|
|
|
palRefcoq(tdk, pmb, rh, wl) |
1572
|
|
|
|
|
|
|
double tdk |
1573
|
|
|
|
|
|
|
double pmb |
1574
|
|
|
|
|
|
|
double rh |
1575
|
|
|
|
|
|
|
double wl |
1576
|
|
|
|
|
|
|
PREINIT: |
1577
|
|
|
|
|
|
|
double refa; |
1578
|
|
|
|
|
|
|
double refb; |
1579
|
|
|
|
|
|
|
PPCODE: |
1580
|
3
|
|
|
|
|
|
palRefcoq(tdk, pmb, rh, wl, &refa, &refb); |
1581
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(refa))); |
1582
|
3
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(refb))); |
1583
|
|
|
|
|
|
|
|
1584
|
|
|
|
|
|
|
void |
1585
|
|
|
|
|
|
|
palRefro(zobs, hm, tdk, pmb, rh, wl, phi, tlr, eps) |
1586
|
|
|
|
|
|
|
double zobs |
1587
|
|
|
|
|
|
|
double hm |
1588
|
|
|
|
|
|
|
double tdk |
1589
|
|
|
|
|
|
|
double pmb |
1590
|
|
|
|
|
|
|
double rh |
1591
|
|
|
|
|
|
|
double wl |
1592
|
|
|
|
|
|
|
double phi |
1593
|
|
|
|
|
|
|
double tlr |
1594
|
|
|
|
|
|
|
double eps |
1595
|
|
|
|
|
|
|
PREINIT: |
1596
|
|
|
|
|
|
|
double ref; |
1597
|
|
|
|
|
|
|
PPCODE: |
1598
|
2
|
|
|
|
|
|
palRefro(zobs, hm, tdk, pmb, rh, wl, phi, tlr, eps, &ref); |
1599
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(ref))); |
1600
|
|
|
|
|
|
|
|
1601
|
|
|
|
|
|
|
void |
1602
|
|
|
|
|
|
|
palRefv(vu, refa, refb) |
1603
|
|
|
|
|
|
|
double * vu |
1604
|
|
|
|
|
|
|
double refa |
1605
|
|
|
|
|
|
|
double refb |
1606
|
|
|
|
|
|
|
PREINIT: |
1607
|
|
|
|
|
|
|
double vr[3]; |
1608
|
|
|
|
|
|
|
PPCODE: |
1609
|
2
|
|
|
|
|
|
palRefv(vu, refa, refb, vr); |
1610
|
8
|
50
|
|
|
|
|
RETVEC( vr, 3, nv ); |
|
|
100
|
|
|
|
|
|
1611
|
|
|
|
|
|
|
|
1612
|
|
|
|
|
|
|
|
1613
|
|
|
|
|
|
|
void |
1614
|
|
|
|
|
|
|
palRefz(zu, refa, refb) |
1615
|
|
|
|
|
|
|
double zu |
1616
|
|
|
|
|
|
|
double refa |
1617
|
|
|
|
|
|
|
double refb |
1618
|
|
|
|
|
|
|
PREINIT: |
1619
|
|
|
|
|
|
|
double zr; |
1620
|
|
|
|
|
|
|
PPCODE: |
1621
|
2
|
|
|
|
|
|
palRefz(zu, refa, refb, &zr); |
1622
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(zr))); |
1623
|
|
|
|
|
|
|
|
1624
|
|
|
|
|
|
|
double |
1625
|
|
|
|
|
|
|
palRverot(phi, ra, da, st) |
1626
|
|
|
|
|
|
|
double phi |
1627
|
|
|
|
|
|
|
double ra |
1628
|
|
|
|
|
|
|
double da |
1629
|
|
|
|
|
|
|
double st |
1630
|
|
|
|
|
|
|
CODE: |
1631
|
0
|
|
|
|
|
|
RETVAL = palRverot(phi, ra, da, st); |
1632
|
|
|
|
|
|
|
OUTPUT: |
1633
|
|
|
|
|
|
|
RETVAL |
1634
|
|
|
|
|
|
|
|
1635
|
|
|
|
|
|
|
|
1636
|
|
|
|
|
|
|
double |
1637
|
|
|
|
|
|
|
palRvgalc(r2000, d2000) |
1638
|
|
|
|
|
|
|
double r2000 |
1639
|
|
|
|
|
|
|
double d2000 |
1640
|
|
|
|
|
|
|
CODE: |
1641
|
0
|
|
|
|
|
|
RETVAL = palRvgalc(r2000, d2000); |
1642
|
|
|
|
|
|
|
OUTPUT: |
1643
|
|
|
|
|
|
|
RETVAL |
1644
|
|
|
|
|
|
|
|
1645
|
|
|
|
|
|
|
double |
1646
|
|
|
|
|
|
|
palRvlg(r2000, d2000) |
1647
|
|
|
|
|
|
|
double r2000 |
1648
|
|
|
|
|
|
|
double d2000 |
1649
|
|
|
|
|
|
|
CODE: |
1650
|
0
|
|
|
|
|
|
RETVAL = palRvlg(r2000, d2000); |
1651
|
|
|
|
|
|
|
OUTPUT: |
1652
|
|
|
|
|
|
|
RETVAL |
1653
|
|
|
|
|
|
|
|
1654
|
|
|
|
|
|
|
|
1655
|
|
|
|
|
|
|
double |
1656
|
|
|
|
|
|
|
palRvlsrd(r2000, d2000) |
1657
|
|
|
|
|
|
|
double r2000 |
1658
|
|
|
|
|
|
|
double d2000 |
1659
|
|
|
|
|
|
|
CODE: |
1660
|
0
|
|
|
|
|
|
RETVAL = palRvlsrd(r2000, d2000); |
1661
|
|
|
|
|
|
|
OUTPUT: |
1662
|
|
|
|
|
|
|
RETVAL |
1663
|
|
|
|
|
|
|
|
1664
|
|
|
|
|
|
|
double |
1665
|
|
|
|
|
|
|
palRvlsrk(r2000, d2000) |
1666
|
|
|
|
|
|
|
double r2000 |
1667
|
|
|
|
|
|
|
double d2000 |
1668
|
|
|
|
|
|
|
CODE: |
1669
|
0
|
|
|
|
|
|
RETVAL = palRvlsrk(r2000, d2000); |
1670
|
|
|
|
|
|
|
OUTPUT: |
1671
|
|
|
|
|
|
|
RETVAL |
1672
|
|
|
|
|
|
|
|
1673
|
|
|
|
|
|
|
void |
1674
|
|
|
|
|
|
|
palSubet(rc, dc, eq) |
1675
|
|
|
|
|
|
|
double rc |
1676
|
|
|
|
|
|
|
double dc |
1677
|
|
|
|
|
|
|
double eq |
1678
|
|
|
|
|
|
|
PREINIT: |
1679
|
|
|
|
|
|
|
double rm; |
1680
|
|
|
|
|
|
|
double dm; |
1681
|
|
|
|
|
|
|
PPCODE: |
1682
|
1
|
|
|
|
|
|
palSubet(rc, dc, eq, &rm, &dm); |
1683
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(rm))); |
1684
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dm))); |
1685
|
|
|
|
|
|
|
|
1686
|
|
|
|
|
|
|
void |
1687
|
|
|
|
|
|
|
palSupgal(dsl, dsb) |
1688
|
|
|
|
|
|
|
double dsl |
1689
|
|
|
|
|
|
|
double dsb |
1690
|
|
|
|
|
|
|
PREINIT: |
1691
|
|
|
|
|
|
|
double dl; |
1692
|
|
|
|
|
|
|
double db; |
1693
|
|
|
|
|
|
|
PPCODE: |
1694
|
0
|
|
|
|
|
|
palSupgal(dsl, dsb, &dl, &db); |
1695
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(dl))); |
1696
|
0
|
0
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(db))); |
1697
|
|
|
|
|
|
|
|
1698
|
|
|
|
|
|
|
# TODO: palUe2el |
1699
|
|
|
|
|
|
|
|
1700
|
|
|
|
|
|
|
# TODO: palUe2pv |
1701
|
|
|
|
|
|
|
|
1702
|
|
|
|
|
|
|
void |
1703
|
|
|
|
|
|
|
palUnpcd(disco, x, y) |
1704
|
|
|
|
|
|
|
double disco |
1705
|
|
|
|
|
|
|
double x |
1706
|
|
|
|
|
|
|
double y |
1707
|
|
|
|
|
|
|
PPCODE: |
1708
|
2
|
|
|
|
|
|
palUnpcd(disco, &x, &y); |
1709
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(x))); |
1710
|
2
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(y))); |
1711
|
|
|
|
|
|
|
|
1712
|
|
|
|
|
|
|
void palXy2xy(x1, y1, coeffs) |
1713
|
|
|
|
|
|
|
double x1 |
1714
|
|
|
|
|
|
|
double y1 |
1715
|
|
|
|
|
|
|
double * coeffs |
1716
|
|
|
|
|
|
|
PREINIT: |
1717
|
|
|
|
|
|
|
double x2; |
1718
|
|
|
|
|
|
|
double y2; |
1719
|
|
|
|
|
|
|
PPCODE: |
1720
|
1
|
|
|
|
|
|
palXy2xy(x1, y1, coeffs, &x2, &y2); |
1721
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(x2))); |
1722
|
1
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVnv(y2))); |