Astro::FITS::HdrTrans::SCUBA2 - JCMT SCUBA-2 translations


Astro-FITS-HdrTrans documentation Contained in the Astro-FITS-HdrTrans distribution.

Index


Code Index:

NAME

Top

Astro::FITS::HdrTrans::SCUBA2 - JCMT SCUBA-2 translations

DESCRIPTION

Top

Converts information contained in SCUBA-2 FITS headers to and from generic headers. See Astro::FITS::HdrTrans for a list of generic headers.

METHODS

Top

this_instrument

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".

COMPLEX CONVERSIONS

Top

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)

to_OBSERVATION_MODE

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.

REVISION

Top

 $Id$

SEE ALSO

Top

Astro::FITS::HdrTrans, Astro::FITS::HdrTrans::Base

AUTHOR

Top

Tim Jenness <t.jenness@jach.hawaii.edu>

COPYRIGHT

Top


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;