Astro-FITS-HdrTrans

 view release on metacpan or  search on metacpan

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

765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
=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

73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
=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

67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
=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

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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

108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
=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

124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
=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

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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.258 second using v1.01-cache-2.11-cpan-1dc43b0fbd2 )