Changeset 436 for trunk


Ignore:
Timestamp:
06/24/10 12:28:29 (14 years ago)
Author:
smasson
Message:

update caldat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Calendar/caldat.pro

    r371 r436  
    5959; Sebastien Masson, May 2006, add different calendar with key_caltype 
    6060; (variable of the common file cm_4cal) 
     61; 
     62;   CT, Nov 2006: For Hour/Min/Sec, tweak the input to make sure hours 
     63;       and minutes are correct. Restrict hours to 0-23 & min to 0-59. 
    6164; 
    6265; @version 
     
    177180; 
    178181; see if we need to do hours, minutes, seconds 
    179   IF (nParam GT 4) THEN BEGIN 
    180     fraction = julian + 0.5d - TEMPORARY(julLong) 
    181     hour = floor(fraction * 24d) 
    182     fraction = TEMPORARY(fraction) - hour/24d 
    183     minute = floor(fraction*1440d) 
    184     second = (TEMPORARY(fraction) - minute/1440d) * 86400d 
    185   ENDIF 
     182        IF (nParam GT 4) THEN BEGIN 
     183                fraction = julian + 0.5d - julLong 
     184        eps = 1d-12 > 1d-12*ABS(Temporary(julLong)) 
     185                hour = 0 > Floor(fraction * 24d + eps) < 23 
     186                fraction -= hour/24d 
     187                minute = 0 > Floor(fraction*1440d + eps) < 59 
     188                second = 0 > (TEMPORARY(fraction) - minute/1440d)*86400d 
     189        ENDIF 
    186190 
    187191; if julian is an array, reform all output to correct dimensions 
Note: See TracChangeset for help on using the changeset viewer.