View on
Pete Ratzlaff > Astro-WCS-LibWCS-0.93 > Astro::WCS::LibWCS



Annotate this POD

View/Report Bugs
Module Version: 0.93   Source   Latest Release: Astro-WCS-LibWCS-0.94


Astro::WCS::LibWCS - Perl interface to WCSTools libwcs


  use Astro::WCS::LibWCS;                  # export nothing by default
  use Astro::WCS::LibWCS qw( :functions ); # export function names
  use Astro::WCS::LibWCS qw( :constants ); # export constant names


This module is a Perl interface to the routines in the WCSTools libwcs C library, by Doug Mink. WCSTools is a package of programs and a library for using the World Coordinate System (WCS). See for more information on WCSTools.

Name-space issues ^

By default nothing is exported into your name-space when you use this package. Instead, Astro::WCS::LibWCS uses the Exporter module's support for name-space tags. The available tags are :functions and :constants.

Deviations from libwcs ^

pix2wcst() does not require the final $lstr argument.

hgetm() and hgets() limit the length of the returned string to the $lstr argument given. If $lstr is less than or equal to zero, a maximum length of 2880 characters is used.

Matrix Arguments ^

A few libwcs functions require an array of doubles representing matrices. These functions should be handed a Perl array reference (multi-dimensional arrays are fine) with enough elements, once completely unpacked, to satisfy the input demands of the function in question. If one is using a module such as PDL, then direct passing of the machine-formatted data is possible by using a scalar reference which points to the information (e.g., $piddle->get_dataref).

Quasi-Object-Oriented Interface ^

Astro::WCS::LibWCS provides, in addition to the normal libwcs functions, an OO interface. One obtains an "object" by calling one of wcsinit(), wcsninit(), wcsinitn(), wcsninitn(), wcsinitc(), wcsninitc(), wcsxinit() or wcskinit(). The actual object class is WCSPtr. Any libwcs routines which expect the first argument to be of type struct WorldCoor * are blessed into this class. As an added bonus, any of these routines which begin with the string "wcs" can be called shorthand without the prefix.

Library routines

The following routines are blessed into the WCSPtr class (along with their shorthand names):

wcsfree( ), free( )
wcstype( ), type( )
wcsreset( ), reset( )
wcseqset( ), eqset( )
wcscdset( ), cdset( )
wcsdeltset( ), deltset( )
wcspcset( ), pcset( )
wcsrotset( ), rotset( )
iswcs( )
nowcs( )
wcsshift( ), shift( )
wcscent( ), cent( )
wcssize( ), size( )
wcsfull( ), full( )
wcsrange( ), range( )
wcscominit( ), cominit( )
wcscom( ), com( )
wcsoutinit( ), outinit( )
getwcsout( )
wcsininit( ), ininit( )
getwcsin( )
setwcsdeg( )
wcsndec( ), ndec( )
getradecsys( )
setwcslin( )
pix2wcst( )
pix2wcs( )
wcs2pix( )
wcsc2pix( )
wcszout( ), zout( )
setwcscom( )
freewcscom( )
SetPlate( )
GetPlate( )
tnxclose( )
tnxpset( )

Additional utility routines

These are available to retrieve the members of the WCSPtr struct.

xref( )
yref( )
xrefpix( )
yrefpix( )
xinc( )
yinc( )


Likely many! Very little of the module has been tested. If you find something that looks like a bug, please send a report.


Pete Ratzlaff <>

Contributors include:

Diab Jerius <>



syntax highlighting: