Astro-FITS-HdrTrans
view release on metacpan or search on metacpan
lib/Astro/FITS/HdrTrans/INGRID.pm view on Meta::CPAN
$dec = $self->dms_to_degrees( $sexa );
}
return $dec;
}
=item B<to_DEC_SCALE>
Sets the declination scale in arcseconds per pixel. The C<CCDYPIXE>
and C<INGPSCAL> headers are used when both are defined. Otherwise it
returns a default value of 0.2387 arcsec/pixel, assuming north is up.
=cut
sub to_DEC_SCALE {
my $self = shift;
my $FITS_headers = shift;
my $decscale = 0.2387;
# Assumes either x-y scales the same or the y corresponds to
# declination.
my $ccdypixe = $self->via_subheader( $FITS_headers, "CCDYPIXE" );
my $ingpscal = $self->via_subheader( $FITS_headers, "INGPSCAL" );
if ( defined $ccdypixe && defined $ingpscal ) {
$decscale = $ccdypixe * 1000.0 * $ingpscal;
}
return $decscale;
}
=item B<to_DEC_TELESCOPE_OFFSET>
Sets the declination telescope offset in arcseconds. It uses the
C<CAT-DEC> and C<DEC> keywords to derive the offset, and if either
does not exist, it returns a default of 0.0.
=cut
sub to_DEC_TELESCOPE_OFFSET {
my $self = shift;
my $FITS_headers = shift;
my $decoffset = 0.0;
if ( exists $FITS_headers->{"CAT-DEC"} && exists $FITS_headers->{DEC} ) {
# Obtain the reference and telescope declinations positions measured in degrees.
my $refdec = $self->dms_to_degrees( $FITS_headers->{"CAT-DEC"} );
my $dec = $self->dms_to_degrees( $FITS_headers->{DEC} );
# Find the offsets between the positions in arcseconds on the sky.
$decoffset = 3600.0 * ( $dec - $refdec );
}
# The sense is reversed compared with UKIRT, as these measure the
# place son the sky, not the motion of the telescope.
return -1.0 * $decoffset
}
=item B<to_DETECTOR_READ_TYPE>
Returns the UKIRT-like detector type "STARE" or "NDSTARE" from the
FITS C<REDMODE> and C<NUMREADS> keywords.
This is guesswork at present.
=cut
sub to_DETECTOR_READ_TYPE {
my $self = shift;
my $FITS_headers = shift;
my $read_type;
my $readout_mode = $FITS_headers->{READMODE};
my $nreads = $FITS_headers->{NUMREADS};
if ( $readout_mode =~ /^mndr/i ||
( $readout_mode =~ /^cds/i && $nreads == 1 ) ) {
$read_type = "STARE";
} elsif ( $readout_mode =~ /^cds/i ) {
$read_type = "NDSTARE";
}
return $read_type;
}
=item B<to_DR_RECIPE>
Returns the data-reduction recipe name. The selection depends on the
values of the C<OBJECT> and C<OBSTYPE> keywords. The default is
"QUICK_LOOK". A dark returns "REDUCE_DARK", and an object's recipe is
"JITTER_SELF_FLAT".
=cut
# No clue what the recipe is apart for a dark and assume a dither
# pattern means JITTER_SELF_FLAT.
sub to_DR_RECIPE {
my $self = shift;
my $FITS_headers = shift;
my $recipe = "QUICK_LOOK";
# Look for a dither pattern. These begin D-<n>/<m>: where
# <m> represents the number of jitter positions in the group
# and <n> is the number within the group.
my $object = $FITS_headers->{OBJECT};
if ( $object =~ /D-\d+\/\d+/ ) {
$recipe = "JITTER_SELF_FLAT";
} elsif ( $FITS_headers->{OBSTYPE} =~ /DARK/i ) {
$recipe = "REDUCE_DARK";
}
return $recipe;
}
=item B<to_EQUINOX>
Returns the equinox in decimal years. It's taken from the C<CAT-EQUI>
keyword, if it exists, defaulting to 2000.0 otherwise.
=cut
sub to_EQUINOX {
my $self = shift;
my $FITS_headers = shift;
my $equinox = 2000.0;
if ( exists $FITS_headers->{"CAT-EQUI"} ) {
$equinox = $FITS_headers->{"CAT-EQUI"};
( run in 1.556 second using v1.01-cache-2.11-cpan-39bf76dae61 )