Functions
kfiles.c File Reference

Read orbital element files. More...

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "aephem.h"

Functions

int ae_read_orbit_from_cat (const char *path, const char *name, struct ae_orbit_t *orb)
 Parse orbital elements from a catalogue file. More...
 
int ae_read_star_from_cat (const char *path, const char *name, struct ae_star_t *star)
 Parse star positional data from a catalogue file. More...
 

Detailed Description

Read orbital element files.

Function Documentation

int ae_read_orbit_from_cat ( const char *  path,
const char *  name,
struct ae_orbit_t orb 
)

Parse orbital elements from a catalogue file.

The catalogue file should be a columnated ASCII file. Lines starting with a hash ('#') are treated as comments. The columns are:

  • epoch of elements;
  • inclination, in degrees;
  • longitude of the ascending node, in degrees;
  • argument of the perihelion, in degrees;
  • mean distance, in AU;
  • daily motion, in AU per day;
  • eccentricity;
  • mean anomaly, in degrees;
  • epoch of equinox and ecliptic;
  • name.
Parameters
pathThe location of the catalogue file.
nameThe name of the object, as it appears in the catalogue file.
orbFor returning the orbital elements. If the routine fails, the information in el will be undefined.
Returns
0 on successful load; on failure, a negative error code from ae_retcode_t.

References ae_orbit_t::a, AE_RET_BAD_PATH, AE_RET_OBJ_NOT_FOUND, ae_orbit_t::dm, ae_orbit_t::ecc, ae_orbit_t::epoch, ae_orbit_t::equinox, ae_orbit_t::i, ae_orbit_t::L, ae_orbit_t::M, ae_orbit_t::name, ae_orbit_t::plat, ae_orbit_t::ptable, ae_orbit_t::r, ae_orbit_t::W, and ae_orbit_t::w.

int ae_read_star_from_cat ( const char *  path,
const char *  name,
struct ae_star_t star 
)

Parse star positional data from a catalogue file.

The catalogue file should be a columnated ASCII file. Lines starting with a hash ('#') are treated as comments. The columns are:

  • epoch
  • ra hours
  • ra minutes
  • ra second
  • dec degrees
  • dec minutes
  • dec seconds
  • mu ra (in seconds/century)
  • mu dec (in seconds of arc/century)
  • v (in km/s)
  • px (in seconds of arc)
  • mag
  • name
Parameters
pathThe location of the catalogue file.
nameThe name of the star, as it appears in the catalogue file.
starFor returning the star position data. If the routine fails, the information in el will be undefined.
Returns
0 on successful load; on failure, a negative error code from ae_retcode_t.

References AE_B1950, AE_J1900, AE_J2000, AE_RET_BAD_PATH, AE_RET_OBJ_NOT_FOUND, ae_star_t::dec, ae_star_t::epoch, ae_star_t::mag, ae_star_t::mudec, ae_star_t::mura, ae_star_t::name, ae_star_t::px, ae_star_t::ra, and ae_star_t::v.