IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 18, 2009, 11:01:03 AM (16 years ago)
Author:
bills
Message:

prevent division by zero

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/magic_tree.pl

    r24174 r26183  
    169169    # Coordinates on rotated celestial sphere
    170170    my $phi = atan2($eta,$xi) + pi/2;
    171     my $theta = atan(180 / pi / sqrt($xi**2 + $eta**2));
     171    my $denominator = sqrt($xi**2 + $eta**2);
     172    &my_die("denominator is zero!!", $magic_id, $PS_EXIT_PROG_ERROR) if $denominator == 0;
     173
     174    my $theta = atan(180 / pi / $denominator);
    172175
    173176    # Coordinates on celestial sphere
Note: See TracChangeset for help on using the changeset viewer.