NAME

Astro::FITS::HdrTrans - Translate FITS headers to standardised form


SYNOPSIS

  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);
  @headers = Astro::FITS::HdrTrans->generic_headers();
  @classes = Astro::FITS::HdrTrans->translation_classes();


DESCRIPTION

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.


CLASS METHODS

Some class methods are available

generic_headers

Returns a list of all the generic headers that can in principal be used for header translation. Note that not all the instruments support all the headers.

 @hdrs = Astro::FITS::HdrTrans->generic_headers();
translation_classes

Return the names of all the translation classes that will be tried when translating a FITS header.

 @classes = Astro::FITS::HdrTrans->translation_classes();

If arguments are supplied, the list of translation classes is set to the supplied values.

 Astro::FITS::HdrTrans->translation_classes( @new );
reset_translation_classes

Revert back to the reference list of translation classes.

  Astro::FITS::HdrTrans->reset_translation_classes;

Useful if the list has been modified for a specific translation.

push_class

Allows additional classes to be pushed on the list of valid translation classes.

  Astro::FITS::HdrTrans->push_class( $class );

The class[es] can be specified either as a list or a reference to an array.


FUNCTIONS

The following functions are available. They can be exported but are not exported by default.

translate_from_FITS

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:

This method returns a hash of generic headers. This function dies if the header translation fails in any way.

translate_to_FITS

Converts a hash containing generic headers into one containing instrument-specific FITS headers.

  %FITS_headers = translate_to_FITS(\%generic_headers,
                                    class => \@classes,
                                   );

This method takes a reference to a hash containing untranslated headers, and a hash reference containing the following optional keys:

This method returns a hash of instrument-specific headers. This function dies if the header translation fails in any way.