DS_CONVERT_COORDINATES(3)

EXPERIMENTAL_FUNC
ds_convert_coordinates - Convert co-ordinate values for a dimension.

SYNOPSIS
#include <karma_ds.h>

void ds_convert_coordinates

(CONST dim_desc *dim, unsigned int num_coords, double *coords, flag to_indices, flag blank, flag add_half)

DESCRIPTION
This function will convert between co-ordinates indices (index positions along a dimension) and co-ordinate values. The co-ordinate values may be regularly or irregularly spaced, either case is catered for. Note that for co-ordinate systems which have a dependency between different axes (such as RA-DEC co-ordinates used in astronomy), the co-ordinate values this function manipulates are <<linear>> co-ordinates. The <-wcs-> package provides for conversion between linear and non-linear co-ordinates (proper world co-ordinates).

dim The dimension descriptor.

num_coords
    The number of co-ordinate values to convert.

coords
    The array of co-ordinate values to convert.

to_indices
    If TRUE, the co-ordinate values are converted to index positions along the dimension, else they are converted to co-ordinate values.

blank
    If TRUE, all out-of-bounds values are set to TOOBIG, else out-of-bounds values may or may not be set to TOOBIG. If you know all your values are within bounds, setting this to FALSE may save time.

add_half
    If TRUE and <<to_indices>> is TRUE, the value 0.5 will be added to all in-bounds values as they are written.

RETURN VALUE
Nothing.

Multi-threading Level
Unsafe.

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABLITY
The Karma Distribution is available for anonymous ftp from: ftp://ftp.atnf.csiro.au/pub/software/karma/ ftp://wuarchive.wustl.edu/graphics/graphics/packages/karma/ ftp://ftp.pwr.wroc.pl/pub/karma/ The Karma Home Page is: http://www.atnf.csiro.au/karma/