|
Astro::FITS::Header::Item - A card image from a FITS header |
Astro::FITS::Header::Item - A card image from a FITS header
$item = new Astro::FITS::Header::Item( Card => $card );
$item = new Astro::FITS::Header::Item( Keyword => $keyword,
Value => $value,
Comment => $comment,
Type => 'int'
);
$value = $item->value(); $comment = $item->comment();
$card = $item->card();
$card = "$item";
Stores information about a FITS header item (in the FITS standard these are called Card Images). FITS Card Images can be parsed and broken into their component keyword, values and comments. Card Images can also be created from its components keyword, value and comment.
$item = new Astro::FITS::Header::Item( Card => $card );
$item = new Astro::FITS::Header::Item( Keyword => $keyword,
Value => $value );
The list of allowed hash keys is documented in the configure method.
Returns undef if the information supplied was insufficient
to generate a valid header item.
$keyword = $item->keyword(); $item->keyword( $key );
When a new value is supplied any card in the cache is invalidated.
Supplied value is always upper-cased.
$value = $item->value(); $item->value( $val );
When a new value is supplied any card in the cache is invalidated.
If the value is an Astro::FITS::Header object, the type is automatically
set to ``HEADER''.
$comment = $item->comment(); $item->comment( $comment );
When a new value is supplied any card in the cache is invalidated.
$type = $item->type(); $item->type( "INT" );
Allowed types are ``LOGICAL'', ``INT'', ``FLOAT'', ``STRING'', ``COMMENT'' and ``UNDEF''.
A special type, ``HEADER'', is used to specify that this item refers to a subsidiary header (eg a header in an MEFITS file or a header in an NDF in an HDS container).
$card = $item->card();
If a new card is supplied it will only be accepted if it is 80
characters long or fewer. The string is padded with spaces if it is too
short. No attempt (yet) )is made to shorten the string if it is too
long since that may require a check to see if the value is a string
that must be shortened with a closing single quote. Returns undef
on assignment failure (else returns the supplied string).
$status = $item->card( $card );
undef is returned if there is insufficient information in the object
to create a new card. Can assign undef to clear the cache.
This method is called automatically when attempting to stringify the object.
$card = "$item";
$item->configure( %options );
Takes a hash as argument with the following keywords:
parse_card method directly.
Takes priority over any other key.
type method
for more details.
Does nothing if these keys are not supplied.
($key, $val, $com) = $item->parse_card( $card );
Returns an empty list on error.
Copyright (C) 2001 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.
Tim Jenness <t.jenness@jach.hawaii.edu>, Alasdair Allan <aa@astro.ex.ac.uk>
|
Astro::FITS::Header::Item - A card image from a FITS header |