HdrTrans/JCMT.pm

filter: Statementstmt 92.1% 165 / 179 Branchbran 66.1% 41 / 62 Conditioncond 54.7% 23 / 42 MC/DCmcdc 34.7% 8 / 23 Subroutinesub 100% 23 / 23 Podpod 100% 14 / 14 totaltotal 79.8% 274 / 343 CC 53 SCAR 19.6
CC
53
Cov
81%
_calc_coords
13.8
to_DOME_OPEN
12.6
to_TAU
8.6
CRAP 7.1
« HdrTrans/MICHELLE.pm ↑ Summary HdrTrans/IRCAM.pm »
1 =head1 NAME
2  
3 Astro::FITS::HdrTrans::JCMT - class combining common behaviour for modern JCMT instruments
4  
5 =cut
6  
7 package Astro::FITS::HdrTrans::JCMT;
8  
9 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 13 ▶use Astro::Coords;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 13 ▶use Astro::Telescope;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 13 ▶use DateTime;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 13 ▶use DateTime::TimeZone;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 13 our $VERSION = '1.66';
18  
19 13 ▶use base qw/ Astro::FITS::HdrTrans::JAC /;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 # Unit mapping implies that the value propogates directly
22 # to the output with only a keyword name change.
23 13 my %UNIT_MAP =
24 (
25 AIRMASS_START => 'AMSTART',
26 AZIMUTH_START => 'AZSTART',
27 ELEVATION_START => 'ELSTART',
28 FILENAME => 'FILE_ID',
29 DR_RECIPE => "RECIPE",
30 HUMIDITY => 'HUMSTART',
31 LATITUDE => 'LAT-OBS',
32 LONGITUDE => 'LONG-OBS',
33 OBJECT => 'OBJECT',
34 OBSERVATION_NUMBER => 'OBSNUM',
35 PROJECT => 'PROJECT',
36 SCAN_PATTERN => 'SCAN_PAT',
37 STANDARD => 'STANDARD',
38 TAI_UTC_CORRECTION => 'DTAI',
39 UT1_UTC_CORRECTION => 'DUT1',
40 WIND_BLIND => 'WND_BLND',
41 X_APERTURE => 'INSTAP_X',
42 Y_APERTURE => 'INSTAP_Y',
43 );
44  
45 13 my %CONST_MAP = ();
46  
47 # Create the translation methods
48 13 __PACKAGE__->_generate_lookup_methods( \%CONST_MAP, \%UNIT_MAP );
49  
50 13 our $COORDS;
51  
52 =head1 METHODS
53  
54 =over 4
55  
56 =item B<translate_from_FITS>
57  
58 This routine overrides the base class implementation to enable the
59 caches to be cleared for target location.
60  
61 This means that some conversion methods (in particular those using time in
62 a base class) may not work properly outside the context of a full translation
63 unless they have been subclassed locally.
64  
65 Date fixups are handled in a super class.
66  
67 =cut
68  
69 4 ▶sub translate_from_FITS {
Subroutine translate_from_FITS: called CC=1 SCAR=0.0
Pod documented
70 4 my $class = shift;
71 4 my $headers = shift;
72  
73 # clear cache
74 4 $COORDS = undef;
75  
76 # Go to the base class
77 4 return $class->SUPER::translate_from_FITS( $headers, @_ );
78 }
79  
80 =item B<to_UTDATE>
81  
82 Converts the date in a date-obs header into a number of form YYYYMMDD.
83  
84 =cut
85  
86 4 ▶sub to_UTDATE {
Subroutine to_UTDATE: called CC=1 SCAR=0.0
Pod documented
87 4 my $class = shift;
88 4 my $FITS_headers = shift;
89  
90 4 $class->_fix_dates( $FITS_headers );
91 4 return $class->SUPER::to_UTDATE( $FITS_headers, @_ );
92 }
93  
94 =item B<to_UTEND>
95  
96 Converts UT date in a date-end header into C<Time::Piece> object
97  
98 =cut
99  
100 5 ▶sub to_UTEND {
Subroutine to_UTEND: called CC=1 SCAR=0.0
Pod documented
101 5 my $class = shift;
102 5 my $FITS_headers = shift;
103  
104 5 $class->_fix_dates( $FITS_headers );
105 5 return $class->SUPER::to_UTEND( $FITS_headers, @_ );
106 }
107  
108 =item B<to_UTSTART>
109  
110 Converts UT date in a date-obs header into C<Time::Piece> object.
111  
112 =cut
113  
114 9 ▶sub to_UTSTART {
Subroutine to_UTSTART: called CC=1 SCAR=0.0
Pod documented
115 9 my $class = shift;
116 9 my $FITS_headers = shift;
117  
118 9 $class->_fix_dates( $FITS_headers );
119 9 return $class->SUPER::to_UTSTART( $FITS_headers, @_ );
120 }
121  
122 =item B<to_RA_BASE>
123  
124 Uses the elevation, azimuth, telescope name, and observation start
125 time headers (ELSTART, AZSTART, TELESCOP, and DATE-OBS headers,
126 respectively) to calculate the base RA.
127  
128 Returns the RA in degrees.
129  
130 =cut
131  
132 4 ▶sub to_RA_BASE {
Subroutine to_RA_BASE: called CC=2 SCAR=7.0
Pod documented
133 4 my $self = shift;
134 4 my $FITS_headers = shift;
135  
136 4 my $coords = $self->_calc_coords( $FITS_headers );
137 4 ▶ return undef unless defined $coords;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $coords 0 4 4
138 4 return $coords->ra( format => 'deg' );
139 }
140  
141 =item B<to_DEC_BASE>
142  
143 Uses the elevation, azimuth, telescope name, and observation start
144 time headers (ELSTART, AZSTART, TELESCOP, and DATE-OBS headers,
145 respectively) to calculate the base declination.
146  
147 Returns the declination in degrees.
148  
149 =cut
150  
151 4 ▶sub to_DEC_BASE {
Subroutine to_DEC_BASE: called CC=2 SCAR=7.0
Pod documented
152 4 my $self = shift;
153 4 my $FITS_headers = shift;
154  
155 4 my $coords = $self->_calc_coords( $FITS_headers );
156  
157 4 ▶ return undef unless defined $coords;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $coords 0 4 4
158 4 return $coords->dec( format => 'deg' );
159 }
160  
161 =item B<to_TAU>
162  
163 Use the average WVM tau measurements.
164  
165 =cut
166  
167 4 ▶sub to_TAU {
Subroutine to_TAU: called CC=8 SCAR=21.5
Pod documented
168 4 my $self = shift;
169 4 my $FITS_headers = shift;
170  
171 4 my $tau = undef;
172 4 for my $src (qw/ TAU225 WVMTAU /) {
173 6 my $st = $src . "ST";
174 6 my $en = $src . "EN";
175  
176 6 my @startvals = $self->via_subheader_undef_check( $FITS_headers, $st );
177 6 my @endvals = $self->via_subheader_undef_check( $FITS_headers, $en );
178 6 my $startval = $startvals[0];
179 6 my $endval = $endvals[-1];
180  
181 6 ▶ my $have_start = ((defined $startval) and ($startval != 0.0));
Condition66%2/3
defined $startval && $startval != 0.0
!ll&&!rl&&r
204
MC/DC50%1/2
defined $startval && $startval != 0.0
defined $startval $startval != 0.0
Truth table66%2/3
A && B
A= defined $startvalB= $startval != 0.0
ABresult
0X0
100
111
182 6 ▶ my $have_end = ((defined $endval) and ($endval != 0.0));
Condition66%2/3
defined $endval && $endval != 0.0
!ll&&!rl&&r
204
MC/DC50%1/2
defined $endval && $endval != 0.0
defined $endval $endval != 0.0
Truth table66%2/3
A && B
A= defined $endvalB= $endval != 0.0
ABresult
0X0
100
111
183 6 ▶ if ($have_start and $have_end) {
Branch: 3 branches
BranchTrueFalseTotal
if ($have_start and $have_end) { } 4 2 6
elsif ($have_start) { } 0 2 2
elsif ($have_end) { } 0 2 2
Condition66%2/3
$have_start and $have_end
!ll&&!rl&&r
204
MC/DC50%1/2
$have_start and $have_end
$have_start $have_end
Truth table66%2/3
A and B
A= $have_startB= $have_end
ABresult
0X0
100
111
184 4 $tau = ($startval + $endval) / 2;
185 4 last;
186 } elsif ($have_start) {
187 0 $tau = $startval;
188 } elsif ($have_end) {
189 0 $tau = $endval;
190 }
191 }
192 4 return $tau;
193 }
194  
195 =item B<to_SEEING>
196  
197 Use the average seeing measurements.
198  
199 =cut
200  
201 4 ▶sub to_SEEING {
Subroutine to_SEEING: called CC=5 SCAR=16.7
Pod documented
202 4 my $self = shift;
203 4 my $FITS_headers = shift;
204  
205 4 my $seeing = 0.0;
206  
207  
208 4 my @startvals = $self->via_subheader_undef_check( $FITS_headers, "SEEINGST" );
209 4 my @endvals = $self->via_subheader_undef_check( $FITS_headers, "SEEINGEN" );
210 4 my $startval = $startvals[0];
211 4 my $endval = $endvals[-1];
212  
213 4 ▶ if (defined $startval && defined $endval) {
Branch: 3 branches
BranchTrueFalseTotal
if (defined $startval and defined $endval) { } 3 1 4
elsif (defined $startval) { } 0 1 1
elsif (defined $endval) { } 0 1 1
Condition66%2/3
defined $startval and defined $endval
!ll&&!rl&&r
103
MC/DC50%1/2
defined $startval and defined $endval
defined $startval defined $endval
Truth table66%2/3
A and B
A= defined $startvalB= defined $endval
ABresult
0X0
100
111
214 3 $seeing = ($startval + $endval) / 2;
215 } elsif (defined $startval) {
216 0 $seeing = $startval;
217 } elsif (defined $endval) {
218 0 $seeing = $endval;
219 }
220  
221 4 return $seeing;
222 }
223  
224  
225  
226  
227 =item B<to_OBSERVATION_ID_SUBSYSTEM>
228  
229 Returns the subsystem observation IDs associated with the header.
230 Returns a reference to an array. Will be empty if the OBSIDSS header
231 is missing.
232  
233 =cut
234  
235 4 ▶sub to_OBSERVATION_ID_SUBSYSTEM {
Subroutine to_OBSERVATION_ID_SUBSYSTEM: called CC=4 SCAR=13.9
Pod documented
236 4 my $self = shift;
237 4 my $FITS_headers = shift;
238 # Try multiple headers since the database is different to the file
239 4 my @obsidss;
240 4 for my $h (qw/ OBSIDSS OBSID_SUBSYSNR /) {
241 5 my @found = $self->via_subheader( $FITS_headers, $h );
242 5 ▶ if (@found) {
Branch: 1 branch
BranchTrueFalseTotal
if (@found) 3 2 5
243 3 @obsidss = @found;
244 3 last;
245 }
246 }
247 4 my @all;
248 4 ▶ if (@obsidss) {
Branch: 1 branch
BranchTrueFalseTotal
if (@obsidss) 3 1 4
249 # Remove duplicates
250 3 my %seen;
251 3 @all = grep { ! $seen{$_}++ } @obsidss;
252 }
253 4 return \@all;
254 }
255  
256 =item B<to_SUBSYSTEM_IDKEY>
257  
258 =cut
259  
260 4 ▶sub to_SUBSYSTEM_IDKEY {
Subroutine to_SUBSYSTEM_IDKEY: called CC=3 SCAR=11.0
Pod documented
261 4 my $self = shift;
262 4 my $FITS_headers = shift;
263  
264 4 for my $try ( qw/ OBSIDSS OBSID_SUBSYSNR / ) {
265 5 my @results = $self->via_subheader( $FITS_headers, $try );
266 5 ▶ return $try if @results;
Branch: 1 branch
BranchTrueFalseTotal
if @results 3 2 5
267 }
268 1 return;
269 }
270  
271 =item B<to_DOME_OPEN>
272  
273 Uses the roof and door status at start and end of observation headers
274 to generate a combined value which, if true, confirms that the dome
275 was fully open throughout. (Unless it closed and reopened during
276 the observation.)
277  
278 =cut
279  
280 4 ▶sub to_DOME_OPEN {
Subroutine to_DOME_OPEN: called CC=11 SCAR=25.3
Pod documented
281 4 my $self = shift;
282 4 my $FITS_headers = shift;
283  
284 4 my ($n_open, $n_closed, $n_other) = (0, 0, 0);
285  
286 4 foreach my $header (qw/DOORSTST DOORSTEN ROOFSTST ROOFSTEN/) {
287 16 foreach my $value ($self->via_subheader($FITS_headers, $header)) {
288 12 ▶ if ($value =~ /^open$/i) {
Branch: 2 branches
BranchTrueFalseTotal
if ($value =~ /^open$/i) { } 4 8 12
elsif ($value =~ /^closed$/i) { } 8 0 8
289 4 $n_open ++;
290 }
291 elsif ($value =~ /^closed$/i) {
292 8 $n_closed ++;
293 }
294 else {
295 0 $n_other ++;
296 }
297 }
298 }
299  
300 4 ▶ if ($n_open and not ($n_closed or $n_other)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($n_open and not $n_closed || $n_other) 1 3 4
Condition50%3/6
$n_open and not $n_closed || $n_other
!ll&&!rl&&r
301
$n_closed || $n_other
l!l&&r!l&&!r
001
MC/DC33%1/3
$n_open and not $n_closed || $n_other
$n_open $n_closed $n_other
Truth table50%2/4
A and not(B || C)
A= $n_openB= $n_closedC= $n_other
ABCresult
0XX0
11X0
1010
1001
301 1 return 1;
302 }
303  
304 3 ▶ if ($n_closed and not ($n_open or $n_other)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($n_closed and not $n_open || $n_other) 2 1 3
Condition50%3/6
$n_closed and not $n_open || $n_other
!ll&&!rl&&r
102
$n_open || $n_other
l!l&&r!l&&!r
002
MC/DC33%1/3
$n_closed and not $n_open || $n_other
$n_closed $n_open $n_other
Truth table50%2/4
A and not(B || C)
A= $n_closedB= $n_openC= $n_other
ABCresult
0XX0
11X0
1010
1001
305 2 return 0;
306 }
307  
308 1 return undef;
309 }
310  
311 =item B<from_DOME_OPEN>
312  
313 Converts the DOME_OPEN value back to individual roof and door
314 status headers.
315  
316 =cut
317  
318 2 ▶sub from_DOME_OPEN {
Subroutine from_DOME_OPEN: called CC=4 SCAR=14.0
Pod documented
319 2 my $self = shift;
320 2 my $generic_headers = shift;
321  
322 2 my $value = undef;
323  
324 2 ▶ if (exists $generic_headers->{'DOME_OPEN'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $generic_headers->{"DOME_OPEN"}) 1 1 2
325 1 my $dome = $generic_headers->{'DOME_OPEN'};
326 1 ▶ if (defined $dome) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $dome) 1 0 1
327 1 ▶ $value = $dome ? 'Open' : 'Closed';
Branch: 1 branch
BranchTrueFalseTotal
$dome ? : 0 1 1
328 }
329 }
330  
331 2 return map {$_ => $value} qw/DOORSTST DOORSTEN ROOFSTST ROOFSTEN/;
332 }
333  
334 =item B<to_REMOTE>
335  
336 Convert between the JCMT's OPER_LOC header and a standardised 'REMOTE value'.
337  
338 REMOTE = 1
339 LOCAL = 0
340  
341 If not defined or has a different value, return 'undef'
342 =cut
343  
344 4 ▶sub to_REMOTE {
Subroutine to_REMOTE: called CC=4 SCAR=15.5
Pod documented
345 4 my $self = shift;
346 4 my $FITS_headers = shift;
347 4 my $remote;
348 4 ▶ if (exists( $FITS_headers->{'REMOTE'})) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $FITS_headers->{'REMOTE'}) { } 0 4 4
349 0 $remote = $FITS_headers->{'REMOTE'};
350 } else {
351 4 $remote = ''
352 }
353 4 ▶ if (uc($remote) =~ /REMOTE/) {
Branch: 2 branches
BranchTrueFalseTotal
if (uc($remote) =~ /REMOTE/) { } 0 4 4
elsif (uc($remote) =~ /LOCAL/) { } 0 4 4
354 0 $remote = 1;
355 } elsif (uc($remote) =~ /LOCAL/) {
356 0 $remote = 0;
357 } else {
358 4 $remote = undef;
359 }
360  
361 4 return $remote;
362 }
363  
364  
365 =item B<from_REMOTE>
366  
367 Converts the REMOTE value back to the OPER_LOC header
368 if REMOTE=1, oper_loc='REMOTE'
369 if REMOTE=0, oper_loc='LOCAL'
370 if REMOTE is anything else, return undef;
371  
372 =cut
373  
374 2 ▶sub from_REMOTE {
Subroutine from_REMOTE: called CC=4 SCAR=19.4
Pod documented
375 2 my $self = shift;
376 2 my $generic_headers = shift;
377  
378 2 my $value = undef;
379  
380 2 ▶ if (exists $generic_headers->{'REMOTE'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $generic_headers->{"REMOTE"}) 0 2 2
381 0 my $remote = $generic_headers->{'REMOTE'};
382 0 ▶ if (defined $remote) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $remote) 0 0 0
383 0 ▶ $value = $remote ? 'REMOTE' : 'LOCAL';
Branch: 1 branch
BranchTrueFalseTotal
$remote ? : 0 0 0
384 }
385 }
386  
387 2 return (OPER_LOC => $value);
388 }
389  
390  
391  
392 =back
393  
394 =head1 PRIVATE METHODS
395  
396 =over 4
397  
398 =item B<_calc_coords>
399  
400 Function to calculate the coordinates at the start of the observation by using
401 the elevation, azimuth, telescope, and observation start time. Caches
402 the result if it's already been calculated.
403  
404 Returns an Astro::Coords object.
405  
406 =cut
407  
408 8 ▶sub _calc_coords {
Subroutine _calc_coords: called CC=12 SCAR=26.2
409 8 my $self = shift;
410 8 my $FITS_headers = shift;
411  
412 # Force dates to be standardized
413 8 $self->_fix_dates( $FITS_headers );
414  
415 # Here be dragons. Possibility that cache will not be cleared properly
416 # if a user comes in outside of the translate_from_FITS() method.
417 8 ▶ if ( defined( $COORDS ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (defined $Astro::FITS::HdrTrans::JCMT::COORDS and UNIVERSAL::isa($Astro::FITS::HdrTrans::JCMT::COORDS, "Astro::Coords")) 4 4 8
Condition66%2/3
defined $Astro::FITS::HdrTrans::JCMT::COORDS and UNIVERSAL::isa($Astro::FITS::HdrTrans::JCMT::COORDS, "Astro::Coords")
!ll&&!rl&&r
404
MC/DC50%1/2
defined $Astro::FITS::HdrTrans::JCMT::COORDS and UNIVERSAL::isa($Astro::FITS::HdrTrans::JCMT::COORDS, "Astro::Coords")
defined $Astro::FITS::HdrTrans::JCMT::COORDS UNIVERSAL::isa($Astro::FITS::HdrTrans::JCMT::COORDS, "Astro::Coords")
Truth table66%2/3
A and B
A= defined $Astro::FITS::HdrTrans::JCMT::COORDSB= UNIVERSAL::isa($Astro::FITS::HdrTrans::JCMT::COORDS, "Astro::Coords")
ABresult
0X0
100
111
418 UNIVERSAL::isa( $COORDS, "Astro::Coords" ) ) {
419 4 return $COORDS;
420 }
421  
422 4 my $telescope = $FITS_headers->{'TELESCOP'};
423  
424 # We can try DATE-OBS and AZEL START or DATE-END and AZEL END
425 4 my ($dateobs, $az, $el);
426  
427 4 my @keys = ( { date => "DATE-OBS", az => "AZSTART", el => "ELSTART" },
428 { date => "DATE-END", az => "AZEND", el => "ELEND" } );
429  
430 4 for my $keys_to_try ( @keys ) {
431  
432 # We might have subheaders, especially for the AZEL
433 # values so we read into arrays and check them.
434  
435 5 my @dateobs = $self->via_subheader( $FITS_headers, $keys_to_try->{date} );
436 5 my @azref = $self->via_subheader( $FITS_headers, $keys_to_try->{az} );
437 5 my @elref = $self->via_subheader( $FITS_headers, $keys_to_try->{el} );
438  
439 # try to ensure that we use the same index everywhere
440 5 my $idx;
441 5 ($idx, $dateobs) = _middle_value(\@dateobs, $idx);
442 5 ($idx, $az) = _middle_value(\@azref, $idx);
443 5 ($idx, $el) = _middle_value(\@elref, $idx);
444  
445 # if we have a set of values we can stop looking
446 5 ▶ last if (defined $dateobs && defined $az && defined $el);
Branch: 1 branch
BranchTrueFalseTotal
if defined $dateobs and defined $az and defined $el 4 1 5
Condition66%4/6
defined $dateobs and defined $az and defined $el
!ll&&!rl&&r
104
defined $dateobs and defined $az
!ll&&!rl&&r
014
MC/DC33%1/3
defined $dateobs and defined $az and defined $el
defined $dateobs defined $az defined $el
Truth table50%2/4
A and B and C
A= defined $dateobsB= defined $azC= defined $el
ABCresult
0XX0
10X0
1100
1111
447 }
448  
449 # only proceed if we have a defined value
450 4 ▶ if (defined $dateobs && defined $telescope
Branch: 1 branch
BranchTrueFalseTotal
if (defined $dateobs and defined $telescope and defined $az and defined $el) 4 0 4
Condition33%3/9
defined $dateobs and defined $telescope and defined $az and defined $el
!ll&&!rl&&r
004
defined $dateobs and defined $telescope and defined $az
!ll&&!rl&&r
004
defined $dateobs and defined $telescope
!ll&&!rl&&r
004
MC/DC0%0/4
defined $dateobs and defined $telescope and defined $az and defined $el
defined $dateobs defined $telescope defined $az defined $el
Truth table20%1/5
A and B and C and D
A= defined $dateobsB= defined $telescopeC= defined $azD= defined $el
ABCDresult
0XXX0
10XX0
110X0
11100
11111
451 && defined $az && defined $el ) {
452 4 my $coords = new Astro::Coords( az => $az,
453 el => $el,
454 units => 'degrees',
455 );
456 4 $coords->telescope( new Astro::Telescope( $telescope ) );
457  
458 # convert ISO date to object
459 4 my $dt = Astro::FITS::HdrTrans::Base->_parse_iso_date( $dateobs );
460 4 ▶ return unless defined $dt;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $dt 0 4 4
461  
462 4 $coords->datetime( $dt );
463  
464 4 $COORDS = $coords;
465 4 return $COORDS;
466 }
467  
468 0 return undef;
469 }
470  
471 =item B<_middle_value>
472  
473 Returns the value from the middle of an array reference. If that is
474 not defined we start from the beginning until we find a defined
475 value. Return undef if we can not find anything.
476  
477 =cut
478  
479 15 ▶sub _middle_value {
Subroutine _middle_value: called CC=5 SCAR=17.2
480 15 my $arr = shift;
481 15 my $idx = shift;
482  
483 15 ▶ $idx = int ((scalar @$arr) / 2) unless defined $idx;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $idx 6 9 15
484  
485 15 ▶ return ($idx, $arr->[$idx]) if (defined $arr->[$idx]);
Branch: 1 branch
BranchTrueFalseTotal
if defined $arr->[$idx] 13 2 15
486  
487 # No luck scan them all
488 2 for my $idx (0..$#$arr) {
489 0 my $val = $arr->[$idx];
490 0 ▶ return ($idx, $val) if defined $val;
Branch: 1 branch
BranchTrueFalseTotal
if defined $val 0 0 0
491 }
492 2 return (undef, undef);
493 }
494  
495 =back
496  
497 =head1 SEE ALSO
498  
499 C<Astro::FITS::HdrTrans>,
500 C<Astro::FITS::HdrTrans::Base>,
501 C<Astro::FITS::HdrTrans::JAC>.
502  
503 =head1 AUTHORS
504  
505 Anubhav E<lt>a.agarwal@jach.hawawii.eduE<gt>,
506 Brad Cavanagh E<lt>b.cavanagh@jach.hawaii.eduE<gt>,
507 Tim Jenness E<lt>t.jenness@jach.hawaii.eduE<gt>.
508  
509 =head1 COPYRIGHT
510  
511 Copyright (C) 2009, 2011, 2012, 2014 Science and Technology Facilities Council.
512 Copyright (C) 2016 East Asian Observatory.
513 All Rights Reserved.
514  
515 This program is free software; you can redistribute it and/or modify it under
516 the terms of the GNU General Public License as published by the Free Software
517 Foundation; either version 2 of the License, or (at your option) any later
518 version.
519  
520 This program is distributed in the hope that it will be useful,but WITHOUT ANY
521 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
522 PARTICULAR PURPOSE. See the GNU General Public License for more details.
523  
524 You should have received a copy of the GNU General Public License along with
525 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
526 Place,Suite 330, Boston, MA 02111-1307, USA
527  
528 =cut
529  
530 13 1;
« HdrTrans/MICHELLE.pm ↑ Summary HdrTrans/IRCAM.pm »