swe4r 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ext/swe4r/sweph.h ADDED
@@ -0,0 +1,556 @@
1
+ /************************************************************
2
+ $Header: /home/dieter/sweph/RCS/sweph.h,v 1.74 2008/06/16 10:07:20 dieter Exp $
3
+ definitions and constants SWISSEPH
4
+
5
+ Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
6
+
7
+ ************************************************************/
8
+ /* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
9
+
10
+ License conditions
11
+ ------------------
12
+
13
+ This file is part of Swiss Ephemeris.
14
+
15
+ Swiss Ephemeris is distributed with NO WARRANTY OF ANY KIND. No author
16
+ or distributor accepts any responsibility for the consequences of using it,
17
+ or for whether it serves any particular purpose or works at all, unless he
18
+ or she says so in writing.
19
+
20
+ Swiss Ephemeris is made available by its authors under a dual licensing
21
+ system. The software developer, who uses any part of Swiss Ephemeris
22
+ in his or her software, must choose between one of the two license models,
23
+ which are
24
+ a) GNU public license version 2 or later
25
+ b) Swiss Ephemeris Professional License
26
+
27
+ The choice must be made before the software developer distributes software
28
+ containing parts of Swiss Ephemeris to others, and before any public
29
+ service using the developed software is activated.
30
+
31
+ If the developer choses the GNU GPL software license, he or she must fulfill
32
+ the conditions of that license, which includes the obligation to place his
33
+ or her whole software project under the GNU GPL or a compatible license.
34
+ See http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
35
+
36
+ If the developer choses the Swiss Ephemeris Professional license,
37
+ he must follow the instructions as found in http://www.astro.com/swisseph/
38
+ and purchase the Swiss Ephemeris Professional Edition from Astrodienst
39
+ and sign the corresponding license contract.
40
+
41
+ The License grants you the right to use, copy, modify and redistribute
42
+ Swiss Ephemeris, but only under certain conditions described in the License.
43
+ Among other things, the License requires that the copyright notices and
44
+ this notice be preserved on all copies.
45
+
46
+ Authors of the Swiss Ephemeris: Dieter Koch and Alois Treindl
47
+
48
+ The authors of Swiss Ephemeris have no control or influence over any of
49
+ the derived works, i.e. over software or services created by other
50
+ programmers which use Swiss Ephemeris functions.
51
+
52
+ The names of the authors or of the copyright holder (Astrodienst) must not
53
+ be used for promoting any software, product or service which uses or contains
54
+ the Swiss Ephemeris. This copyright notice is the ONLY place where the
55
+ names of the authors can legally appear, except in cases where they have
56
+ given special permission in writing.
57
+
58
+ The trademarks 'Swiss Ephemeris' and 'Swiss Ephemeris inside' may be used
59
+ for promoting such software, products or services.
60
+ */
61
+
62
+ /*
63
+ * move over from swephexp.h
64
+ */
65
+
66
+ #define SE_VERSION "1.77.00"
67
+
68
+ #define J2000 2451545.0 /* 2000 January 1.5 */
69
+ #define B1950 2433282.42345905 /* 1950 January 0.923 */
70
+ #define J1900 2415020.0 /* 1900 January 0.5 */
71
+
72
+ #define MPC_CERES 1
73
+ #define MPC_PALLAS 2
74
+ #define MPC_JUNO 3
75
+ #define MPC_VESTA 4
76
+ #define MPC_CHIRON 2060
77
+ #define MPC_PHOLUS 5145
78
+
79
+ #define SE_NAME_SUN "Sun"
80
+ #define SE_NAME_MOON "Moon"
81
+ #define SE_NAME_MERCURY "Mercury"
82
+ #define SE_NAME_VENUS "Venus"
83
+ #define SE_NAME_MARS "Mars"
84
+ #define SE_NAME_JUPITER "Jupiter"
85
+ #define SE_NAME_SATURN "Saturn"
86
+ #define SE_NAME_URANUS "Uranus"
87
+ #define SE_NAME_NEPTUNE "Neptune"
88
+ #define SE_NAME_PLUTO "Pluto"
89
+ #define SE_NAME_MEAN_NODE "mean Node"
90
+ #define SE_NAME_TRUE_NODE "true Node"
91
+ #define SE_NAME_MEAN_APOG "mean Apogee"
92
+ #define SE_NAME_OSCU_APOG "osc. Apogee"
93
+ #define SE_NAME_INTP_APOG "intp. Apogee"
94
+ #define SE_NAME_INTP_PERG "intp. Perigee"
95
+ #define SE_NAME_EARTH "Earth"
96
+ #define SE_NAME_CERES "Ceres"
97
+ #define SE_NAME_PALLAS "Pallas"
98
+ #define SE_NAME_JUNO "Juno"
99
+ #define SE_NAME_VESTA "Vesta"
100
+ #define SE_NAME_CHIRON "Chiron"
101
+ #define SE_NAME_PHOLUS "Pholus"
102
+
103
+
104
+ #define SE_NAME_CUPIDO "Cupido"
105
+ #define SE_NAME_HADES "Hades"
106
+ #define SE_NAME_ZEUS "Zeus"
107
+ #define SE_NAME_KRONOS "Kronos"
108
+ #define SE_NAME_APOLLON "Apollon"
109
+ #define SE_NAME_ADMETOS "Admetos"
110
+ #define SE_NAME_VULKANUS "Vulkanus"
111
+ #define SE_NAME_POSEIDON "Poseidon"
112
+ #define SE_NAME_ISIS "Isis"
113
+ #define SE_NAME_NIBIRU "Nibiru"
114
+ #define SE_NAME_HARRINGTON "Harrington"
115
+ #define SE_NAME_NEPTUNE_LEVERRIER "Leverrier"
116
+ #define SE_NAME_NEPTUNE_ADAMS "Adams"
117
+ #define SE_NAME_PLUTO_LOWELL "Lowell"
118
+ #define SE_NAME_PLUTO_PICKERING "Pickering"
119
+ #define SE_NAME_VULCAN "Vulcan"
120
+ #define SE_NAME_WHITE_MOON "White Moon"
121
+
122
+ /* for delta t: intrinsic tidal acceleration in the mean motion of the moon,
123
+ * not given in the parameters list of the ephemeris files but computed
124
+ * by Chapront/Chapront-Touzé/Francou A&A 387 (2002), p. 705.
125
+ */
126
+ #define SE_TIDAL_DE200 (-23.8946)
127
+ #define SE_TIDAL_DE403 (-25.580) /* was (-25.8) until V. 1.76.2 */
128
+ #define SE_TIDAL_DE404 (-25.580) /* was (-25.8) until V. 1.76.2 */
129
+ #define SE_TIDAL_DE405 (-25.826) /* was (-25.7376) until V. 1.76.2 */
130
+ #define SE_TIDAL_DE406 (-25.826) /* was (-25.7376) until V. 1.76.2 */
131
+
132
+ #define SE_TIDAL_26 (-26.0)
133
+
134
+ #define SE_TIDAL_DEFAULT SE_TIDAL_DE406
135
+
136
+ /*
137
+ * earlier content
138
+ */
139
+
140
+ #define PI M_PI /* 3.14159265358979323846, math.h */
141
+ #define TWOPI (2.0 * PI)
142
+
143
+ #define ENDMARK -99
144
+
145
+ #define SEI_EPSILON -2
146
+ #define SEI_NUTATION -1
147
+ #define SEI_EMB 0
148
+ #define SEI_EARTH 0
149
+ #define SEI_SUN 0
150
+ #define SEI_MOON 1
151
+ #define SEI_MERCURY 2
152
+ #define SEI_VENUS 3
153
+ #define SEI_MARS 4
154
+ #define SEI_JUPITER 5
155
+ #define SEI_SATURN 6
156
+ #define SEI_URANUS 7
157
+ #define SEI_NEPTUNE 8
158
+ #define SEI_PLUTO 9
159
+ #define SEI_SUNBARY 10 /* barycentric sun */
160
+ #define SEI_ANYBODY 11 /* any asteroid */
161
+ #define SEI_CHIRON 12
162
+ #define SEI_PHOLUS 13
163
+ #define SEI_CERES 14
164
+ #define SEI_PALLAS 15
165
+ #define SEI_JUNO 16
166
+ #define SEI_VESTA 17
167
+
168
+ #define SEI_NPLANETS 18
169
+
170
+ #define SEI_MEAN_NODE 0
171
+ #define SEI_TRUE_NODE 1
172
+ #define SEI_MEAN_APOG 2
173
+ #define SEI_OSCU_APOG 3
174
+ #define SEI_INTP_APOG 4
175
+ #define SEI_INTP_PERG 5
176
+
177
+ #define SEI_NNODE_ETC 6
178
+
179
+ #define SEI_FLG_HELIO 1
180
+ #define SEI_FLG_ROTATE 2
181
+ #define SEI_FLG_ELLIPSE 4
182
+ #define SEI_FLG_EMBHEL 8 /* TRUE, if heliocentric earth is given
183
+ * instead of barycentric sun
184
+ * i.e. bary sun is computed from
185
+ * barycentric and heliocentric earth */
186
+
187
+ #define SEI_FILE_PLANET 0
188
+ #define SEI_FILE_MOON 1
189
+ #define SEI_FILE_MAIN_AST 2
190
+ #define SEI_FILE_ANY_AST 3
191
+ #define SEI_FILE_FIXSTAR 4
192
+
193
+ #if 0
194
+ #define SEI_FILE_TEST_ENDIAN (97L * 65536L + 98L * 256L + 99L) /*abc*/
195
+ #endif
196
+ #define SEI_FILE_TEST_ENDIAN (0x616263L) /* abc*/
197
+ #define SEI_FILE_BIGENDIAN 0
198
+ #define SEI_FILE_NOREORD 0
199
+ #define SEI_FILE_LITENDIAN 1
200
+ #define SEI_FILE_REORD 2
201
+
202
+ #define SEI_FILE_NMAXPLAN 50
203
+ #define SEI_FILE_EFPOSBEGIN 500
204
+
205
+ #define SE_FILE_SUFFIX "se1"
206
+
207
+ #define SEI_NEPHFILES 7
208
+ #define SEI_CURR_FPOS -1
209
+
210
+ /* Chiron's orbit becomes chaotic
211
+ * before 720 AD and after 4606 AD, because of close encounters
212
+ * with Saturn. Accepting a maximum error of 5 degrees,
213
+ * the ephemeris is good between the following dates:
214
+ */
215
+ #define CHIRON_START 1958470.5 /* 1.1.650 */
216
+ #define CHIRON_END 3419437.5 /* 1.1.4650 */
217
+
218
+ /* Pholus's orbit is unstable as well, because he sometimes
219
+ * approaches Saturn.
220
+ * Accepting a maximum error of 5 degrees,
221
+ * the ephemeris is good after the following date:
222
+ */
223
+ #define PHOLUS_START 314845.5 /* 1.1.-3850 */
224
+
225
+ #define MOSHPLEPH_START 625000.5
226
+ #define MOSHPLEPH_END 2818000.5
227
+ #define MOSHLUEPH_START 625000.5
228
+ #define MOSHLUEPH_END 2818000.5
229
+ #define MOSHNDEPH_START -254900.5 /* 14 Feb -5410 00:00 ET jul.cal.*/
230
+ #define MOSHNDEPH_END 3697000.5 /* 11 Dec 5409 00:00 ET, greg. cal */
231
+ /*
232
+ #define MOSHPLEPH_START -225000.5
233
+ #define MOSHPLEPH_END 3600000.5
234
+ #define MOSHLUEPH_START -225000.5
235
+ #define MOSHLUEPH_END 3600000.5
236
+ */
237
+ #if FALSE /* Alois commented out, not used anywhere */
238
+ #define JPLEPH_START 625307.5 /* about -3000 (DE406) */
239
+ #define JPLEPH_END 2816848.5 /* about 3000 (DE406) */
240
+ #define SWIEPH_START 625614.927151
241
+ #define SWIEPH_END 2813641.5
242
+ #define ALLEPH_START MOSHPLEPH_START
243
+ #define ALLEPH_END MOSHPLEPH_END
244
+ #define BEG_YEAR (-3000)
245
+ #define END_YEAR 3000
246
+ #endif
247
+
248
+ #define MAXORD 40
249
+
250
+ #define NCTIES 6.0 /* number of centuries per eph. file */
251
+
252
+ #define OK (0)
253
+ #define ERR (-1)
254
+ #define NOT_AVAILABLE (-2)
255
+ #define BEYOND_EPH_LIMITS (-3)
256
+
257
+ #define J_TO_J2000 1
258
+ #define J2000_TO_J -1
259
+
260
+ /* we always use Astronomical Almanac constants, if available */
261
+ #define MOON_MEAN_DIST 384400000.0 /* in m, AA 1996, F2 */
262
+ #define MOON_MEAN_INCL 5.1453964 /* AA 1996, D2 */
263
+ #define MOON_MEAN_ECC 0.054900489 /* AA 1996, F2 */
264
+ /* #define SUN_EARTH_MRAT 328900.561400 Su/(Ea+Mo) AA 2006 K7 */
265
+ #define SUN_EARTH_MRAT 332946.050895 /* Su / (Ea only) AA 2006 K7 */
266
+ #define EARTH_MOON_MRAT (1 / 0.0123000383) /* AA 2006, K7 */
267
+ #if 0
268
+ #define EARTH_MOON_MRAT 81.30056 /* de406 */
269
+ #endif
270
+ #define AUNIT 1.49597870691e+11 /* au in meters, AA 2006 K6 */
271
+ #define CLIGHT 2.99792458e+8 /* m/s, AA 1996 K6 */
272
+ #if 0
273
+ #define HELGRAVCONST 1.32712438e+20 /* G * M(sun), m^3/sec^2, AA 1996 K6 */
274
+ #endif
275
+ #define HELGRAVCONST 1.32712440017987e+20 /* G * M(sun), m^3/sec^2, AA 2006 K6 */
276
+ #define GEOGCONST 3.98600448e+14 /* G * M(earth) m^3/sec^2, AA 1996 K6 */
277
+ #define KGAUSS 0.01720209895 /* Gaussian gravitational constant K6 */
278
+ #define SUN_RADIUS (959.63 / 3600 * DEGTORAD) /* Meeus germ. p 391 */
279
+ #define EARTH_RADIUS 6378136.6 /* AA 2006 K6 */
280
+ /*#define EARTH_OBLATENESS (1.0/ 298.257223563) * AA 1998 K13 */
281
+ #define EARTH_OBLATENESS (1.0/ 298.25642) /* AA 2006 K6 */
282
+ #define EARTH_ROT_SPEED (7.2921151467e-5 * 86400) /* in rad/day, expl. suppl., p 162 */
283
+
284
+ #define LIGHTTIME_AUNIT (499.0047838061/3600/24) /* 8.3167 minutes (days), AA 2006 K6 */
285
+
286
+ /* node of ecliptic measured on ecliptic 2000 */
287
+ #define SSY_PLANE_NODE_E2000 (107.582569 * DEGTORAD)
288
+ /* node of ecliptic measured on solar system rotation plane */
289
+ #define SSY_PLANE_NODE (107.58883388 * DEGTORAD)
290
+ /* inclination of ecliptic against solar system rotation plane */
291
+ #define SSY_PLANE_INCL (1.578701 * DEGTORAD)
292
+
293
+ #define KM_S_TO_AU_CTY 21.095 /* km/s to AU/century */
294
+ #define MOON_SPEED_INTV 0.00005 /* 4.32 seconds (in days) */
295
+ #define PLAN_SPEED_INTV 0.0001 /* 8.64 seconds (in days) */
296
+ #define MEAN_NODE_SPEED_INTV 0.001
297
+ #define NODE_CALC_INTV 0.0001
298
+ #define NODE_CALC_INTV_MOSH 0.1
299
+ #define NUT_SPEED_INTV 0.0001
300
+ #define DEFL_SPEED_INTV 0.0000005
301
+
302
+ #define SE_LAPSE_RATE 0.0065 /* deg K / m, for refraction */
303
+
304
+ #define square_sum(x) (x[0]*x[0]+x[1]*x[1]+x[2]*x[2])
305
+ #define dot_prod(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])
306
+
307
+ #define PNOINT2JPL {J_EARTH, J_MOON, J_MERCURY, J_VENUS, J_MARS, J_JUPITER, J_SATURN, J_URANUS, J_NEPTUNE, J_PLUTO, J_SUN, }
308
+
309
+ /* planetary radii in meters */
310
+ #define NDIAM (SE_VESTA + 1)
311
+ static const double pla_diam[NDIAM] = {1392000000.0, /* Sun */
312
+ 3476300.0, /* Moon */
313
+ 2439000.0 * 2, /* Mercury */
314
+ 6052000.0 * 2, /* Venus */
315
+ 3397200.0 * 2, /* Mars */
316
+ 71398000.0 * 2, /* Jupiter */
317
+ 60000000.0 * 2, /* Saturn */
318
+ 25400000.0 * 2, /* Uranus */
319
+ 24300000.0 * 2, /* Neptune */
320
+ 2500000.0 * 2, /* Pluto */
321
+ 0, 0, 0, 0, /* nodes and apogees */
322
+ 6378140.0 * 2, /* Earth */
323
+ 0.0, /* Chiron */
324
+ 0.0, /* Pholus */
325
+ 913000.0, /* Ceres */
326
+ 523000.0, /* Pallas */
327
+ 244000.0, /* Juno */
328
+ 501000.0, /* Vesta */
329
+ };
330
+
331
+
332
+ /* Ayanamsas */
333
+ struct aya_init {double t0, ayan_t0;};
334
+ static const struct aya_init ayanamsa[] = {
335
+ {2433282.5, 24.042044444}, /* 0: Fagan/Bradley (Default) */
336
+ {J1900, 360 - 337.53953}, /* 1: Lahiri (Robert Hand) */
337
+ {J1900, 360 - 333.58695}, /* 2: De Luce (Robert Hand) */
338
+ {J1900, 360 - 338.98556}, /* 3: Raman (Robert Hand) */
339
+ {J1900, 360 - 341.33904}, /* 4: Ushashashi (Robert Hand) */
340
+ {J1900, 360 - 337.636111}, /* 5: Krishnamurti (Robert Hand) */
341
+ {J1900, 360 - 333.0369024}, /* 6: Djwhal Khool; (Graham Dawson)
342
+ * Aquarius entered on 1 July 2117 */
343
+ {J1900, 360 - 338.917778}, /* 7: Yukteshwar; (David Cochrane) */
344
+ {J1900, 360 - 338.634444}, /* 8: JN Bhasin; (David Cochrane) */
345
+ {1684532.5, -3.36667}, /* 9: Babylonian, Kugler 1 */
346
+ {1684532.5, -4.76667}, /*10: Babylonian, Kugler 2 */
347
+ {1684532.5, -5.61667}, /*11: Babylonian, Kugler 3 */
348
+ {1684532.5, -4.56667}, /*12: Babylonian, Huber */
349
+ {1673941, -5.079167}, /*13: Babylonian, Mercier;
350
+ * eta Piscium culminates with zero point */
351
+ {1684532.5, -4.44088389}, /*14: t0 is defined by Aldebaran at 15 Taurus */
352
+ {1674484, -9.33333}, /*15: Hipparchos */
353
+ {1927135.8747793, 0}, /*16: Sassanian */
354
+ /*{1746443.513, 0}, *17: Galactic Center at 0 Sagittarius */
355
+ {1746447.518, 0}, /*17: Galactic Center at 0 Sagittarius */
356
+ {J2000, 0}, /*18: J2000 */
357
+ {J1900, 0}, /*19: J1900 */
358
+ {B1950, 0}, /*20: B1950 */
359
+ };
360
+
361
+ #define PLAN_DATA struct plan_data
362
+
363
+ /* obliquity of ecliptic */
364
+ struct epsilon {
365
+ double teps, eps, seps, ceps; /* jd, eps, sin(eps), cos(eps) */
366
+ };
367
+
368
+ /*
369
+ extern struct epsilon oec2000;
370
+ extern struct epsilon oec;
371
+ */
372
+
373
+ struct plan_data {
374
+ /* the following data are read from file only once, immediately after
375
+ * file has been opened */
376
+ int ibdy; /* internal body number */
377
+ int32 iflg; /* contains several bit flags describing the data:
378
+ * SEI_FLG_HELIO: true if helio, false if bary
379
+ * SEI_FLG_ROTATE: TRUE if coefficients are referred
380
+ * to coordinate system of orbital plane
381
+ * SEI_FLG_ELLIPSE: TRUE if reference ellipse */
382
+ int ncoe; /* # of coefficients of ephemeris polynomial,
383
+ is polynomial order + 1 */
384
+ /* where is the segment index on the file */
385
+ int32 lndx0; /* file position of begin of planet's index */
386
+ int32 nndx; /* number of index entries on file: computed */
387
+ double tfstart; /* file contains ephemeris for tfstart thru tfend */
388
+ double tfend; /* for this particular planet !!! */
389
+ double dseg; /* segment size (days covered by a polynomial) */
390
+ /* orbital elements: */
391
+ double telem; /* epoch of elements */
392
+ double prot;
393
+ double qrot;
394
+ double dprot;
395
+ double dqrot;
396
+ double rmax; /* normalisation factor of cheby coefficients */
397
+ /* in addition, if reference ellipse is used: */
398
+ double peri;
399
+ double dperi;
400
+ double *refep; /* pointer to cheby coeffs of reference ellipse,
401
+ * size of data is 2 x ncoe */
402
+ /* unpacked segment information, only updated when a segment is read: */
403
+ double tseg0, tseg1; /* start and end jd of current segment */
404
+ double *segp; /* pointer to unpacked cheby coeffs of segment;
405
+ * the size is 3 x ncoe */
406
+ int neval; /* how many coefficients to evaluate. this may
407
+ * be less than ncoe */
408
+ /* result of most recent data evaluation for this body: */
409
+ double teval; /* time for which previous computation was made */
410
+ int32 iephe; /* which ephemeris was used */
411
+ double x[6]; /* position and speed vectors equatorial J2000 */
412
+ int32 xflgs; /* hel., light-time, aberr., prec. flags etc. */
413
+ double xreturn[24]; /* return positions:
414
+ * xreturn+0 ecliptic polar coordinates
415
+ * xreturn+6 ecliptic cartesian coordinates
416
+ * xreturn+12 equatorial polar coordinates
417
+ * xreturn+18 equatorial cartesian coordinates
418
+ */
419
+ };
420
+
421
+ /*
422
+ * stuff exported from swemplan.c and swemmoon.c
423
+ * and constants used inside these functions.
424
+ ************************************************************/
425
+
426
+ #define STR 4.8481368110953599359e-6 /* radians per arc second */
427
+
428
+ /* moon, s. moshmoon.c */
429
+ extern int swi_mean_node(double jd, double *x, char *serr);
430
+ extern int swi_mean_apog(double jd, double *x, char *serr);
431
+ extern int swi_moshmoon(double tjd, AS_BOOL do_save, double *xpm, char *serr) ;
432
+ extern int swi_moshmoon2(double jd, double *x);
433
+ extern int swi_intp_apsides(double J, double *pol, int ipli);
434
+
435
+ /* planets, s. moshplan.c */
436
+ extern int swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret, double *xeret, char *serr);
437
+ extern int swi_moshplan2(double J, int iplm, double *pobj);
438
+ extern int swi_osc_el_plan(double tjd, double *xp, int ipl, int ipli, double *xearth, double *xsun, char *serr);
439
+ extern FILE *swi_fopen(int ifno, char *fname, char *ephepath, char *serr);
440
+
441
+ /* nutation */
442
+ struct nut {
443
+ double tnut;
444
+ double nutlo[2]; /* nutation in longitude and obliquity */
445
+ double snut, cnut; /* sine and cosine of nutation in obliquity */
446
+ double matrix[3][3];
447
+ };
448
+
449
+ struct plantbl {
450
+ char max_harmonic[9];
451
+ char max_power_of_t;
452
+ signed char *arg_tbl;
453
+ double *lon_tbl;
454
+ double *lat_tbl;
455
+ double *rad_tbl;
456
+ double distance;
457
+ };
458
+
459
+ struct file_data {
460
+ char fnam[AS_MAXCH]; /* ephemeris file name */
461
+ int fversion; /* version number of file */
462
+ char astnam[50]; /* asteroid name, if asteroid file */
463
+ int32 sweph_denum; /* DE number of JPL ephemeris, which this file
464
+ * is derived from. */
465
+ FILE *fptr; /* ephemeris file pointer */
466
+ double tfstart; /* file may be used from this date */
467
+ double tfend; /* through this date */
468
+ int32 iflg; /* byte reorder flag and little/bigendian flag */
469
+ short npl; /* how many planets in file */
470
+ int ipl[SEI_FILE_NMAXPLAN]; /* planet numbers */
471
+ };
472
+
473
+ struct gen_const {
474
+ double clight,
475
+ aunit,
476
+ helgravconst,
477
+ ratme,
478
+ sunradius;
479
+ };
480
+
481
+ struct save_positions {
482
+ int ipl;
483
+ double tsave;
484
+ int32 iflgsave;
485
+ /* position at t = tsave,
486
+ * in ecliptic polar (offset 0),
487
+ * ecliptic cartesian (offset 6),
488
+ * equatorial polar (offset 12),
489
+ * and equatorial cartesian coordinates (offset 18).
490
+ * 6 doubles each for position and speed coordinates.
491
+ */
492
+ double xsaves[24];
493
+ };
494
+
495
+ struct node_data {
496
+ /* result of most recent data evaluation for this body: */
497
+ double teval; /* time for which last computation was made */
498
+ int32 iephe; /* which ephemeris was used */
499
+ double x[6]; /* position and speed vectors equatorial J2000 */
500
+ int32 xflgs; /* hel., light-time, aberr., prec. flags etc. */
501
+ double xreturn[24]; /* return positions:
502
+ * xreturn+0 ecliptic polar coordinates
503
+ * xreturn+6 ecliptic cartesian coordinates
504
+ * xreturn+12 equatorial polar coordinates
505
+ * xreturn+18 equatorial cartesian coordinates
506
+ */
507
+ };
508
+
509
+ struct topo_data {
510
+ double geolon, geolat, geoalt;
511
+ double teval;
512
+ double tjd_ut;
513
+ double xobs[6];
514
+ };
515
+
516
+ struct sid_data {
517
+ int32 sid_mode;
518
+ double ayan_t0;
519
+ double t0;
520
+ };
521
+
522
+ struct swe_data {
523
+ AS_BOOL ephe_path_is_set;
524
+ short jpl_file_is_open;
525
+ FILE *fixfp; /* fixed stars file pointer */
526
+ char ephepath[AS_MAXCH];
527
+ char jplfnam[AS_MAXCH];
528
+ short jpldenum;
529
+ AS_BOOL geopos_is_set;
530
+ AS_BOOL ayana_is_set;
531
+ AS_BOOL is_old_starfile;
532
+ struct file_data fidat[SEI_NEPHFILES];
533
+ struct gen_const gcdat;
534
+ struct plan_data pldat[SEI_NPLANETS];
535
+ #if 0
536
+ struct node_data nddat[SEI_NNODE_ETC];
537
+ #else
538
+ struct plan_data nddat[SEI_NNODE_ETC];
539
+ #endif
540
+ struct save_positions savedat[SE_NPLANETS+1];
541
+ struct epsilon oec;
542
+ struct epsilon oec2000;
543
+ struct nut nut;
544
+ struct nut nut2000;
545
+ struct nut nutv;
546
+ struct topo_data topd;
547
+ struct sid_data sidd;
548
+ char astelem[AS_MAXCH * 2];
549
+ double ast_G;
550
+ double ast_H;
551
+ double ast_diam;
552
+ int i_saved_planet_name;
553
+ char saved_planet_name[80];
554
+ };
555
+
556
+ extern struct swe_data FAR swed;