;+ ; NAME: ; qsmei_hdr ; PURPOSE: ; Plot time series for quantities in SMEI frame headers ; CATEGORY: ; camera/idl/toolbox/hdr ; CALLING SEQUENCE: PRO qsmei_hdr, hdr, _extra=_extra, usedb=usedb, get=get ; INPUTS: ; hdr_or_time array; type: header or time structure ; a time structure is passed to smei_getfile ; to get the matching headers. ; OPTIONAL INPUTS: ; /usedb by default the "hdr" data base is used. ; If /usedb is set then the CCD frames are read instead ; get=get array; type: string ; default: ['FRAME_NR','MODE','SHUTTER','LED_ENABLED','FLAT_ENABLED','CCD_TEMP'] ; list of entries to be plotted ; To get a list of valid entries type: ; print, tag_names({smei_frm_hdr}) ; OUTPUTS: ; (to draw widget) ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; IsTime, qLine, smei_getfile, InitVar, IsType ; PROCEDURE: ; MODIFICATION HISTORY: ; JUN-2004, Paul Hick (UCSD/CASS) ; JAN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; More general implementation. The old one only plotted ; the current default 'get' entries. ;- InitVar, usedb, /key InitVar, get, ['FRAME_NR','MODE','SHUTTER','LED_ENABLED','FLAT_ENABLED','CCD_TEMP'] CASE 1 OF IsTime(hdr): BEGIN trange = hdr CASE usedb OF 0: smei_hdr_get, trange, _extra=_extra, time=time, hdr=hdr, count=count 1: hdr = smei_getfile(trange, _extra=_extra, count=count, /get_hdr) ENDCASE END IsType(hdr,/structure): count = n_elements(hdr) ELSE: BEGIN trange = hdr CASE usedb OF 0: smei_hdr_get, trange, _extra=_extra, time=time, hdr=hdr, count=count 1: hdr = smei_getfile(trange, _extra=_extra, count=count, /get_hdr) ENDCASE END ENDCASE IF count EQ 0 THEN BEGIN message, /info, 'no frames found' RETURN ENDIF time = smei_property(hdr,/time) tags = tag_names(hdr) x = lindgen(count) ytitle = 'frame index' exact = 1 yrange = [0,count-1] FOR i=0,n_elements(get)-1 DO BEGIN p = (where( strpos(tags,get[i]) EQ 0))[0] CASE p[0] EQ -1 OF 0: BEGIN xadd = hdr.(where( strpos(tags,strupcase(get[i])) EQ 0) ) x = [ [x], [xadd] ] ytitle = [ytitle,tags[p]] exact = [exact,1] CASE tags[p] OF 'MODE' : yrange = [[yrange],[-1,3]] 'SHUTTER' : yrange = [[yrange],[-1,2]] 'LED_ENABLED' : yrange = [[yrange],[-1,2]] 'FLAT_ENABLED' : yrange = [[yrange],[-1,2]] ELSE : yrange = [[yrange],[min(xadd,/nan),max(xadd,/nan)]] ENDCASE END 1: BEGIN message, /info, 'invalid structure field: '+get[i] message, /info, 'valid fields are:' print, tags END ENDCASE ENDFOR x = transpose(x) qline, x, time=time, ytitle=ytitle, yrange=yrange, exact=exact, _extra=_extra RETURN & END