Diab Jerius

NAME

Astro::FITS::CFITSIO::PDL - support routines for using CFITSIO and PDL

SYNOPSIS

  use Astro::FITS::CFITSIO::PDL;

DESCRIPTION

This module provides utility routines to make CFITSIO and PDL more friendly to each other.

Functions

pdl2cfitsio
        $cfitsio_type = pdl2fits_type($piddle);
        $cfitsio_type = pdl2fits_type(long); # or short, or float, etc.

PDL datatypes are always guaranteed to be the same size on all architectures, whereas CFITSIO datatypes (TLONG, for example), will vary on some architectures since they correspond to the C datatypes on that system. This poses a problem for Perl scripts which wish to read FITS data into piddles, and do so in a manner portable to 64-bit architectures, for example. This routine takes a PDL object or PDL::Types token (returned by float() and friends when given no arguments), and returns the same-sized CFITSIO datatype, suitable for passing to routines such as fits_read_col().

It croak()'s upon error.

fits2pdl_coltype
        $pdl_type = fits2pdl_type( TLONG );
        $pdl_type = fits2pdl_type( 'D' );

Given a supported FITS or CFITSIO column datatype, return the PDL type which is the closest functional match (i.e. TDOUBLE => double). It croak()'s if the passed type is not supported.

fits2pdl_imgtype
        $pdl_type = fits2pdl_type( FLOAT_IMG );

Given a supported CFITSIO table datatype, return the PDL type which is the closest functional match (i.e. DOUBLE_IMG => double). It croak()'s if the passed type is not supported.

EXPORT

None by default.

SEE ALSO

Astro::FITS::CFITSIO, PDL

AUTHOR

Pete Ratzlaff

Diab Jerius

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Smithsonian Astrophysical Observatory

This software is released under the GNU General Public License. You may find a copy at http://www.fsf.org/copyleft/gpl.html.