| Astro-FITS-HdrTrans documentation | Contained in the Astro-FITS-HdrTrans distribution. |
Astro::FITS::HdrTrans::SCUBA2 - JCMT SCUBA-2 translations
Converts information contained in SCUBA-2 FITS headers to and from generic headers. See Astro::FITS::HdrTrans for a list of generic headers.
The name of the instrument required to match (case insensitively)
against the INSTRUME/INSTRUMENT keyword to allow this class to
translate the specified headers. Called by the default
can_translate method.
$inst = $class->this_instrument();
Returns "SCUBA-2".
These methods are more complicated than a simple mapping. We have to provide both from- and to-FITS conversions All these routines are methods and the to_ routines all take a reference to a hash and return the translated value (a many-to-one mapping) The from_ methods take a reference to a generic hash and return a translated hash (sometimes these are many-to-many)
If Observation type is SCIENCE, return the sample mode, else return the sample mode and observation type. For example, "STARE", "SCAN", "SCAN_POINTING".
Do not currently take into account polarimeter or FTS.
$Id$
Astro::FITS::HdrTrans, Astro::FITS::HdrTrans::Base
Tim Jenness <t.jenness@jach.hawaii.edu>
Copyright (C) 2003-2005 Particle Physics and Astronomy Research Council. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either Version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
| Astro-FITS-HdrTrans documentation | Contained in the Astro-FITS-HdrTrans distribution. |
package Astro::FITS::HdrTrans::SCUBA2;
use 5.006; use warnings; use strict; use Carp; use base qw/ Astro::FITS::HdrTrans::JCMT /; use vars qw/ $VERSION /; $VERSION = "1.50"; # For a constant mapping, there is no FITS header, just a generic # header that is constant. my %CONST_MAP = ( BACKEND => 'SCUBA-2', DATA_UNITS => 'pW', ); # NULL mappings used to override base class implementations my @NULL_MAP = (); # Unit mapping implies that the value propogates directly # to the output with only a keyword name change. my %UNIT_MAP = ( FILTER => "FILTER", INSTRUMENT => "INSTRUME", DR_GROUP => "DRGROUP", DR_RECIPE => "RECIPE", OBSERVATION_TYPE => "OBS_TYPE", POLARIMETER => 'POL_CONN', UTDATE => "UTDATE", TELESCOPE => "TELESCOP", ); # Values that are derived from the last subheader entry my %ENDOBS_MAP = ( AIRMASS_END => 'AMEND', AZIMUTH_END => 'AZEND', ELEVATION_END => 'ELEND', ); # Create the translation methods __PACKAGE__->_generate_lookup_methods( \%CONST_MAP, \%UNIT_MAP, \@NULL_MAP, \%ENDOBS_MAP );
sub this_instrument { return "SCUBA-2"; }
sub to_OBSERVATION_MODE { my $self = shift; my $FITS_headers = shift; my $return; if ( exists( $FITS_headers->{'SAM_MODE'} ) && exists( $FITS_headers->{'OBS_TYPE'} ) ) { my $sam_mode = $FITS_headers->{'SAM_MODE'}; $sam_mode =~ s/\s//g; my $obs_type = $FITS_headers->{'OBS_TYPE'}; $obs_type =~ s/\s//g; $return = $sam_mode; if ($obs_type !~ /science/i) { $return .= "_$obs_type"; } } return $return; }
1;