;+ ; NAME: ; htohms ; PURPOSE: (one line) ; Convert from decimal hours to hours, minutes, and seconds ; DESCRIPTION: ; ; CATEGORY: ; Astronomy ; CALLING SEQUENCE: ; htohms, h, hh, mm, ss ; INPUTS: ; h : time expressed in decimal hours. May be a vector, in which case ; the outputs will be vectors. ; OPTIONAL INPUT PARAMETERS: ; ; KEYWORD PARAMETERS: ; ; OUTPUTS: ; hh : Hours ; mm : Minutes ; ss : Seconds ; COMMON BLOCKS: ; ; SIDE EFFECTS: ; ; RESTRICTIONS: ; ; PROCEDURE: ; The angle is reduced to its principal value then converted to hours. ; The decimal number of hours is broken up into the three pieces. There are ; no invalid input quantities. ; Calls external function prival.pro. ; MODIFICATION HISTORY: ; 2005 07 14 Leslie Young, SwRi ; based on radtohms, M Bie, Lowell Observatory ;- PRO htohms, h, hh, mm, ss ; Check for required parameters. IF N_PARAMS() NE 4 THEN BEGIN ; Display the calling sequence. PRINT, 'htohms, h, hh, mm, ss' RETURN ENDIF ; Allow input to be integer, long, float, or double, and scalar or vector. IF badpar( h, [2,3,4,5], [0,1], CALLER='HTOHMS ' ) THEN RETURN hh = FIX( h ) mm = FIX( (h - hh) * 60.0 ) ss = ( h - double(hh) - double(mm)/60.0d0 ) * 3600.0D0 END