IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 24, 2008, 8:44:54 AM (18 years ago)
Author:
Paul Price
Message:

Normalise ra,dec between 0 and 360.

File:
1 edited

Legend:

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

    r19727 r19732  
    256256    my $dec = asin(sin($theta) * sin($crval2) - cos($theta) * cos($crval2) * cos($phi));
    257257
    258     return (rad2deg($ra), rad2deg($dec));
     258    $ra = rad2deg($ra);
     259    $dec = rad2deg($dec);
     260
     261    $ra += 360 if $ra < 0;
     262    $dec += 360 if $dec < 0;
     263    $ra -= 360 if $ra >= 360;
     264    $dec -= 360 if $dec >= 360;
     265
     266    return ($ra, $dec);
    259267}
    260268
Note: See TracChangeset for help on using the changeset viewer.