How to Read the Temperature Log Files for Deep Impact TV2 or TV4 HRI data To aid calibration analyses of the TV2 data from the HRII and HRIV instruments and the TV4 data from the HRII, HRIV, and MRI instruments, the temperature logs recorded during TV2 and TV4 were re-formatted using the same fixed-width, comma-separated, ASCII table layout. During TV2 and TV4, instrumental temperatures were recorded at intervals of about 5 minutes. However, data were acquired at much higher frequencies. Therefore, the ground-support computer's (ITOC) time stamp in the name of a data file usually fell between two entries in the temperature logs. For some analyses, it was appropriate to simply extract temperatures for the log entry that is closest to the ITOC time in the filename. However, if an analysis was very time and temperature dependent, one needed to interpolate between two entries in the temperature logs. The following IDL function was developed by Tony Farnham, University of Maryland, for HRII dark frame analysis of TV2 and TV4 data because his analysis was highly dependent on time and temperature. The function reads the HRI temperature log file from TV2 or TV4 and interpolates between two table entires to obtain the temperatures for a given ITOC (image) time. The method may be used to extract and interpolate temperatures for HRIV data from the HRI TV2 and TV4 temperature logs or for MRI data from the TV4 MRI temperature log. This IDL function is provided by the Deep Impact mission for informational purposes only and is not maintained by the PDS Small Bodies Node. FUNCTION temp_ext_hri, itoc_time, dir_path ;+ ; NAME: ; TEMP_EXT_HRI ; PURPOSE: ; Function for reading the temperature log file from the TV2 or TV4 ; data and interpolating to obtain the temperatures for a given ; ITOC time. ; ; Currently, the filenames for the TV2 and TV4 temperature files ; are hardcoded to: ; ; templog_tv2_hri.tab for TV2 or ; templog_tv4_hri.tab for TV4 ; ; ; CALLING SEQUENCE: ; TEMP = TEMP_EXT_HRI(ITOC_TIME, DIR_PATH) ; ; INPUTS: ; ITOC_TIME ITOC time in the format YYDOY.DDDDDDDD (double) ; DIR_PATH Directory path to the templog_tv2_hri.tab or ; templog_tv4_hri.tab file. ; ; OUTPUTS: ; TEMP Array of Temperatures ; 0) IR focal plane array ; 1) Sim bench near flexure ; 2) Prism temp 1 ; 3) Prism temp 2 ; 4) Beam splitter ; 5) Opt bench CCD ; 6) Opt bench preamp box ; 7) Opt Bench Secondary radiator ; 8) Average of Prism temp 1 & 2 ; 9) Telescope barrel at center A temp ; 10) IR cooler secondary radiator temp ; 11) Primary mirror temp ; 12) Telescope barrel baffle extension temp ; 13) Telescope barrel at center B temp ; ; Returns -1 if itoc_time is never bracketed ; Returns -2 if interpolation is between two different days ; ; ; REVISON HISTORY: ; Written 29 Oct 2002 - Tony Farnham ; Revised 25 Mar 2004 - Modified from temp_ext_tv4.pro to read ; temp files for both TV2 and TV4 ; Revised 16 Sep 2004 - Replaced the hardcoded directory path ; for temp files with input parameter ; dir_path. S.McLaughlin ;- On_error,2 ; --- Open the temperature file log for the proper TV if (itoc_time gt 2228. and itoc_time lt 2245.) then $ openr,lun,$ dir_path+'templog_tv2_hri.tab',/GET_LUN $ else if (itoc_time gt 3053. and itoc_time lt 3072.) then $ openr,lun,$ dir_path+'templog_tv4_hri.tab',/GET_LUN $ ; --- If the itoc_time is not bracketed by the file, return -1 else return,-1 f1 = '(16x,f14.8, 14(2x,f7.3))' ;----- Create arrays for storing the data temp1 = fltarr(14) temp2 = fltarr(14) temp0 = fltarr(14) time1 = 1.0d time2 = 1.0d time0 = itoc_time ; ----- read the first line of the file readf,lun,time1,temp1,format=f1 ; ---- for additional lines, read and see if itoc_time falls between 1 and 2 while not eof(lun) do begin readf,lun,time2,temp2,format=f1 ; ---- if time is bracketed, interpolate the temps and return if time2 ge itoc_time and time1 le itoc_time then begin close,lun free_lun,lun ; ----- check to see if interpolation is across more than 2.4 hrs (diff days) if time2-time1 gt 0.1 then return, -2 ;------ Interpolate to get the temperature temp0 = temp1 + (time0-time1)*(temp2-temp1)/(time2-time1) return,temp0 ; ---- Otherwise reset time1 and read the next line endif else begin time1 = time2 temp1 = temp2 endelse endwhile ; --- If the time is never bracketed, return -1 as an error code close,lun,/force free_lun,lun return,-1 end