The "wcs" Package
These routines are meant to provide support for Astronomical
sky-projections.
NOTE: THIS PACKAGE IS WORK IN PROGRESS. THE INTERFACE MAY CHANGE IN THE
NEXT RELEASE, POSSIBLY WITHOUT NOTICE.
Library: karma
Link With: -lkarma
Functions
Functions
KwcsAstro
wcs_astro_setup (CONST packet_desc *pack_desc, CONST char *packet)
Setup for Astronomical Sky Co-ordinate projections.
Parameters:
- pack_desc :
The packet descriptor containing the FITS-style keywords.
- packet :
The packet data containing the FITS-stype keyword data.
Returns: A KwcsAstro object on success, else NULL.
Multithreading Level: Unsafe
void
wcs_astro_destroy (KwcsAstro ap)
Destroy KwcsAstro object.
Parameters:
- ap :
The KwcsAstro object.
Returns: Nothing.
Multithreading Level: Unsafe
void
wcs_astro_transform (KwcsAstro ap, unsigned int num_coords,
double *ra, flag ra_to_linear,
double *dec, flag dec_to_linear,
double *vel, flag vel_to_linear,
unsigned int num_restr, CONST char **restr_names,
CONST double *restr_values)
Transform between linear and projected co-ordinates.
Parameters:
- ap :
The KwcsAstro object.
- num_coords :
The number of co-ordinates to transform.
- ra :
A pointer to the right ascension values. These will be modified.
- ra_to_linear :
If TRUE the right ascension values are transformed to linear
co-ordinates, else they are transformed to non-linear co-ordinates.
- dec :
A pointer to the declination values. These will be modified.
- dec_to_linear :
If TRUE the declination values are transformed to linear
co-ordinates, else they are transformed to non-linear co-ordinates.
- vel :
A pointer to the velocity values. These will be modified.
- vel_to_linear :
If TRUE the velocity values are transformed to linear
co-ordinates, else they are transformed to non-linear co-ordinates.
- num_restr :
The number of restrictions.
- restr_names :
The array of restriction names.
- restr_values :
The restriction values.
Returns: Nothing.
Multithreading Level: Unsafe
void
wcs_astro_transform3 (KwcsAstro ap, unsigned int num_coords,
CONST char *name0, double *coords0, flag to_lin0,
CONST char *name1, double *coords1, flag to_lin1,
CONST char *name2, double *coords2, flag to_lin2,
unsigned int num_restr, CONST char **restr_names,
CONST double *restr_values)
This routine will convert up to three arrays of co-ordinates
using an astronomical projection system. The co-ordinate arrays are named.
If a co-ordinate array is not defined the co-ordinates are unchanged.
Parameters:
- ap :
The KwcsAstro object.
- num_coords :
The number of co-ordinates to transform.
- name0 :
The name of co-ordinate array 0.
- coords0 :
Co-ordinate array 0.
- to_lin0 :
If TRUE the co-ordinate 0 values are transformed to linear
co-ordinates, else they are transformed to non-linear co-ordinates.
- name1 :
The name of co-ordinate array 1.
- coords1 :
Co-ordinate array 1.
- to_lin1 :
If TRUE the co-ordinate 1 values are transformed to linear
co-ordinates, else they are transformed to non-linear co-ordinates.
- name2 :
The name of co-ordinate array 2.
- coords2 :
Co-ordinate array 2.
- to_lin2 :
If TRUE the co-ordinate 2 values are transformed to linear
co-ordinates, else they are transformed to non-linear co-ordinates.
- num_restr :
The number of restrictions.
- restr_names :
The array of restriction names.
- restr_values :
The restriction values.
Returns: Nothing.
Multithreading Level: Unsafe
void
wcs_astro_format_ra (char *string, double ra)
Format a Right Ascension value into a string.
Parameters:
- string :
The string to write to. Sufficient storage must be available.
- ra :
The Right Ascension value.
Returns: Nothing.
Multithreading Level: Unsafe
void
wcs_astro_format_dec (char *string, double dec)
Format a Declination value into a string.
Parameters:
- string :
The string to write to. Sufficient storage must be available.
- dec :
The Declination value.
Returns: Nothing.
Multithreading Level: Unsafe
void
wcs_astro_format_vel (KwcsAstro ap, char *string, double vel)
Format a velocity value into a string.
Parameters:
- ap :
The KwcsAstro object.
- string :
The string to write to. Sufficient storage must be available.
- vel :
The velocity value.
Returns: Nothing.
Multithreading Level: Unsafe
void
wcs_astro_format (KwcsAstro ap, CONST char *dim_name,
char string[STRING_LENGTH], double value)
Format a value.
Parameters:
- ap :
The KwcsAstro object.
- dim_name :
The name of the dimension.
- string :
The string to write to.
- value :
The value.
Returns: Nothing.
Multithreading Level: Unsafe
void
wcs_astro_format_extra (KwcsAstro ap, char string[STRING_LENGTH])
Format extra information.
Parameters:
- ap :
The KwcsAstro object.
- string :
The string to write to.
Returns: Nothing.
Multithreading Level: Unsafe
void
wcs_format_all (KwcsAstro ap, char coord_string[STRING_LENGTH],
CONST char *name0, double coord0,
CONST char *name1, double coord1,
CONST char *name2, double coord2,
unsigned int num_restr, CONST char **restr_names,
CONST double *restr_values,
char other_string[STRING_LENGTH])
This routine will transform and format all available information.
The data is transformed from linear to non-linear values.
Parameters:
- ap :
The KwcsAstro object.
- coord_string :
Formatted co-ordinate information is written here.
- name0 :
The name of co-ordinate 0.
- coord0 :
Co-ordinate 0.
- name1 :
The name of co-ordinate 1. If this is NULL, it is ignored.
- coord1 :
Co-ordinate 1.
- name2 :
The name of co-ordinate 2. If this is NULL, it is ignored.
- coord2 :
Co-ordinate 2.
- num_restr :
The number of restrictions.
- restr_names :
The array of restriction names.
- restr_values :
The restriction values.
- other_string :
Formatted extra information is written here.
Returns: Nothing.
Multithreading Level: Unsafe
Contact: Richard Gooch
Web Development: Ariel Internet Services