COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
jpleph.h
Go to the documentation of this file.
1 /********************************************************************
2 * Copyright (C) 2015 by Interstel Technologies, Inc.
3 * and Hawaii Space Flight Laboratory.
4 *
5 * This file is part of the COSMOS/core that is the central
6 * module for COSMOS. For more information on COSMOS go to
7 * <http://cosmos-project.com>
8 *
9 * The COSMOS/core software is licenced under the
10 * GNU Lesser General Public License (LGPL) version 3 licence.
11 *
12 * You should have received a copy of the
13 * GNU Lesser General Public License
14 * If not, go to <http://www.gnu.org/licenses/>
15 *
16 * COSMOS/core is free software: you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public License
18 * as published by the Free Software Foundation, either version 3 of
19 * the License, or (at your option) any later version.
20 *
21 * COSMOS/core is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * Refer to the "licences" folder for further information on the
27 * condititons and terms to use this software.
28 ********************************************************************/
29 
30 #ifndef _JPLEPH_H
31 #define _JPLEPH_H 1
32 
37 
45 /***************************************************************************
46 ******* JPLEPH.H *********
47 ****************************************************************************
48 ** This header file is used both by ASC2EPH and TESTEPH programs. **
49 ****************************************************************************
50 ** Written: May 28, 1997 by PAD ** Last modified: June 23,1997 by PAD **
51 ** Modified further by Bill Gray, Jun-Aug 2001 **
52 ****************************************************************************
53 ** PAD: dr. Piotr A. Dybczynski, e-mail: dybol@phys.amu.edu.pl **
54 ** Astronomical Observatory of the A.Mickiewicz Univ., Poznan, Poland **
55 ***************************************************************************/
56 
57 /* By default, in Windoze 32, the JPL ephemeris functions are compiled
58  into a DLL. This is not really all that helpful at present, but may
59  be useful to people who want to use the functions from languages other
60  than C. */
61 
62 #include "support/configCosmos.h"
63 #include "support/cosmos-errno.h"
64 
65 //#ifdef _WIN32
66 //#define DLL_FUNC __stdcall
67 //#else
68 #define DLL_FUNC
69 //#endif
70 
71 #include <stdio.h>
72 
76 
77 void * DLL_FUNC jpl_init_ephemeris( const char *ephemeris_filename,
78 char nam[][6], double *val);
79 void DLL_FUNC jpl_close_ephemeris( void *ephem);
80 int DLL_FUNC jpl_state( void *ephem, const double et, const int list[12],
81 double pv[][6], double nut[4], const int bary);
82 int DLL_FUNC jpl_pleph( void *ephem, const double et, const int ntarg,
83 const int ncent, double rrd[], const int calc_velocity);
84 double DLL_FUNC jpl_get_double( const void *ephem, const int value);
85 double DLL_FUNC jpl_get_long( const void *ephem, const int value);
86 int DLL_FUNC make_sub_ephem( const void *ephem, const char *sub_filename,
87 const double start_jd, const double end_jd);
88 
90 
91 /* Following are constants used in */
92 /* jpl_get_double( ) and jpl_get_long( ): */
93 
97 
98 #define JPL_EPHEM_START_JD 0
99 #define JPL_EPHEM_END_JD 8
100 #define JPL_EPHEM_STEP 16
101 #define JPL_EPHEM_N_CONSTANTS 24
102 #define JPL_EPHEM_AU_IN_KM 28
103 #define JPL_EPHEM_EARTH_MOON_RATIO 36
104 #define JPL_EPHEM_EPHEMERIS_VERSION 200
105 #define JPL_EPHEM_KERNEL_SIZE 204
106 #define JPL_EPHEM_KERNEL_RECORD_SIZE 208
107 #define JPL_EPHEM_KERNEL_NCOEFF 212
108 #define JPL_EPHEM_KERNEL_SWAP_BYTES 216
109 
110 /* Right now, DEs 403 and 405 have the maximum kernel size, of 2036. */
111 /* This value may need to be updated the next time JPL releases a new DE: */
112 
113 #define MAX_KERNEL_SIZE 2036
114 
115 /***** THERE IS NO NEED TO MODIFY THE REST OF THIS SOURCE (I hope) *********/
116 
117 
118 /* A JPL binary ephemeris header contains five doubles and */
119 /* (up to) 41 long integers, so: */
120 #define JPL_HEADER_SIZE (5 * sizeof( double) + 41 * sizeof( int32_t))
121 
123 
124 #pragma pack(1)
125 
129 
130 struct jpl_eph_data {
132  int32_t ncon;
133  double au;
134  double emrat;
135  int32_t ipt[13][3];
138  int32_t swap_bytes;
139  int32_t curr_cache_loc;
140  double pvsun[6];
141  double *cache;
142  void *iinfo;
143  FILE *ifile;
144 };
145 
147 {
148  double pc[18],vc[18], twot;
149  int np, nv;
150 };
151 
153 
154 #pragma pack()
155 
156 #endif
void * iinfo
Definition: jpleph.h:142
static double vc[360+1][360+1]
Data structures for spherical harmonic expansion.
Definition: physicslib.cpp:52
int make_sub_ephem(const void *ephem, const char *sub_filename, const double start_jd, const double end_jd)
Definition: jpleph.h:130
double ephem_step
Definition: jpleph.h:131
void jpl_close_ephemeris(void *ephem)
Definition: jpleph.cpp:721
ElapsedTime et
Definition: agent_cpu_device_test.cpp:51
Definition: jpleph.h:146
double pvsun[6]
Definition: jpleph.h:140
double jpl_get_double(const void *ephem, const int value)
Definition: jpleph.cpp:72
double ephem_start
Definition: jpleph.h:131
double ephem_end
Definition: jpleph.h:131
double * cache
Definition: jpleph.h:141
double au
Definition: jpleph.h:133
#define DLL_FUNC
Definition: jpleph.h:68
double jpl_get_long(const void *ephem, const int value)
Definition: jpleph.cpp:77
int32_t curr_cache_loc
Definition: jpleph.h:139
Headers and definitions common to all COSMOS.
int jpl_pleph(void *ephem, const double et, const int ntarg, const int ncent, double rrd[], const int calc_velocity)
Definition: jpleph.cpp:128
COSMOS Error Codes.
int nv
Definition: jpleph.h:149
int32_t ncon
Definition: jpleph.h:132
int jpl_state(void *ephem, const double et, const int list[12], double pv[][6], double nut[4], const int bary)
Definition: jpleph.cpp:484
double emrat
Definition: jpleph.h:134
int32_t ncoeff
Definition: jpleph.h:137
FILE * ifile
Definition: jpleph.h:143
int32_t ipt[13][3]
Definition: jpleph.h:135
void * jpl_init_ephemeris(const char *ephemeris_filename, char nam[][6], double *val)
Definition: jpleph.cpp:596
int32_t ephemeris_version
Definition: jpleph.h:136
int32_t recsize
Definition: jpleph.h:137
int32_t kernel_size
Definition: jpleph.h:137
int32_t swap_bytes
Definition: jpleph.h:138