Astro-FITS-HdrTrans

 view release on metacpan or  search on metacpan

lib/Astro/FITS/HdrTrans/ACSIS.pm  view on Meta::CPAN


=item B<to_SUBSYSTEM_IDKEY>

=cut

sub to_SUBSYSTEM_IDKEY {
  my $self = shift;
  my $FITS_headers = shift;

  # Try the general headers first
  my $general = $self->SUPER::to_SUBSYSTEM_IDKEY( $FITS_headers );
  return ( defined $general ? $general : "SUBSYSNR" );
}


=item B<_is_FSW>

Helper function to determine if we are doing frequency switch.

=cut

lib/Astro/FITS/HdrTrans/JAC.pm  view on Meta::CPAN

=cut

sub translate_from_FITS {
  my $class = shift;
  my $headers = shift;

  # sort out DATE-OBS and DATE-END
  $class->_fix_dates( $headers );

  # Go to the base class
  return $class->SUPER::translate_from_FITS( $headers, @_ );
}

=back

=head1 COMPLEX CONVERSIONS

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

lib/Astro/FITS/HdrTrans/JCMT.pm  view on Meta::CPAN

=cut

sub translate_from_FITS {
  my $class = shift;
  my $headers = shift;

  # clear cache
  $COORDS = undef;

  # Go to the base class
  return $class->SUPER::translate_from_FITS( $headers, @_ );
}

=item B<to_UTDATE>

Converts the date in a date-obs header into a number of form YYYYMMDD.

=cut

sub to_UTDATE {
  my $class = shift;
  my $FITS_headers = shift;

  $class->_fix_dates( $FITS_headers );
  return $class->SUPER::to_UTDATE( $FITS_headers, @_ );
}

=item B<to_UTEND>

Converts UT date in a date-end header into C<Time::Piece> object

=cut

sub to_UTEND {
  my $class = shift;
  my $FITS_headers = shift;

  $class->_fix_dates( $FITS_headers );
  return $class->SUPER::to_UTEND( $FITS_headers, @_ );
}

=item B<to_UTSTART>

Converts UT date in a date-obs header into C<Time::Piece> object.

=cut

sub to_UTSTART {
  my $class = shift;
  my $FITS_headers = shift;

  $class->_fix_dates( $FITS_headers );
  return $class->SUPER::to_UTSTART( $FITS_headers, @_ );
}

=item B<to_RA_BASE>

Uses the elevation, azimuth, telescope name, and observation start
time headers (ELSTART, AZSTART, TELESCOP, and DATE-OBS headers,
respectively) to calculate the base RA.

Returns the RA in degrees.

lib/Astro/FITS/HdrTrans/RxH3.pm  view on Meta::CPAN


Older RxH3 data files lack an INSTRUME header, so look for other
headers also.

=cut

sub can_translate {
    my $self = shift;
    my $headers = shift;

    return 1 if $self->SUPER::can_translate($headers);

    my $freqfile = undef;

    if (exists $headers->{'FREQFILE'}) {
        $freqfile = $headers->{'FREQFILE'};
    }
    elsif (exists $headers->{'SUBHEADERS'} &&
            exists $headers->{'SUBHEADERS'}->[0]->{'FREQFILE'}) {
        $freqfile = $headers->{'SUBHEADERS'}->[0]->{'FREQFILE'};
    }

lib/Astro/FITS/HdrTrans/RxH3.pm  view on Meta::CPAN


Older RxH3 data only has a "DATE" header (the date the FITS file was created),
so fall back to this if we don't get a value from the standard header ("DATE-OBS").

=cut

sub to_UTSTART {
    my $self = shift;
    my $headers = shift;

    my $utstart = $self->SUPER::to_UTSTART($headers);

    unless (defined $utstart) {
        if ((exists $headers->{'DATE'}) and (defined $headers->{'DATE'})) {
            $utstart = $self->_parse_iso_date($headers->{'DATE'});
        }
    }

    return $utstart;
}

lib/Astro/FITS/HdrTrans/SCUBA.pm  view on Meta::CPAN

=cut

sub can_translate {
  my $self = shift;
  my $headers = shift;

  if (exists $headers->{BOLOMS} && defined $headers->{BOLOMS} &&
      exists $headers->{"SCU#"} && defined $headers->{"SCU#"}) {
    return 1;
  } else {
    return $self->SUPER::can_translate( $headers );
  }
}

=back

=head1 COMPLEX CONVERSIONS

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

lib/Astro/FITS/HdrTrans/SCUBA2.pm  view on Meta::CPAN


=item B<to_SUBSYSTEM_IDKEY>

=cut

sub to_SUBSYSTEM_IDKEY {
  my $self = shift;
  my $FITS_headers = shift;

  # Try the general headers first
  my $general = $self->SUPER::to_SUBSYSTEM_IDKEY( $FITS_headers );
  return ( defined $general ? $general : "FILTER" );
}

=item B<to_DR_RECIPE>

Fix up recipes that were incorrect in the early years of the
observing tool.

Converts SASSy survey data to use the SASSy recipe.

lib/Astro/FITS/HdrTrans/UKIRT.pm  view on Meta::CPAN

sub can_translate {
  my $self = shift;
  my $FITS_headers = shift;

  if ( exists $FITS_headers->{TELESCOP} &&
       $FITS_headers->{TELESCOP} =~ /UKIRT/ &&
       exists $FITS_headers->{FILENAME} &&
       exists $FITS_headers->{RAJ2000}) {
    return 0;
  }
  return $self->SUPER::can_translate( $FITS_headers );
}

=back

=head1 COMPLEX CONVERSIONS

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



( run in 0.726 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )