novas.h
Go to the documentation of this file.
1 /*
2  Naval Observatory Vector Astrometry Software (NOVAS)
3  C Edition, Version 3.1
4 
5  novas.h: Header file for novas.c
6 
7  U. S. Naval Observatory
8  Astronomical Applications Dept.
9  Washington, DC
10  http://www.usno.navy.mil/USNO/astronomical-applications
11 */
12 
13 #ifndef _NOVAS_
14  #define _NOVAS_
15 
16  #ifndef __STDIO__
17  #include <stdio.h>
18  #endif
19 
20  #ifndef __MATH__
21  #include <math.h>
22  #endif
23 
24  #ifndef __STRING__
25  #include <string.h>
26  #endif
27 
28  #ifndef __STDLIB__
29  #include <stdlib.h>
30  #endif
31 
32  #ifndef __CTYPE__
33  #include <ctype.h>
34  #endif
35 
36  #ifndef _CONSTS_
37  #include "novascon.h"
38  #endif
39 
40  #ifndef _SOLSYS_
41  #include "solarsystem.h"
42  #endif
43 
44  #ifndef _NUTATION_
45  #include "nutation.h"
46  #endif
47 
48 
49 /*
50  Structures
51 */
52 
53 /*
54  struct cat_entry: basic astrometric data for any celestial object
55  located outside the solar system; the catalog
56  data for a star
57 
58  starname[SIZE_OF_OBJ_NAME] = name of celestial object
59  catalog[SIZE_OF_CAT_NAME] = catalog designator (e.g., HIP)
60  starnumber = integer identifier assigned to object
61  ra = ICRS right ascension (hours)
62  dec = ICRS declination (degrees)
63  promora = ICRS proper motion in right ascension
64  (milliarcseconds/year)
65  promodec = ICRS proper motion in declination
66  (milliarcseconds/year)
67  parallax = parallax (milliarcseconds)
68  radialvelocity = radial velocity (km/s)
69 
70  SIZE_OF_OBJ_NAME and SIZE_OF_CAT_NAME are defined below. Each is the
71  number of characters in the string (the string length) plus the null
72  terminator.
73 */
74 
75  #define SIZE_OF_OBJ_NAME 51
76  #define SIZE_OF_CAT_NAME 4
77 
78  typedef struct
79  {
80  char starname[SIZE_OF_OBJ_NAME];
81  char catalog[SIZE_OF_CAT_NAME];
82  long int starnumber;
83  double ra;
84  double dec;
85  double promora;
86  double promodec;
87  double parallax;
88  double radialvelocity;
89  } cat_entry;
90 
91 /*
92  struct object: specifies the celestial object of interest
93 
94  type = type of object
95  = 0 ... major planet, Pluto, Sun, or Moon
96  = 1 ... minor planet
97  = 2 ... object located outside the solar system
98  (star, nebula, galaxy, etc.)
99  number = object number
100  For 'type' = 0: Mercury = 1, ..., Pluto = 9,
101  Sun = 10, Moon = 11
102  For 'type' = 1: minor planet number
103  For 'type' = 2: set to 0 (object is
104  fully specified in 'struct cat_entry')
105  name = name of the object (limited to
106  (SIZE_OF_OBJ_NAME - 1) characters)
107  star = basic astrometric data for any celestial object
108  located outside the solar system; the catalog
109  data for a star
110 */
111 
112  typedef struct
113  {
114  short int type;
115  short int number;
116  char name[SIZE_OF_OBJ_NAME];
117  cat_entry star;
118  } object;
119 
120 /*
121  struct on_surface: data for an observer's location on the surface of
122  the Earth. The atmospheric parameters are used
123  only by the refraction function called from
124  function 'equ2hor'. Additional parameters can be
125  added to this structure if a more sophisticated
126  refraction model is employed.
127 
128  latitude = geodetic (ITRS) latitude; north positive (degrees)
129  longitude = geodetic (ITRS) longitude; east positive (degrees)
130  height = height of the observer (meters)
131  temperature = temperature (degrees Celsius)
132  pressure = atmospheric pressure (millibars)
133 */
134 
135  typedef struct
136  {
137  double latitude;
138  double longitude;
139  double height;
140  double temperature;
141  double pressure;
142  } on_surface;
143 
144 /*
145  struct in_space: data for an observer's location on a near-Earth
146  spacecraft
147 
148  sc_pos[3] = geocentric position vector (x, y, z), components
149  in km
150  sc_vel[3] = geocentric velocity vector (x_dot, y_dot,
151  z_dot), components in km/s
152 
153  Both vectors with respect to true equator and
154  equinox of date
155 */
156 
157  typedef struct
158  {
159  double sc_pos[3];
160  double sc_vel[3];
161  } in_space;
162 
163 /*
164  struct observer: data specifying the location of the observer
165 
166  where = integer code specifying location of observer
167  = 0: observer at geocenter
168  = 1: observer on surface of earth
169  = 2: observer on near-earth spacecraft
170  on_surface = structure containing data for an observer's
171  location on the surface of the Earth (where = 1)
172  near_earth = data for an observer's location on a near-Earth
173  spacecraft (where = 2)
174 */
175 
176  typedef struct
177  {
178  short int where;
179  on_surface on_surf;
180  in_space near_earth;
181  } observer;
182 
183 /*
184  struct sky_pos: data specifying a celestial object's place on the
185  sky; contains the output from function 'place'
186 
187  r_hat[3] = unit vector toward object (dimensionless)
188  ra = apparent, topocentric, or astrometric
189  right ascension (hours)
190  dec = apparent, topocentric, or astrometric
191  declination (degrees)
192  dis = true (geometric, Euclidian) distance to solar
193  system body or 0.0 for star (AU)
194  rv = radial velocity (km/s)
195 */
196 
197  typedef struct
198  {
199  double r_hat[3];
200  double ra;
201  double dec;
202  double dis;
203  double rv;
204  } sky_pos;
205 
206 /*
207  struct ra_of_cio: right ascension of the Celestial Intermediate
208  Origin (CIO) with respect to the GCRS
209 
210  jd_tdb = TDB Julian date
211  ra_cio = right ascension of the CIO with respect
212  to the GCRS (arcseconds)
213 */
214 
215  typedef struct
216  {
217  double jd_tdb;
218  double ra_cio;
219  } ra_of_cio;
220 
221 
222 /*
223  Define "origin" constants.
224 */
225 
226  #define BARYC 0
227  #define HELIOC 1
228 
229 /*
230  Function prototypes
231 */
232 
233  double *readeph (int mp, char *name, double jd,
234 
235  int *err);
236 
237  short int app_star (double jd_tt, cat_entry *star,
238  short int accuracy,
239 
240  double *ra, double *dec);
241 
242  short int virtual_star (double jd_tt, cat_entry *star,
243  short int accuracy,
244 
245  double *ra, double *dec);
246 
247  short int astro_star (double jd_tt, cat_entry *star,
248  short int accuracy,
249 
250  double *ra, double *dec);
251 
252  short int app_planet (double jd_tt, object *ss_body,
253  short int accuracy,
254 
255  double *ra, double *dec, double *dis);
256 
257  short int virtual_planet (double jd_tt, object *ss_body,
258  short int accuracy,
259 
260  double *ra, double *dec, double *dis);
261 
262  short int astro_planet (double jd_tt, object *ss_body,
263  short int accuracy,
264 
265  double *ra, double *dec, double *dis);
266 
267  short int topo_star (double jd_tt, double delta_t, cat_entry *star,
268  on_surface *position, short int accuracy,
269 
270  double *ra, double *dec);
271 
272  short int local_star (double jd_tt, double delta_t, cat_entry *star,
273  on_surface *position, short int accuracy,
274 
275  double *ra, double *dec);
276 
277  short int topo_planet (double jd_tt, object *ss_body, double delta_t,
278  on_surface *position, short int accuracy,
279 
280  double *ra, double *dec, double *dis);
281 
282  short int local_planet (double jd_tt, object *ss_body,
283  double delta_t, on_surface *position,
284  short int accuracy,
285 
286  double *ra, double *dec, double *dis);
287 
288  short int mean_star (double jd_tt, double ra, double dec,
289  short int accuracy,
290 
291  double *ira, double *idec);
292 
293  short int place (double jd_tt, object *cel_object,
294  observer *location, double delta_t,
295  short int coord_sys, short int accuracy,
296 
297  sky_pos *output);
298 
299  void equ2gal (double rai, double deci,
300 
301  double *glon, double *glat);
302 
303  short int equ2ecl (double jd_tt, short int coord_sys,
304  short int accuracy, double ra, double dec,
305 
306  double *elon, double *elat);
307 
308  short int equ2ecl_vec (double jd_tt, short int coord_sys,
309  short int accuracy, double *pos1,
310 
311  double *pos2);
312 
313  short int ecl2equ_vec (double jd_tt, short int coord_sys,
314  short int accuracy, double *pos1,
315 
316  double *pos2);
317 
318  void equ2hor (double jd_ut1, double delta_t, short int accuracy,
319  double xp, double yp, on_surface *location, double ra,
320  double dec, short int ref_option,
321 
322  double *zd, double *az, double *rar, double *decr);
323 
324  short int gcrs2equ (double jd_tt, short int coord_sys,
325  short int accuracy, double rag, double decg,
326 
327  double *ra, double *dec);
328 
329  short int sidereal_time (double jd_high, double jd_low,
330  double delta_t, short int gst_type,
331  short int method, short int accuracy,
332 
333  double *gst);
334 
335  double era (double jd_high, double jd_low);
336 
337  short int ter2cel (double jd_ut_high, double jd_ut_low,
338  double delta_t, short int method,
339  short int accuracy, short int option, double xp,
340  double yp, double *vec1,
341 
342  double *vec2);
343 
344  short int cel2ter (double jd_ut_high, double jd_ut_low,
345  double delta_t, short int method,
346  short int accuracy, short int option,
347  double xp, double yp, double *vec1,
348 
349  double *vec2);
350 
351  void spin (double angle, double *pos1,
352 
353  double *pos2);
354 
355  void wobble (double tjd, short int direction, double xp, double yp,
356  double *pos1,
357 
358  double *pos2);
359 
360  void terra (on_surface *location, double st,
361 
362  double *pos, double *vel);
363 
364  void e_tilt (double jd_tdb, short int accuracy,
365 
366  double *mobl, double *tobl, double *ee, double *dpsi,
367  double *deps);
368 
369  short int cel_pole (double tjd, short int type, double dpole1,
370  double dpole2);
371 
372  double ee_ct (double jd_high, double jd_low, short int accuracy);
373 
374  void frame_tie (double *pos1, short int direction,
375 
376  double *pos2);
377 
378  void proper_motion (double jd_tdb1, double *pos, double *vel,
379  double jd_tdb2,
380 
381  double *pos2);
382 
383  void bary2obs (double *pos, double *pos_obs,
384 
385  double *pos2, double *lighttime);
386 
387  short int geo_posvel (double jd_tt, double delta_t,
388  short int accuracy, observer *obs,
389 
390  double *pos, double *vel);
391 
392  short int light_time (double jd_tdb, object *ss_object,
393  double pos_obs[3], double tlight0,
394  short int accuracy,
395 
396  double pos[3], double *tlight);
397 
398  double d_light (double *pos1, double *pos_obs);
399 
400  short int grav_def (double jd_tdb, short int loc_code,
401  short int accuracy, double *pos1, double *pos_obs,
402 
403  double *pos2);
404 
405  void grav_vec (double *pos1, double *pos_obs, double *pos_body,
406  double rmass,
407 
408  double *pos2);
409 
410  void aberration (double *pos, double *ve, double lighttime,
411 
412  double *pos2);
413 
414  void rad_vel (object *cel_object, double *pos, double *vel,
415  double *vel_obs, double d_obs_geo, double d_obs_sun,
416  double d_obj_sun,
417 
418  double *rv);
419 
420  short int precession (double jd_tdb1, double *pos1, double jd_tdb2,
421 
422  double *pos2);
423 
424  void nutation (double jd_tdb, short int direction, short int accuracy,
425  double *pos,
426 
427  double *pos2);
428 
429  void nutation_angles (double t, short int accuracy,
430 
431  double *dpsi, double *deps);
432 
433  void fund_args (double t,
434 
435  double a[5]);
436 
437  double mean_obliq (double jd_tdb);
438 
439  short int vector2radec (double *pos,
440 
441  double *ra, double *dec);
442 
443  void radec2vector (double ra, double dec, double dist,
444 
445  double *vector);
446 
447  void starvectors (cat_entry *star,
448 
449  double *pos, double *vel);
450 
451  void tdb2tt (double tdb_jd,
452 
453  double *tt_jd, double *secdiff);
454 
455  short int cio_ra (double jd_tt, short int accuracy,
456 
457  double *ra_cio);
458 
459  short int cio_location (double jd_tdb, short int accuracy,
460 
461  double *ra_cio, short int *ref_sys);
462 
463  short int cio_basis (double jd_tdb, double ra_cio, short int ref_sys,
464  short int accuracy,
465 
466  double *x, double *y, double *z);
467 
468  short int cio_array (double jd_tdb, long int n_pts,
469 
470  ra_of_cio *cio);
471 
472  double ira_equinox (double jd_tdb, short int equinox,
473  short int accuracy);
474 
475  short int ephemeris (double jd[2], object *cel_obj, short int origin,
476  short int accuracy,
477 
478  double *pos, double *vel);
479 
480  void transform_hip (cat_entry *hipparcos,
481 
482  cat_entry *hip_2000);
483 
484  short int transform_cat (short int option, double date_incat,
485  cat_entry *incat, double date_newcat,
486  char newcat_id[SIZE_OF_CAT_NAME],
487 
488  cat_entry *newcat);
489 
490  void limb_angle (double pos_obj[3], double pos_obs[3],
491 
492  double *limb_ang, double *nadir_ang);
493 
494  double refract (on_surface *location, short int ref_option,
495  double zd_obs);
496 
497  double julian_date (short int year, short int month, short int day,
498  double hour);
499 
500  void cal_date (double tjd,
501 
502  short int *year, short int *month, short int *day,
503  double *hour);
504 
505  double norm_ang (double angle);
506 
507  short int make_cat_entry (char star_name[SIZE_OF_OBJ_NAME],
508  char catalog[SIZE_OF_CAT_NAME],
509  long int star_num, double ra, double dec,
510  double pm_ra, double pm_dec, double parallax,
511  double rad_vel,
512 
513  cat_entry *star);
514 
515  short int make_object (short int type, short int number,
516  char name[SIZE_OF_OBJ_NAME],
517  cat_entry *star_data,
518 
519  object *cel_obj);
520 
521  short int make_observer (short int where, on_surface *obs_surface,
522  in_space *obs_space,
523 
524  observer *obs);
525 
527 
528  observer *obs_at_geocenter);
529 
530  void make_observer_on_surface (double latitude, double longitude,
531  double height, double temperature,
532  double pressure,
533 
534  observer *obs_on_surface);
535 
536  void make_observer_in_space (double sc_pos[3], double sc_vel[3],
537 
538  observer *obs_in_space);
539 
540  void make_on_surface (double latitude, double longitude,
541  double height,
542  double temperature, double pressure,
543 
544  on_surface *obs_surface);
545 
546  void make_in_space (double sc_pos[3], double sc_vel[3],
547 
548  in_space *obs_space);
549 
550 
551 #endif
short int grav_def(double jd_tdb, short int loc_code, short int accuracy, double *pos1, double *pos_obs, double *pos2)
double ira_equinox(double jd_tdb, short int equinox, short int accuracy)
const XML_Char * name
Definition: expat.h:151
ofstream output
Double_t angle
Definition: plot.C:86
short int make_object(short int type, short int number, const char name[SIZE_OF_OBJ_NAME], cat_entry *star_data, object *cel_obj)
short int topo_star(double jd_tt, double delta_t, cat_entry *star, on_surface *position, short int accuracy, double *ra, double *dec)
#define location
void make_observer_in_space(double sc_pos[3], double sc_vel[3], observer *obs_in_space)
#define SIZE_OF_OBJ_NAME
Definition: novas.h:75
#define SIZE_OF_CAT_NAME
Definition: novas.h:76
void equ2gal(double rai, double deci, double *glon, double *glat)
void tdb2tt(double tdb_jd, double *tt_jd, double *secdiff)
void e_tilt(double jd_tdb, short int accuracy, double *mobl, double *tobl, double *ee, double *dpsi, double *deps)
short int ephemeris(double jd[2], object *cel_obj, short int origin, short int accuracy, double *pos, double *vel)
void proper_motion(double jd_tdb1, double *pos, double *vel, double jd_tdb2, double *pos2)
TODO.
short int transform_cat(short int option, double date_incat, cat_entry *incat, double date_newcat, char newcat_id[SIZE_OF_CAT_NAME], cat_entry *newcat)
short int cel_pole(double tjd, short int type, double dpole1, double dpole2)
short int local_star(double jd_tt, double delta_t, cat_entry *star, on_surface *position, short int accuracy, double *ra, double *dec)
short int cio_array(double jd_tdb, long int n_pts, ra_of_cio *cio)
short int precession(double jd_tdb1, double *pos1, double jd_tdb2, double *pos2)
short int topo_planet(double jd_tt, object *ss_body, double delta_t, on_surface *position, short int accuracy, double *ra, double *dec, double *dis)
double era(double jd_high, double jd_low)
short int astro_planet(double jd_tt, object *ss_body, short int accuracy, double *ra, double *dec, double *dis)
void limb_angle(double pos_obj[3], double pos_obs[3], double *limb_ang, double *nadir_ang)
short int app_planet(double jd_tt, object *ss_body, short int accuracy, double *ra, double *dec, double *dis)
double dist
Definition: runWimpSim.h:113
short int ecl2equ_vec(double jd_tt, short int coord_sys, short int accuracy, double *pos1, double *pos2)
void transform_hip(cat_entry *hipparcos, cat_entry *hip_2000)
Definition: novas.h:112
short int ter2cel(double jd_ut_high, double jd_ut_low, double delta_t, short int method, short int accuracy, short int option, double xp, double yp, double *vec1, double *vec2)
double refract(on_surface *location, short int ref_option, double zd_obs)
void cal_date(double tjd, short int *year, short int *month, short int *day, double *hour)
short int make_cat_entry(const char star_name[SIZE_OF_OBJ_NAME], const char catalog[SIZE_OF_CAT_NAME], long int star_num, double ra, double dec, double pm_ra, double pm_dec, double parallax, double rad_vel, cat_entry *star)
double julian_date(short int year, short int month, short int day, double hour)
void bary2obs(double *pos, double *pos_obs, double *pos2, double *lighttime)
short int astro_star(double jd_tt, cat_entry *star, short int accuracy, double *ra, double *dec)
short int make_observer(short int where, on_surface *obs_surface, in_space *obs_space, observer *obs)
const double a
void nutation_angles(double t, short int accuracy, double *dpsi, double *deps)
void wobble(double tjd, short int direction, double xp, double yp, double *pos1, double *pos2)
void equ2hor(double jd_ut1, double delta_t, short int accuracy, double xp, double yp, on_surface *location, double ra, double dec, short int ref_option, double *zd, double *az, double *rar, double *decr)
double d_light(double *pos1, double *pos_obs)
short int equ2ecl_vec(double jd_tt, short int coord_sys, short int accuracy, double *pos1, double *pos2)
double mean_obliq(double jd_tdb)
short int cel2ter(double jd_ut_high, double jd_ut_low, double delta_t, short int method, short int accuracy, short int option, double xp, double yp, double *vec1, double *vec2)
TString mp
Definition: loadincs.C:4
void make_on_surface(double latitude, double longitude, double height, double temperature, double pressure, on_surface *obs_surface)
void aberration(double *pos, double *ve, double lighttime, double *pos2)
void rad_vel(object *cel_object, double *pos, double *vel, double *vel_obs, double d_obs_geo, double d_obs_sun, double d_obj_sun, double *rv)
short int equ2ecl(double jd_tt, short int coord_sys, short int accuracy, double ra, double dec, double *elon, double *elat)
Definition: novas.h:197
short int cio_basis(double jd_tdb, double ra_cio, short int ref_sys, short int accuracy, double *x, double *y, double *z)
z
Definition: test.py:28
void radec2vector(double ra, double dec, double dist, double *vector)
short int virtual_planet(double jd_tt, object *ss_body, short int accuracy, double *ra, double *dec, double *dis)
short int virtual_star(double jd_tt, cat_entry *star, short int accuracy, double *ra, double *dec)
double ee_ct(double jd_high, double jd_low, short int accuracy)
void make_observer_at_geocenter(observer *obs_at_geocenter)
Definition: gst.h:8
void spin(double angle, double *pos1, double *pos2)
short int gcrs2equ(double jd_tt, short int coord_sys, short int accuracy, double rag, double decg, double *ra, double *dec)
short int cio_location(double jd_tdb, short int accuracy, double *ra_cio, short int *ref_sys)
short int app_star(double jd_tt, cat_entry *star, short int accuracy, double *ra, double *dec)
short int sidereal_time(double jd_high, double jd_low, double delta_t, short int gst_type, short int method, short int accuracy, double *gst)
double norm_ang(double angle)
void starvectors(cat_entry *star, double *pos, double *vel)
void make_in_space(double sc_pos[3], double sc_vel[3], in_space *obs_space)
void nutation(double jd_tdb, short int direction, short int accuracy, double *pos, double *pos2)
short int vector2radec(double *pos, double *ra, double *dec)
short int mean_star(double jd_tt, double ra, double dec, short int accuracy, double *ira, double *idec)
short int geo_posvel(double jd_tt, double delta_t, short int accuracy, observer *obs, double *pos, double *vel)
short int cio_ra(double jd_tt, short int accuracy, double *ra_cio)
Definition: novas.h:78
short int place(double jd_tt, object *cel_object, observer *location, double delta_t, short int coord_sys, short int accuracy, sky_pos *output)
short int local_planet(double jd_tt, object *ss_body, double delta_t, on_surface *position, short int accuracy, double *ra, double *dec, double *dis)
void frame_tie(double *pos1, short int direction, double *pos2)
void terra(on_surface *location, double st, double *pos, double *vel)
short int light_time(double jd_tdb, object *ss_object, double pos_obs[3], double tlight0, short int accuracy, double pos[3], double *tlight)
double * readeph(int mp, char *name, double jd, int *err)
void grav_vec(double *pos1, double *pos_obs, double *pos_body, double rmass, double *pos2)
void fund_args(double t, double a[5])
void make_observer_on_surface(double latitude, double longitude, double height, double temperature, double pressure, observer *obs_on_surface)
static constexpr Double_t year
Definition: Munits.h:185