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

wcs_astro_get_associatedCreate/get associated Astronomical Sky Co-ordinate projections.
wcs_astro_setupSetup for Astronomical Sky Co-ordinate projections.
wcs_astro_destroyDestroy KwcsAstro object.
wcs_astro_test_radecTest if a KwcsAstro object has RA/GLON and DEC/GLAT defined.
wcs_astro_test_velocityTest if a KwcsAstro object has velocity or frequency defined.
wcs_astro_test_if_raTest if an axis is a Right Ascension axis.
wcs_astro_test_if_decTest if an axis is a Declination axis.
wcs_astro_test_if_glonTest if an axis is a Galactic Longitude axis.
wcs_astro_test_if_glatTest if an axis is a Galactic Latitude axis.
wcs_astro_test_if_lonTest if an axis is a longitude axis.
wcs_astro_test_if_latTest if an axis is a latitude axis.
wcs_astro_transformTransform between linear and projected co-ordinates.
wcs_astro_transform3Transform between linear and projected co-ordinates.
wcs_astro_breakdown_hmsBreakdown a time value into components.
wcs_astro_format_hmsFormat a time value into a string.
wcs_astro_breakdown_dmsBreak down an angular value into degrees, minutes and seconds.
wcs_astro_format_dmsFormat an angle value into a string.
wcs_astro_format_velFormat a velocity value into a string.
wcs_astro_breakdown_timeBreakdown a time value into components.
wcs_astro_format_timeFormat a time value into a string.
wcs_astro_formatFormat a value. No transformation is applied.
wcs_astro_format_allTransform and format all available information.
wcs_astro_get_preferred_unitsGet preferred units for data.
wcs_astro_get_equinoxGet the Equinox.
wcs_astro_get_rotationGet the RA-DEC rotation.
wcs_astro_get_referenceGet reference value for an axis.
wcs_astro_update_locationUpdate the location ("CRVALn" and "CRPIXn") values.


Functions


EXPERIMENTAL FUNCTION: subject to change without notice

KwcsAstro wcs_astro_get_associated (multi_array *multi_desc,unsigned int index)

This routine will attempt create/get the associated Astronomical Sky Co-ordinate projection information for a general data structure. If the projection information is found, it is associated with the general data structure in the multi_array descriptor, to speed subsequent accesses.

Parameters:

Returns: A KwcsAstro object on success, else NULL.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KwcsAstro wcs_astro_setup (CONST packet_desc *pack_desc, CONST char *packet)

Setup for Astronomical Sky Co-ordinate projections.

Parameters:

Returns: A KwcsAstro object on success, else NULL.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void wcs_astro_destroy (KwcsAstro ap)

Destroy KwcsAstro object.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag wcs_astro_test_radec (KwcsAstro ap)

Test if a KwcsAstro object has RA/GLON and DEC/GLAT defined.

Parameters:

Returns: TRUE if the KwcsAstro object has RA and DEC defined, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag wcs_astro_test_velocity (KwcsAstro ap)

Test if a KwcsAstro object has velocity or frequency defined.

Parameters:

Returns: TRUE if the KwcsAstro object has velocity or frequency defined, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag wcs_astro_test_if_ra (KwcsAstro ap, CONST char *axis_name)

Test if an axis is a Right Ascension axis.

Parameters:

Returns: TRUE the axis is a Right Ascension axis, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag wcs_astro_test_if_dec (KwcsAstro ap, CONST char *axis_name)

Test if an axis is a Declination axis.

Parameters:

Returns: TRUE the axis is a Declination axis, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag wcs_astro_test_if_glon (KwcsAstro ap, CONST char *axis_name)

Test if an axis is a Galactic Longitude axis.

Parameters:

Returns: TRUE the axis is a Galactic Longitude axis, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag wcs_astro_test_if_glat (KwcsAstro ap, CONST char *axis_name)

Test if an axis is a Galactic Latitude axis.

Parameters:

Returns: TRUE the axis is a Galactic Latitude axis, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag wcs_astro_test_if_lon (KwcsAstro ap, CONST char *axis_name)

Test if an axis is a longitude axis.

Parameters:

Returns: TRUE the axis is a longitude axis, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag wcs_astro_test_if_lat (KwcsAstro ap, CONST char *axis_name)

Test if an axis is a latitude axis.

Parameters:

Returns: TRUE the axis is a latitude axis, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

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:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

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:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag wcs_astro_breakdown_hms (int *hours, int *minutes, double *seconds, int *whole_seconds, double *subseconds, double input, double offset)

Breakdown a time value into components.

Parameters:

Returns: TRUE if the value was legal, else FALSE.
Multithreading Level: Unsafe
Note:


EXPERIMENTAL FUNCTION: subject to change without notice

void wcs_astro_format_hms (char *string, double hours)

Format a time value into a string.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag wcs_astro_breakdown_dms (flag *negative, int *degrees, int *minutes, double *seconds, int *whole_seconds, double *subseconds, double input, double offset)

Break down an angular value into degrees, minutes and seconds.

Parameters:

Returns: TRUE if the value was legal, else FALSE.
Multithreading Level: Unsafe
Note:


EXPERIMENTAL FUNCTION: subject to change without notice

void wcs_astro_format_dms (char *string, double deg)

Format an angle value into a string.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void wcs_astro_format_vel (KwcsAstro ap, char *string, double vel)

Format a velocity value into a string.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void wcs_astro_breakdown_time (unsigned int *year, unsigned int *month, unsigned int *day_of_month, unsigned int *day_of_year, unsigned int *hours, unsigned int *minutes, double *seconds, unsigned int *whole_seconds, double *subseconds, double time_val)

Breakdown a time value into components.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void wcs_astro_format_time (char *string, double time_val)

Format a time value into a string.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void wcs_astro_format (KwcsAstro ap, CONST char *dim_name, char string[STRING_LENGTH], double value)

Format a value. No transformation is applied.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void wcs_astro_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:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag wcs_astro_get_preferred_units (char new_units[STRING_LENGTH], char format_str[STRING_LENGTH], double *scale, CONST char *old_units)

Get preferred units for data.

Parameters:

Returns: TRUE if preferred units were found, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

unsigned int wcs_astro_get_equinox (KwcsAstro ap)

Get the Equinox.

Parameters:

Returns: The year of the Equinox (typically 1950 or 2000).
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

double wcs_astro_get_rotation (KwcsAstro ap)

Get the RA-DEC rotation.

Parameters:

Returns: The rotation in degrees.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

double wcs_astro_get_reference (KwcsAstro ap, CONST char *name, flag linear)

Get reference value for an axis.

Parameters:

Returns: The reference value.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void wcs_astro_update_location (KwcsAstro ap, unsigned int axis_number, CONST packet_desc *pack_desc, CONST char *packet)

Update the location ("CRVALn" and "CRPIXn") values.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


Back to Karma Home Page
Contact: Richard Gooch
Web Development: Ariel Internet Services