Branch Coverage

blib/lib/Astro/Coords.pm
Criterion Covered Total %
branch 308 442 69.6


line true false branch
233 511 1051 if (exists $args{'planet'} and defined $args{'planet'})
238 1051 511 unless (defined $obj)
243 5 1046 if (exists $args{'elements'} and defined $args{'elements'} && (UNIVERSAL::isa($args{'elements'}, 'HASH') && (exists $args{'elements'}{'EPOCH'} && defined $args{'elements'}{'EPOCH'} || exists $args{'elements'}{'EPOCHPERIH'} && defined $args{'elements'}{'EPOCHPERIH'})) || ref $args{'elements'} eq 'ARRAY' && $args{'elements'}[0] eq 'ELEMENTS') { }
4 1042 elsif (exists $args{'mjd1'}) { }
1029 13 elsif (exists $args{'type'} and defined $args{'type'}) { }
11 2 elsif (exists $args{'az'} or exists $args{'el'} or exists $args{'ha'}) { }
2 0 elsif (scalar keys %args == 0) { }
296 4 5053 if (@_)
317 1534 42460 if (@_)
319 0 1534 unless UNIVERSAL::isa($tel, 'Astro::Telescope')
363 12330 64402 if (@_)
367 0 0 ref $time ? :
0 12330 if defined $time and not UNIVERSAL::can($time, 'mjd')
376 76657 75 if (defined $self->{'DateTime'} and not $self->usenow) { }
414 12331 91204 if (@_)
435 2202 15647 if (@_)
456 0 7 if (@_)
460 7 0 unless defined $com
489 1042 1 if (@_)
492 1043 0 defined $self->{'NativeMethod'} ? :
517 6157 1 unless (defined $az and defined $el)
522 5965 192 defined $tel ? :
549 7510 4129 unless (defined $ra)
572 6037 3220 unless (defined $dec)
601 6160 34 unless (defined $ha)
626 14 33 unless (defined $az)
649 6126 46 unless (defined $el)
689 9 0 if ($sys eq 'FK5') { }
0 0 elsif ($sys eq 'FK4') { }
915 0 3 $self->has_datetime ? :
980 0 25 defined $tel ? :
1005 0 15 unless defined $tel
1010 15 0 if (exists $limits{'type'}) { }
1012 12 3 if ($limits{'type'} eq 'AZEL') { }
3 0 elsif ($limits{'type'} eq 'HADEC') { }
1017 8 4 if ($el > $limits{'el'}{'min'} and $el < $limits{'el'}{'max'}) { }
1028 2 1 if ($ha > $limits{'ha'}{'min'} and $ha < $limits{'ha'}{'max'}) { }
1031 1 1 if ($dec > $limits{'dec'}{'min'} and $dec < $limits{'dec'}{'max'}) { }
1097 0 1 unless $j == 0
1099 0 1 if (wantarray) { }
1124 5 1 if $self->name
1129 6 0 if ($self->type ne 'CAL')
1142 6 0 defined $mt ? :
1146 6 0 defined $t_el ? :
1149 6 0 defined $ha_set ? :
1152 6 0 if defined $t
1154 6 0 if defined $t
1158 6 0 if ($self->can('radec'))
1165 6 0 if (defined $self->telescope)
1166 6 0 defined $self->telescope->fullname ? :
1169 3 3 if ($self->isObservable) { }
1225 0 1 unless exists $opt{'start'}
1226 0 1 unless exists $opt{'end'}
1227 0 1 unless exists $opt{'inc'}
1231 0 1 if (UNIVERSAL::can($inc, 'seconds'))
1234 0 1 unless $inc > 0
1238 0 1 if not $dateclass or $dateclass ne 'Time::Piece' and $dateclass ne 'DateTime'
1247 1 0 unless $usenow
1270 25 0 if (defined $opt{'units'})
1287 0 1 if ($usenow) { }
1426 3034 30 defined $opt{'horizon'} ? :
1432 3034 30 defined $tel ? :
1443 2 1059 if (defined $self->name and lc $self->name eq 'moon' and abs $cos_ha0 > 1)
1450 2 0 if ($self->transit_el > $horizon)
1451 2 0 $self->has_datetime ? :
1454 0 2 if $Astro::Coords::DEBUG
1457 0 2 unless $convok
1464 518 2546 if abs $cos_ha0 > 1
1471 912 143 unless defined $self->name and lc $self->name eq 'sun' and $self->isa('Astro::Coords::Planet')
1527 2564 0 $self->has_datetime ? :
1542 2561 3 if ($event == 1 or $event == -1) { }
3 0 elsif ($event == 0) { }
1558 3 0 if (defined $prev and defined $next) { }
0 0 elsif (defined $prev) { }
0 0 elsif (defined $next) { }
1562 3 0 if ($prev_diff < $next_diff) { }
1587 0 1075 if (not defined $event or $event != 1 and $event != -1)
1611 157 918 if defined $self->name and lc $self->name eq 'moon'
1620 0 1075 if $Astro::Coords::DEBUG
1624 2903 1075 if (defined $mtime)
1629 0 3978 if $Astro::Coords::DEBUG
1641 1048 2930 if ($diff > 0)
1642 0 1048 if $Astro::Coords::DEBUG
1646 1023 25 if ($dtime) { }
1655 2903 1075 if (defined $prevtime and defined $mtime)
1656 1075 1828 if abs $mtime->epoch - $prevtime->epoch <= $tol
1661 0 1075 if $count > $max
1694 3485 493 unless defined $self->name and lc $self->name eq 'sun' and $self->isa('Astro::Coords::Planet')
1699 5370 100 if ($self->_isdt) { }
1731 8 0 if $self->has_datetime
1764 0 7 unless UNIVERSAL::isa($offset, 'Astro::Coords::Offset')
1767 0 7 unless $offset->projection eq 'TAN'
1772 5 2 if ($offset->system eq 'J2000') { }
2 0 elsif ($offset->system eq 'GAL') { }
1802 0 7 unless defined $coordsoffset
1808 8 20 unless defined $value
1809 7 13 if $method eq 'comment' and $value eq ''
1843 9 1 defined $self->{'RadialVelocity'} ? :
1872 2 0 if ($vd eq 'REDSHIFT' or $vd eq 'OPTICAL') { }
0 0 elsif ($vd eq 'RELATIVISTIC') { }
1880 0 0 if ($rv > 2997.92458) { }
1893 0 1 unless defined $z
1914 9 0 defined $self->{'VelocityDefinition'} ? :
1922 2 0 if (defined $defn)
1950 8 3 defined $self->{'VelocityFrame'} ? :
1957 2 0 if (defined $frame)
2040 1 1 if ($vdefn eq 'RADIO') { }
1 0 elsif ($vdefn eq 'OPTICAL' or $vdefn eq 'REDSHIFT') { }
0 0 elsif ($vdefn eq 'RELATIVISTIC') { }
2043 1 0 if ($obsvel > 2997.92458) { }
2103 0 4 if $f1 eq $f2
2140 18 23 defined $tel ? :
2171 5 31 $usebary ? :
2309 2958 8758 if defined $cachedlst
2315 8537 221 defined $tel ? :
2319 8649 109 if ($time->can('nanosecond'))
2361 3 15256 unless defined $input
2363 319 14937 if (UNIVERSAL::isa($input, 'Time::Piece')) { }
14937 0 elsif (UNIVERSAL::isa($input, 'DateTime')) { }
2389 0 25 if UNIVERSAL::can($delta, 'seconds')
2392 25 0 if (UNIVERSAL::isa($date, 'Time::Piece')) { }
2397 0 0 if (abs $delta > 1) { }
2425 0 0 defined $t1 ? :
2426 0 0 defined $t2 ? :
2470 518 2540 unless defined $ha_set
2475 0 2540 unless grep {$_ == $event;} -1, 0, 1
2481 2526 14 if ($self->_isdt)
2491 2516 24 defined $opt{'horizon'} ? :
2522 0 2645 if $estimate->[2]
2524 1327 1318 $rise ? :
2644 1 if ($self->_iterative_el($refel, $rise ? 1 : -1)) { }
2530 0 1 if $Astro::Coords::DEBUG
2541 0 4848 unless defined $a->[0] and defined $b->[0]
2542 4705 143 if abs $b->[1] - $a->[1] > $safety_seconds or $b->[2] and $a->[2]
2544 143 0 unless $a->[2]
2545 0 143 unless $b->[2]
2546 0 143 unless defined $a->[0] and defined $b->[0]
2558 0 0 $direction == -1 ? :
0 2540 if $Astro::Coords::DEBUG
2564 1270 1270 if ($rise) { }
2572 0 0 $rise ? :
0 2540 if $Astro::Coords::DEBUG
2578 856 1684 if (not $event) { }
2582 1484 200 if not defined $cmp or $cmp * $event > 0
2586 0 0 $direction == -1 ? :
0 2540 if $Astro::Coords::DEBUG
2589 856 1684 if ($direction > 0) { }
2598 1684 856 if ($direction < 0)
2602 0 0 $rise ? :
0 2540 if $Astro::Coords::DEBUG
2608 1684 856 if ($event) { }
2611 856 0 if (defined $event[0][0] and defined $event[1][0]) { }
2612 0 0 if (defined $event[0][0]) { }
0 0 elsif (defined $event[1][0]) { }
2623 35 821 if (abs $diff[0] - $diff[1] < $safety_seconds) { }
2627 35 0 if (defined $event[0][0]) { }
0 0 elsif (defined $event[1][0]) { }
2628 35 0 if (defined $event[1][0]) { }
2631 16 19 $diff[0] < $diff[1] ? :
2646 414 407 $diff[0] < $diff[1] ? :
2650 0 821 unless (defined $event[$closer][0])
2665 830 854 if $event == -1
2668 0 3164 unless defined $t->[0]
2670 0 3164 unless defined $cmp
2671 1684 1480 if ($cmp == $event or $cmp == 0)
2672 1611 73 unless $t->[2]
2680 2540 0 $havetime ? :
2749 1054 47 if (abs $el - $refel > $tol)
2750 0 1054 if ($Astro::Coords::DEBUG)
2754 0 0 $grad > 0 ? :
2759 149 905 if defined $self->name and lc $self->name eq 'moon'
2762 534 520 ($el <=> $refel) != $grad ? :
2775 2381 1054 if (defined $prevel)
2812 909 1472 if ($diff_to_curr < 0) { }
2825 52 2329 if ($has_straddled) { }
2827 2 50 if $inc < $smallinc
2830 26 24 if $diff_to_prev / $diff_to_curr < 0
2833 1 2328 if ($inc < $smallinc)
2840 2324 4 if (abs $deltat > 0 and abs $deltael > 0) { }
2848 1938 386 if ($newinc < $maxinc) { }
2851 0 1938 if $inc < $smallinc
2855 214 172 if abs $diff_to_prev < abs $diff_to_curr
2860 1 3 if abs $diff_to_prev < abs $diff_to_curr
2868 241 2137 if ($reverse)
2881 36 3396 if (not $use_dt) { }
2889 2835 561 if (abs $delta > 1) { }
2899 0 3432 if $Astro::Coords::DEBUG
2929 11678 0 unless defined $test
2934 151 11527 if ($test->isa('Time::Piece')) { }
11527 0 elsif ($test->isa('DateTime')) { }
2968 5 5099 if (exists $opt{'nearest'}) { }
2969 5 0 if ($opt{'nearest'}) { }
2974 0 0 if ($opt{'event'} == 0) { }
3004 0 10 unless defined $in
3010 1 6 if $in eq 'LSRK' or $in eq 'LSRD' or $in eq 'LG'
3016 0 6 unless $trunc =~ /^(GEO|TOP|HEL|LSR|GAL|BAR)/
3020 1 5 if $trunc eq 'LSR'
3043 0 2 unless defined $in
3052 1 1 if ($trunc eq 'RAD') { }
0 1 elsif ($trunc eq 'OPT') { }
1 0 elsif ($trunc eq 'RED') { }
0 0 elsif ($trunc eq 'REL') { }
3085 116 0 if ($str =~ /^([BJ]?)(\d+(\.\d+)?)$/i) { }
3087 2 114 $typ eq 'B' ? :
3121 1 1 if ($equ != 1950)
3178 18158 7741 unless defined $primary
3182 4486 3255 unless (exists $C->{$primary})
3209 31757 21322 unless defined $primary
3213 13807 7515 unless exists $C->{$primary}
3215 0 7515 unless defined $local
3221 40 7475 wantarray ? :
3243 1137 13409 if (not $self->has_datetime or $self->usenow or $self->datetime_is_unsafe)
3251 13002 407 defined $tel ? :
3253 0 13409 if $Astro::Coords::DEBUG
3261 13202 207 if $dt->can('nanosecond')
3279 16067 99452 if (@_)
3302 4556 7160 unless defined $key
3317 0 8758 unless defined $value
3319 4556 4202 unless defined $key
3320 2072 2130 if (1000 < scalar @_cache_global_lst)
3338 1530 27533 unless (exists $self->{$KEY})