;+ ; PROJECT: ; SDAC ; NAME: ; BATSE_TIME_INPUT ; ; PURPOSE: ; This function converts BATSE menu input line time values into HXRBS format for consistency ; with expected values by all BATSE menu procedures. ; ; CATEGORY: ; BATSE ; ; CALLING SEQUENCE: ; new_command_line = BATSE_TIME_INPUT( command_line, time_params ) ; ; CALLS: ; STR_SEP, ARR2STR, ANYTIM ; ; INPUTS: ; Command_line - user input command line,i.e. "inp,t,26-jun-92 17:00:00" ; Time_params - Menu parameters which accept full time strings, i.e. 'INP,T','STA','END','TIM' ; For 'INP' only, the time value follows a T in the second position. For the others, ; the time value immediately follows the parameter string. N.B. that not all menus accept ; the same time parameters, nor do they always have the same meaning. For some menus, ; Time means the full date, while for others it references only time of day. START ; and END parameters are passed back as only the time of day components if that is what is ; passed. The only time parameters with the BATSE MENU programs are 'INP,T','STA','END','TIM' ; ; OPTIONAL INPUTS: ; none ; ; OUTPUTS: ; The result returned is the command using a HXRBS style time string with 2 yy digits, interpreted ; from 1950-2049. ; ; OPTIONAL OUTPUTS: ; none ; ; KEYWORDS: ; none ; COMMON BLOCKS: ; none ; ; SIDE EFFECTS: ; none ; ; RESTRICTIONS: ; none ; ; PROCEDURE: ; The command line is parsed and recast. ; ; MODIFICATION HISTORY: ; Version 1, richard.schwartz@gsfc.nasa.gov, 7-may-1998. ;- function batse_time_input, command_line, time_params on_error,2 ; ; ; Convert any times into hxrbs standard time strings for the INPUT, START, END, and TIME parameters. ; parsed_line = str_sep( strupcase(command_line), ',') valid3 = strupcase(strmid(strcompress(/rem,time_params),0,3)) first3= strmid(strcompress(/rem,parsed_line(0)),0,3) wmatch = where( first3 eq valid3, nmatch) if nmatch then begin its_input = valid3(wmatch(0)) eq 'INP' if its_input and strcompress( parsed_line(1),/rem) ne 'T' then return,command_line input_time_string = arr2str(parsed_line( its_input+1:*),',') its_time_of_day = abs(anytim( input_time_string, /time,/sec) - anytim( input_time_string,/sec)) lt 1.0 hxrbs_time_string = anytim( input_time_string, /hxrbs, time = its_time_of_day ) new_command_line = arr2str([parsed_line( 0:its_input), hxrbs_time_string],',') return, strcompress(/rem,new_command_line) endif return, command_line end