Astro-FITS-HdrTrans
view release on metacpan or search on metacpan
lib/Astro/FITS/HdrTrans/ACSIS.pm view on Meta::CPAN
765766767768769770771772773774775776777778779780781782783784=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
737475767778798081828384858687888990919293=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
676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128=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
434445464748495051525354555657585960616263Older 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
6970717273747576777879808182838485868788Older 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
108109110111112113114115116117118119120121122123124125126127128=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
124125126127128129130131132133134135136137138139140141142143=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
84858687888990919293949596979899100101102103104sub
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.258 second using v1.01-cache-2.11-cpan-1dc43b0fbd2 )