/* packxe2.h -- create xe2 record from star data */
/*
Copyright 2000, Steve VanDevender <stevev@hexadecimal.uoregon.edu>
Permission is granted to redistribute source code for this program if
and only if all of the following conditions are met:

1.  This copyright notice must not be removed or modified.
2.  Any changes you make to this source code must be documented.
3.  Binary versions must be distributed with complete source code.
4.  No money will be charged for distribution of binaries or source code.
*/

/* these codes are described in xephem-3.4/GUI/xephem/xe2.c */

/* name codes */
#define PPM 0
#define SAO 1
#define HD 2
#define TYCHO2 3
#define HIP 4

/* type codes */
#define STAR 0
#define STARLIKE 1
#define DOUBLE 2

/* length of xe2 record in bytes */
#define XE2SIZE 18

/* data used to construct an xe2 record.
   for all types but Tycho-2, num1 is just the catalog number of the star.
   for a Tycho-2 star, num1, num2, num3 are the Tycho-2 catalog numbers.
   ra is right ascension (J2000) in decimal hours [0..24)
   dec is declination (J2000) in decimal degrees [-90..90]
   sc is spectral class (i.e. A, G0, B9) space-padded on the right
   pmra is proper motion of ra in milliarcsecs/yr*cos(dec)
   pmdec is proper motion of dec in milliarcsec/yr
*/
struct xe2data {
	char namecode;
	char typecode;
	unsigned long num1, num2, num3;
	double ra, dec, mag;
	char sc[2];
	double pmra, pmdec;
};

/* pack data in xe2data into an xe2 record; returns 0 on failure (data
   item out of range), 1 if all data was packed */
int packxe2(struct xe2data *in, unsigned char *xe2);
