Macros | Functions | Variables
constel.c File Reference

Information on constellation names and boundaries. More...

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

Macros

#define AE_CONSTEL_N_CON   89
 The number of constellations defined.
 
#define AE_CONSTEL_N_GREEK   24
 The number of Greek letters. More...
 
#define AE_CONSTEL_N_BOUNDARIES   357
 The number of constellation boundaries defined in ae_constel_boundary.
 

Functions

void ae_skip_white (char *p)
 Move a string-pointer past any white space. More...
 
int ae_cat_to_constel_index (const char *cat_name, char *full_name, int len)
 Given a catalogue star name, find a star's constellation. More...
 
int ae_coord_to_constel_index (double ra, double dec, double epoch)
 Given a sky coordinate, find the constellation it is in. More...
 

Variables

const char * ae_constel_name [AE_CONSTEL_N_CON]
 A list of constellation names. More...
 
char * ae_greek_letter_name [AE_CONSTEL_N_GREEK]
 A list of the names of Greek letters. More...
 
long ae_constel_boundary [4 *AE_CONSTEL_N_BOUNDARIES]
 A definition of constellation boundaries. More...
 

Detailed Description

Information on constellation names and boundaries.

Macro Definition Documentation

#define AE_CONSTEL_N_GREEK   24

The number of Greek letters.

Referenced by ae_cat_to_constel_index().

Function Documentation

int ae_cat_to_constel_index ( const char *  cat_name,
char *  full_name,
int  len 
)

Given a catalogue star name, find a star's constellation.

Optionally get a full star-constellation name.

Parameters
cat_nameThe star name from the catalogue. It should be of the form {2-char Greek letter abbrev.}[-#]{3-char constellation name}({star name}). For example: `beCet(Diphda)', `al-2Lib(Zubenelgen)'.
full_nameFor returning an expanded star name; set to NULL if you do not need this.
lenThe length of full_name; ignored if full_name is NULL.
Returns
The index of ae_constel_name representing the constellation that this star lives in; or -1 if it cannot be found.

References AE_CONSTEL_N_CON, AE_CONSTEL_N_GREEK, ae_constel_name, ae_greek_letter_name, and ae_skip_white().

int ae_coord_to_constel_index ( double  ra,
double  dec,
double  epoch 
)

Given a sky coordinate, find the constellation it is in.

Parameters
raThe right ascension.
decThe declination.
epochThe Julian date for the ra/dec coordinates.
Returns
The index of ae_constel_name representing the constellation that this coordinate lives in; or -1 if it cannot be found.

References ae_constel_boundary, AE_CONSTEL_N_BOUNDARIES, AE_FROM_J2000, ae_polar_to_rect(), ae_precess(), AE_RTD, and AE_TO_J2000.

void ae_skip_white ( char *  p)

Move a string-pointer past any white space.

Parameters
pA string pointer.

Referenced by ae_cat_to_constel_index().

Variable Documentation

long ae_constel_boundary[4 *AE_CONSTEL_N_BOUNDARIES]

A definition of constellation boundaries.

The array items are:

  • lower right ascension, in units of hours times 3600
  • upper right ascension, in units of hours times 3600
  • lower declination, in units of degrees times 3600
  • array index of ae_constel_name corresponding to the constellation

Reference:

  • Roman, Nancy Grace, "Identification of a Constellation from a Position" Pub. Astron. Soc. Pac. 99, 695, (1987).

Referenced by ae_coord_to_constel_index().

const char* ae_constel_name[AE_CONSTEL_N_CON]

A list of constellation names.

Cancri is also abbreviated `Cnc'.

Referenced by ae_cat_to_constel_index().

char* ae_greek_letter_name[AE_CONSTEL_N_GREEK]
Initial value:
= {
"alpha",
"beta",
"gamma",
"delta",
"epsilon",
"zeta",
"eta",
"theta",
"iota",
"kappa",
"lambda",
"mu",
"nu",
"xi",
"omicron",
"pi",
"rho",
"sigma",
"tau",
"upsilon",
"phi",
"chi",
"psi",
"omega"
}

A list of the names of Greek letters.

Referenced by ae_cat_to_constel_index().