Astro::FITS::HdrTrans - Translate FITS headers into generic headers and back again
use Astro::FITS::HdrTrans qw/ translate_from_FITS translate_to_FITS /; %generic_headers = translate_from_FITS(\%FITS_headers); %FITS_headers = translate_to_FITS(\%generic_headers);
Converts information contained in instrument-specific FITS headers to and from generic headers. A list of generic headers are given at the end of the module documentation.
$Id: HdrTrans.pm,v 1.18 2003/09/16 02:23:36 bradc Exp $
The following variables are not exported by default, but can be exported.
Provides a list of generic headers that may or may not be available in the generic header hash, depending on if translations were set up for these headers in the instrument-specific subclasses.
Currently only the time-related headers (UTSTART, UTEND, and UTDATE) have type-checking done; these three generic headers must be returned as Time::Piece objects when translating from FITS headers into generic headers, and must be given as Time::Piece objects when translating from generic headers back into FITS headers. A warning is raised if any of these headers are not Time::Piece objects.
Time::Piece
The following variables are private to this module.
This parameter is a list of valid classes for which translations can be made. A class in this list does not include the Astro::FITS::HdrTrans prefix. For example, if the Astro::FITS::HdrTrans::IRCAM class were to be used for translations, this list would include only IRCAM.
Astro::FITS::HdrTrans
Astro::FITS::HdrTrans::IRCAM
IRCAM
Values in this list are case-sensitive.
Values in this list can be added to using the push_class method.
push_class
The following methods are not exported by default, but can be exported.
Converts a hash containing instrument-specific FITS headers into a hash containing generic headers.
%generic_headers = translate_from_FITS(\%FITS_headers, class => \@classes, prefix => 'ORAC_', );
This method takes a reference to a hash containing untranslated headers, and a hash reference containing the following optional keys:
class - A reference to a list of subclasses to try to use for header translations. This list overrides the default list. If left blank, the default list will be used.
prefix - A string prefix to add to the front of every translated header name. For example, if this prefix is set to 'ORAC_', then the translated header for the instrument value, whose key is normally 'INSTRUMENT', will have a key named 'ORAC_INSTRUMENT'. The original keys will not be in the returned hash. If left blank, no prefix will be added.
This method returns a hash of generic headers.
Converts a hash containing generic headers into one containing instrument-specific FITS headers.
%FITS_headers = translate_to_FITS(\%generic_headers, class => \@classes, );
prefix - A string prefix to remove from the generic header key before doing header translation. Why you would want to do this is if you've used a prefix in the translate_from_FITS call, and want to translate back from the generic headers returned from that method. If left blank, no prefix will be removed.
translate_from_FITS
This method returns a hash of instrument-specific headers.
Allows another class to be pushed onto the list of valid classes.
push_class( \@classes ); push_class( $class );
If an array reference is passed, all classes contained in that array will be added to the list. If a scalar is passed, that single class will be added to the list.
The following is a list of currently-supported generic headers. If no type is defined for the header, then it is assumed to be a scalar in any format.
A number of the generic headers are more easily represented by objects. For example, all headers to do with the object coordinates (DEC_BASE, COORDINATE_UNITS, COORDINATE_TYPE, EPOCH, EQUINOX, and RA_BASE) are be better represented with a single Astro::Coords object. Such headers will at some point be merged into a single object header, but for backwards compatibility will be retained.
Astro::Coords
Brad Cavanagh <b.cavanagh@jach.hawaii.edu>
Copyright (C) 2003 Particle Physics and Astronomy Research Council. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
8 POD Errors
The following errors were encountered while parsing the POD:
Expected text after =item, not a bullet
You forgot a '=back' before '=head1'
'=item' outside of any '=over'
To install Astro::FITS::HdrTrans, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Astro::FITS::HdrTrans
CPAN shell
perl -MCPAN -e shell install Astro::FITS::HdrTrans
For more information on module installation, please visit the detailed CPAN module installation guide.