pro old_readcol,name,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15, $ v16,v17,v18,v19,v20,v21,v22,v23,v24,v25, $ FORMAT = fmt, DEBUG=debug, SILENT=silent, SKIPLINE = skipline, $ NUMLINE = numline, DELIMITER = delimiter ;+ ; NAME: ; READCOL ; PURPOSE: ; Read a free-format ASCII file with columns of data into IDL vectors ; EXPLANATION: ; Lines of data not meeting the specified format (e.g. comments) are ; ignored. Columns may be separated by commas or spaces. ; Use READFMT to read a fixed-format ASCII file. Use RDFLOAT for ; much faster I/O (but less flexibility). ; ; CALLING SEQUENCE: ; READCOL, name, v1, [ v2, v3, v4, v5, ... v25 , ; DELIMITER= ,FORMAT = , /DEBUG , /SILENT , SKIPLINE = , NUMLINE = ] ; ; INPUTS: ; NAME - Name of ASCII data file, scalar string. In VMS, an extension of ; .DAT is assumed, if not supplied. ; ; OPTIONAL INPUT KEYWORDS: ; FORMAT - scalar string containing a letter specifying an IDL type ; for each column of data to be read. Allowed letters are ; A - string data, B - byte, D - double precision, F- floating ; point, I - integer, L - longword, Z - longword hexadecimal, ; and X - skip a column. ; ; Columns without a specified format are assumed to be floating ; point. Examples of valid values of FMT are ; ; 'A,B,I' ;First column to read as a character string, then ; 1 column of byte data, 1 column integer data ; 'L,L,L,L' ;Four columns will be read as longword arrays. ; ' ' ;All columns are floating point ; ; If a FORMAT keyword string is not supplied, then all columns are ; assumed to be floating point. ; ; /SILENT - Normally, READCOL will display each line that it skips over. ; If SILENT is set and non-zero then these messages will be ; suppressed. ; /DEBUG - If this keyword is non-zero, then additional information is ; printed as READCOL attempts to read and interpret the file. ; DELIMITER - single character specifying delimiter used to separate ; columns. Default is either a comma or a blank. ; SKIPLINE - Scalar specifying number of lines to skip at the top of file ; before reading. Default is to start at the first line. ; NUMLINE - Scalar specifying number of lines in the file to read. ; Default is to read the entire file ; ; OUTPUTS: ; V1,V2,V3,...V25 - IDL vectors to contain columns of data. ; Up to 25 columns may be read. The type of the output vectors ; are as specified by FORMAT. ; ; EXAMPLES: ; Each row in a file POSITION.DAT contains a star name and 6 columns ; of data giving an RA and Dec in sexigesimal format. Read into IDL ; variables. (NOTE: The star names must not contain internal spaces.) ; ; IDL> FMT = 'A,I,I,F,I,I,F' ; IDL> READCOL,'POSITION',F=FMT,name,hr,min,sec,deg,dmin,dsec ; ; The HR,MIN,DEG, and DMIN variables will be integer vectors. ; ; Alternatively, all except the first column could be specified as ; floating point. ; ; IDL> READCOL,'POSITION',F='A',name,hr,min,sec,deg,dmin,dsec ; ; To read just the variables HR,MIN,SEC ; IDL> READCOL,'POSITION',F='X,I,I,F',HR,MIN,SEC ; ; RESTRICTIONS: ; This procedure is designed for generality and not for speed. ; If a large ASCII file is to be read repeatedly, it may be worth ; writing a specialized reader. ; ; Columns to be read as strings must not contain the delimiter character ; (i.e. commas or spaces by default). Either change the default ; delimiter with the DELIMITER keyword, or use READFMT to read such files. ; ; Numeric values are converted to specified format. For example, ; the value 0.13 read with an 'I' format will be converted to 0. ; ; PROCEDURES CALLED ; GETTOK(), NUMLINES(), REPCHR(), STRNUMBER(), ZPARCHECK ; ; REVISION HISTORY: ; Written W. Landsman November, 1988 ; Modified J. Bloch June, 1991 ; (Fixed problem with over allocation of logical units.) ; Added SKIPLINE and NUMLINE keywords W. Landsman March 92 ; Read a maximum of 25 cols. Joan Isensee, Hughes STX Corp., 15-SEP-93. ; Call NUMLINES() function W. Landsman Feb. 1996 ; Added DELIMITER keyword W. Landsman Nov. 1999 ; Fix indexing typos (i for k) that mysteriously appeared W. L. Mar. 2000 ; Hexadecimal support added. MRG, RITSS, 15 March 2000. ;- On_error,2 ;Return to caller if N_params() lt 2 then begin print,'Syntax - readcol, name, v1, [ v2, v3,...v25, ' print,' FORMAT= ,/SILENT ,SKIPLINE =, NUMLINE = , /DEBUG]' return endif ; Get number of lines in file nlines = NUMLINES( name ) if nlines LT 0 then return if keyword_set(DEBUG) then $ message,strupcase(name)+' contains ' + strtrim(nlines,2) + ' lines',/INF if not keyword_set( SKIPLINE ) then skipline = 0 nlines = nlines - skipline if keyword_set( NUMLINE) then nlines = numline < nlines ncol = N_params() - 1 ;Number of columns of data expected vv = 'v' + strtrim( indgen(ncol)+1, 2) nskip = 0 if N_elements(fmt) GT 0 then begin ;FORMAT string supplied? zparcheck, 'READCOL', fmt, 2, 7, 0, 'FORMAT string' ; Remove blanks from format string frmt = strupcase(strcompress(fmt,/REMOVE)) remchar, frmt, '(' ;Remove parenthesis from format remchar, frmt, ')' ; Determine number of columns to skip ('X' format) pos = strpos(frmt, 'X', 0) while pos NE -1 do begin pos = strpos( frmt, 'X', pos+1) nskip = nskip + 1 endwhile endif else begin ;Read everything as floating point frmt = 'F' if ncol GT 1 then for i = 1,ncol-1 do frmt = frmt + ',F' if not keyword_set( SILENT ) then message, $ 'Format keyword not supplied - All columns assumed floating point',/INF endelse nfmt = ncol + nskip idltype = intarr(nfmt) ; Create output arrays according to specified formats k = 0L ;Loop over output columns hex = bytarr(nfmt) for i = 0L, nfmt-1 do begin fmt1 = gettok( frmt, ',' ) if fmt1 EQ '' then fmt1 = 'F' ;Default is F format case strmid(fmt1,0,1) of 'A': idltype(i) = 7 'D': idltype(i) = 5 'F': idltype(i) = 4 'I': idltype(i) = 2 'B': idltype(i) = 1 'L': idltype(i) = 3 'Z': begin idltype(i) = 3 ;Hexadecimal hex(i) = 1b end 'X': idltype(i) = 0 ;IDL type of 0 ==> to skip column ELSE: message,'Illegal format ' + fmt1 + ' in field ' + strtrim(i,2) endcase ; Define output arrays if idltype(i) NE 0 then begin st = vv(k) + '= make_array(nlines,TYPE = idltype(i) )' tst = execute(st) k = k+1 endif if (fmt1 EQ 'Z') then idltype(i) = -1 endfor openr, lun, name, /get_lun ngood = 0L temp = ' ' if skipline GT 0 then $ for i = 0, skipline-1 do readf, lun, temp ;Skip any lines for j = 0L, nlines-1 do begin readf, lun, temp if strlen(temp) LT ncol then begin ;Need at least 1 chr per output line ngood = ngood-1 if not keyword_set(SILENT) then $ message,'Skipping Line ' + strtrim(skipline+j+1,2),/INF goto, BADLINE endif if not keyword_set(delimiter) then begin temp = repchr(temp,',',' ') ;Replace comma delimiters by spaces delimiter = ' ' endif k = 0 for i = 0L,nfmt-1 do begin temp = strtrim(temp,1) ;Remove leading spaces var = gettok(temp,delimiter) ;Read next field if ( idltype(i) NE 0 ) then begin ;Expecting data? if ( idltype(i) NE 7 ) then begin ;Check for valid numeric data tst = strnumber(var,val,hex=hex(i)) ;Valid number? if tst EQ 0 then begin ;If not, skip this line if not keyword_set(SILENT) then $ message,'Skipping Line ' + strtrim(skipline+j+1,2),/INF ngood = ngood-1 goto, BADLINE endif st = vv(k) + '(ngood) = val' endif else $ st = vv(k) + '(ngood) = strtrim(var,2)' tst = execute(st) k = k+1 endif endfor BADLINE: ngood = ngood+1 endfor free_lun,lun if ngood EQ 0 then begin message,'ERROR - No valid lines found for specified format',/INFORM return endif if not keyword_set(SILENT) then $ message,strtrim(ngood,2) + ' valid lines read', /INFORM ; Compress arrays to match actual number of valid lines for i = 0,ncol-1 do begin tst = execute(vv(i) + '='+ vv(i)+ '(0:ngood-1)') endfor return end ;--------------------------------------------------------------------------- ; Document name: hsi_sohdata__define.pro ; Created by: David Ardila, February 17, 1999 ; ; Last Modified: Tue Oct 9 16:25:46 2001 (ardila@astron) ;--------------------------------------------------------------------------- ; ;+ ; PROJECT: ; HESSI ; ; NAME: ; HESSI SOHDATA CLASS DEFINITION ; ; PURPOSE: ; Manages HESSI soh data type methods. The data are ; read from a packet object. ; ; CATEGORY: ; Utilities (idl/util) ; ; CONSTRUCTION: ; obj = Obj_New( 'hsi_sohdata' ) ; obj = HSI_Sohdata() ; ; (INPUT) CONTROL PARAMETERS DEFINED IN THIS CLASS: ; ; Defined in {hsi_sohdata_control} ; ; soh_time_range: [0D, 4D] Time range in ; seconds relative to obs_time_interval ; soh_label:Pointer to a string array with the keywords wanted. These ; are 'natural language' keywords or ITOS keywords ; ; To see a list of all control parameters, use ; o->Print, /CONTROL_ONLY ; To assign a value to a control parameter, use ; o->Set, KEYWORD=value ; To retrieve the value of a control parameter, use ; value=o->Get( /KEYWORD ) ; ; ; (OUTPUT) INFORMATIONAL PARAMETERS DEFINED IN THIS CLASS: ; ; Defined in {hsi_sohdata_info} ; ; soh_time_array: ptr_new() A pointer to an array of times in sec. ; The times contain the collect time of each packet ; soh_absolute_time_range:Dblarr(2) Equivalent to ; absolute_time_range in hsi_eventlist ; soh_info: a pointer to an array of pointers. Each points to an informational structure ; soh_data_files(): a pointer to a structure that will contain the information within the HESSI files ; (Keyword names in each file, bit positions, etc.) ; ; To see a list of all info parameters, use ; o->Print, /INFO_ONLY ; To retrieve the value of an info parameter, use ; value=o->Get( /KEYWORD ) ; ; ; METHODS DEFINED OR OVERRIDDEN IN THIS CLASS: ; Init ; Set ; Process ; Plot ; KEYWORDS: ; ; soh_include_all: If set, the result include all packets, ; including those flagged as bad by hsi_bad_pak ; ; EXAMPLES: ; ; Start by instatiating the object class: ; sohdata = Obj_New( 'hsi_sohdata' ) ; or ; sohdata=hsi_sohdata() ; ; data = sohdata->GetData(filename='XXX',app_id=1,file_type='XXX',soh_label=['###','###',...] ) ; data is an array of pointers, where each one point to a number array with the data. ; What each pointer is, can be found by doing info=sohdata->get(/info) ; ; A very useful procedure is ; sohdata->plot ; ; ; PARENT CLASS: ; Framework ; ; (AGGREGATED) SOURCE CLASSES: ; HSI_Packet ; ; DESTINATION CLASSES: ; HSI_Binned_Sohdata, HSI_Spectrum, HSI_Lightcurve ; ; SEE ALSO: ; hessi.ssl.berkeley.edu/software/reference.html#hsi_sohdata ; hsi_sohdata_control__define ; hsi_sohdata_info__define ; framework ; hsi_packet__define ; hsi_simulation__define ; hsi_packet2soh ; hsi_soh_type_conversion ; ; HISTORY: ; Release Feb 16, 2001 ; David Ardila (ardila@astron.berkeley.edu) ; Oct. 9, 2001: D. Ardila. Added widget routines to plot. ;-------------------------------------------------------------------- FUNCTION HSI_Sohdata::INIT, SOURCE = source, _EXTRA=_extra IF NOT OBJ_VALID( source ) THEN source = HSI_Packet() ret = self -> Framework::INIT( CONTROL = {hsi_sohdata_control}, $ INFO={hsi_sohdata_info}, $ SOURCE=source,_EXTRA = _extra ) ;The following contains the code to read the files. ;These files have information about the registers: where they are, what they have, etc. ;Hardwired these paths, and removed annoying calls to hsi_loc_file dbase_dir = 'soh' dbase_dir = concat_dir('dbase', dbase_dir) dbase_dir = concat_dir('hessi', dbase_dir) dbase_dir = concat_dir('$SSW', dbase_dir) print, 'SOH dbase dir: '+dbase_dir pathAC = findfile(concat_dir(dbase_dir, 'HESSIAC001.PDB') ,count=cntAC) ;pathAC=hsi_loc_file('HESSIAC001.PDB',count=cntAC) if cntAC eq 0 then begin print,'File HESSIAC001.PDB not found' retall endif pathDC = findfile(concat_dir(dbase_dir, 'HESSIDC001.PDB') ,count=cntdC) ;pathDC=hsi_loc_file('HESSIDC001.PDB',count=cntDC) if cntDC eq 0 then begin print,'File HESSIDC001.PDB not found' retall endif pathLT = findfile(concat_dir(dbase_dir, 'HESSILT001.PDB'),count=cntLT) ;pathLT=hsi_loc_file('HESSILT001.PDB',count=cntLT) if cntLT eq 0 then begin print,'File HESSILT001.PDB not found' retall endif pathTy = findfile(concat_dir(dbase_dir, 'HESSITY001.PDB'),count=cntTY) ;pathTY=hsi_loc_file('HESSITY001.PDB',count=cntTY) if cntTY eq 0 then begin print,'File HESSITY001.PDB not found' retall endif old_readcol,pathAC,nameAC,pol1,pol2,delimiter='&',format='A,F,F' old_readcol,pathDC,nameDC,infoDC,delimiter='&',format='A,A' old_readcol,pathLT,nameLT,stuffLT,high,low,delimiter='&',format='A,A,A,A' old_readcol,pathTY,nameTY,infoTY,units,numbits,start,dest,pos,format='A,A,A,I,I,A,L',delimiter='&' info_struct={soh_data_files} ;This is defined in hsi_sohdata_info__define.pro info_struct.nameAC=ptr_new(nameAC) info_struct.nameDC=ptr_new(nameDC) info_struct.nameLT=ptr_new(nameLT) info_struct.nameTY=ptr_new(nameTY) info_struct.pol1 =ptr_new(pol1) info_struct.pol2 =ptr_new(pol2) info_struct.infoDC=ptr_new(infoDC) info_struct.stuffLT=ptr_new(stuffLT) info_struct.infoTY=ptr_new(infoTY) info_struct.units =ptr_new(units) info_struct.numbits =ptr_new(numbits) info_struct.start =ptr_new(start) info_struct.dest =ptr_new(dest) info_struct.pos =ptr_new(pos) info_struct.high =ptr_new(high) info_struct.low =ptr_new(low) self->set,soh_data_files=info_struct RETURN, ret END ;-------------------------------------------------------------------- PRO Hsi_sohdata::Set, $ ALL=all, $ SOH_TIME_RANGE=soh_time_range, $ _EXTRA=_extra,SOH_LABEL=soh_label source = self->Get( /SOURCE ) classname = Obj_Class( source ) IF Keyword_Set( ALL ) THEN BEGIN self->Set, SOH_TIME_RANGE = [0, 0] ENDIF ;CHeck IF Keyword_Set( SOH_TIME_RANGE ) THEN begin soh_time_range = AnyTim( soh_time_range ) self->Framework::Set, SOH_TIME_RANGE = soh_time_range endif IF Keyword_Set( soh_label ) THEN self->Framework::Set, soh_label=soh_label self->Framework::Set, _EXTRA = _extra RETURN END ;-------------------------------------------------------------------- PRO HSI_Sohdata::Process, $ _EXTRA=_extra time_range = self->Get( /SOH_TIME_RANGE ) IF Keyword_Set( ALL ) THEN time_range = [0,0] filename = self->Get( /FILENAME, FOUND=found) IF time_range[0] GT 1e6 THEN BEGIN soh_absolute_time_range = time_range ENDIF ELSE BEGIN time_interval = self->Get( /OBS_TIME_INTERVAL ) IF time_interval[0] EQ 0 THEN BEGIN time_interval = self->Get( /FILE_TIME_RANGE ) ENDIF IF NOT Valid_Range( time_range ) THEN BEGIN soh_absolute_time_range = time_interval ENDIF ELSE BEGIN soh_absolute_time_range = time_interval[0] + time_range ENDELSE ENDELSE self->Set, SOH_ABSOLUTE_TIME_RANGE = soh_absolute_time_range include=where(tag_names(_extra) eq 'SOH_INCLUDE_ALL',cnt) if cnt ne 0 then SOH_INCLUDE_ALL=_extra.SOH_INCLUDE_ALL soh_label=self->get( /soh_label ) soh_data_files=self->get( /soh_data_files ) if size(soh_label,/type) eq 7 then begin ;Tags packet = self.source[0]->GetData( APP_ID=1, $ _EXTRA=_extra, $ PACKET_TIME_RANGE=soh_absolute_time_range) IF Datatype( packet ) NE 'INT' THEN BEGIN HSI_Packet2Soh,packet,soh_ptr,info,soh_time_array,soh_label=soh_label,soh_data_files,SOH_INCLUDE_ALL=soh_include_all if ptr_valid(soh_ptr[0]) then begin ;Set info parameters self->set,soh_time_array=soh_time_array self->Set, soh_info=info endif else begin print,'Invalid Keyword' endelse ENDIF ELSE BEGIN print,'No State of Health data found' soh_ptr=ptr_new() ENDELSE endif else begin print,'No keywords defined' soh_ptr=ptr_new() endelse self->SetData, soh_ptr self->Set, NEED_UPDATE = 0 return END ;-------------------------------------------------------------------- ;Here are the procedures that control widget operations. PRO Hsi_sohdata::plot,_EXTRA=_extra ;Create base widget base=widget_base(/column,/base_align_center,title='State-Of-Health') text_button=cw_field(base,/return_events,uvalue='text',title='Enter keywords/target words, separated by commas and PRESS ENTER',/column) time_button=cw_field(base,/return_events,uvalue='text',title='Enter time limits, separated by commas',/column) done_button=widget_button(base,value='Done',uvalue='Bye') print,'Check sprg.ssl.berkeley.edu/~hessiops/tcvol2/packets/app0001.html' ;This structure contains the information shared by all routines. if not(keyword_set(_extra)) then _extra=-1 ;Initialize to invalid values soh_extra={extrakw:_extra,$ ;extrakw: The extra Keywords object:self,$ ;Object: The Id of the source object list:long(0),$ ;List: the ID of the widget with the list of keywords message:long(0),$ ;Message:The ID of the widget with the message go_button:long(0),$ ;go_button, done_button,time_button,text_button: ids of these buttons plotman_obj:obj_new(),$ ;Object with plot done_button:done_button,$ time_button:time_button,$ text_button:text_button,$ index:ptr_new([-1]),$ ;index: Elements of values to plot p:ptr_new()} ;p: Data, returned by getdata() widget_control,base,set_uvalue=soh_extra widget_control,base,/realize ;Realize base xmanager,'soh_base',base,/no_block return end ;-------------------------------------------------------------------- pro soh_base_event,ev ;Event Handler ;Get ID of the widget that called widget_control,ev.id,get_uvalue=uval ;Get structure with all info widget_control,ev.top,get_uvalue=soh_extra done_button=soh_extra.done_button message=soh_extra.message ;Destroy message, if present if widget_info(message,/valid_id) then widget_control,message,/destroy case uval of 'text':soh_text_control,ev,soh_extra 'Go':go_control,ev,soh_extra 'Bye':begin ;Destroy plot window and leave if obj_valid(soh_extra.plotman_obj) then obj_destroy,soh_extra.plotman_obj widget_control,ev.top,/destroy return end 'list':begin ;Get those buttons that are selected index=-1 widget_control,ev.id,get_value=change good=where(change ne 0,cnt) if cnt ne 0 then index=good soh_extra.index=ptr_new(index) end endcase widget_control,ev.top,set_uvalue=soh_extra return end ;----------------------------------------------------- pro soh_text_control,ev,soh_extra ;Handles Text input ;Assumes that there is no soh_label in _extra widget_control,/hourglass widget_control,soh_extra.text_button,get_value=text_value widget_control,soh_extra.time_button,get_value=time_value ;Make a list of keywords keyw_array=strtok(text_value[0], ',', /EXTRACT) keyw_array=strtrim(keyw_array,2) ;Create soh_label soh_label=keyw_array ;values=soh_label ;If soh_label is undefined, the program will use those in the ;info structure soh_time_range=anytim(strtok(time_value[0], ',', /EXTRACT)) ;stop if n_elements(soh_time_range) eq 1 then soh_time_range=[0,0] ;If bad times use all object=soh_extra.object _extra=soh_extra.extrakw if (size(_extra))[2] eq 8 then begin ;_Extra is a structure p=object->getdata(_EXTRA=_extra,soh_label=soh_label,soh_time_range=soh_time_range) endif else begin p=object->getdata(soh_label=soh_label,soh_time_range=soh_time_range) endelse ;stop list=soh_extra.list go_button=soh_extra.go_button done_button=soh_extra.done_button if ptr_valid(p[0]) then begin info=object->get(/info) info=info.soh_info nelem=n_elements(info) values=replicate('',nelem) ;This 'if' is needed because IDL is dumb if nelem eq 1 then begin values[0]=info.mnemonic+': '+info.name+' ('+info.units+')' endif else begin for i=0,nelem-1 do values[i]=(*info[i]).mnemonic+': '+(*info[i]).name+' ('+(*info[i]).units+')' endelse ;values now contains the names of those registers found ;Destroy the list if present if widget_info(list,/valid_id) then widget_control,list,/destroy ;Destroy 'Done' button widget_control,done_button,/destroy ;New list list=cw_bgroup(ev.top,values,/nonexclusive,/frame,/return_name,uval='list',/scroll,y_scroll_size=400,x_scroll_size=400) if widget_info(go_button,/valid_id) then widget_control,go_button,/destroy go_button=widget_button(ev.top,value='Go!',uvalue='Go') soh_extra.list=list soh_extra.go_button=go_button endif else begin ;No pointer valid widget_control,done_button,/destroy message=widget_label(ev.top,value='Keyword not found',/ALIGN_CENTER) soh_extra.message=message values=[' '] endelse ;End of if ptr_valid(p[0]) then done_button=widget_button(ev.top,value='Done',uvalue='Bye') ;New 'done' button soh_extra.done_button=done_button soh_extra.p=ptr_new(p) ;soh_extra.values=ptr_new(values) widget_control,ev.top,set_uvalue=soh_extra widget_control,ev.top,/realize return end ;----------------------------------------------------- pro go_control,ev,soh_extra ;Handles the 'Go' button widget_control,/hourglass done_button=soh_extra.done_button index=*(soh_extra.index) object=soh_extra.object ;Path with website path='sprg.ssl.berkeley.edu/~hessiops/tcvol2/packets/app0001.html' if n_elements(index) ne 0 then begin ;Are there buttons? if index[0] ne -1 then begin ;Are there buttons selected? plotman_obj=soh_extra.plotman_obj if obj_valid(plotman_obj) then obj_destroy,plotman_obj time=object->get(/soh_time_array) info=object->get(/info) info=info.soh_info nwin=n_elements(index) ;Number of plots ninfo=n_elements(info) ;IDL is dumb. If there is only one register found, info is a structure and not ;a pointer plotman_obj = plotman (plot_type='utplot', $ /dim1_enab_sum, /multi) for i=0,nwin-1 do begin if ninfo eq 1 then begin tags=(info[index[0]]).mnemonic names=(info[index[0]]).name units=(info[index[0]]).units num_tags=n_tags(info[index[0]]) extra_info=*((info[index[0]]).text) endif else begin tags=(*info[index[i]]).mnemonic names=(*info[index[i]]).name units=(*info[index[i]]).units num_tags=n_tags(*info[index[i]]) extra_info=*((*info[index[i]]).text) endelse ;print,extra_info p=*(soh_extra.p) vector=reform(*p[index[i]]) title=names ytitle=tags+' ('+units+')' label=extra_info if num_tags gt 5 then begin ;analog quantity if ninfo eq 1 then begin red_low=(info[index[0]]).red_low red_high=(info[index[0]]).red_high yell_low=(info[index[0]]).yell_low yell_high=(info[index[0]]).yell_high endif else begin red_low=(*info[index[i]]).red_low red_high=(*info[index[i]]).red_high yell_low=(*info[index[i]]).yell_low yell_high=(*info[index[i]]).yell_high endelse data=[[vector],$ [red_high+time*0],$ [yell_high+time*0],$ [yell_low+time*0],$ [red_low+time*0]] ids=['Data','RH = '+strcompress(string(red_high)),$ 'YH = '+strcompress(string(yell_high)),$ 'YL = '+strcompress(string(yell_low)),$ 'RL = '+strcompress(string(red_low))] dim1_colors=[255,243,246,246,243] dim1_use=indgen(5) psym=0 endif else begin ;Digital Quantity data=vector red_low=min(vector) psym=2 red_high=max(vector) ids=['Data'] dim1_colors=[255] dim1_use=indgen(1) endelse ;This form produces the right plot, but for strange reasons ;time is not in yohkoh format ltc = obj_new('utplot', anytim(time,/yoh), data,utbase=anytim(time[0],/yoh)) ltc -> set, $ id=title,data_unit=ytitle, $ dim1_id=ids, dim1_unit='y values', $ label=label, $ status=status,err_msg=err_msg,yrange=[min([vector,red_low]),$ max([vector,red_high])],ysty=3 if not status then begin print,err_msg return endif plotman_obj ->set, input=ltc, $ dim1_use=dim1_use, dim1_ids=ids,psym=psym,dim1_colors=dim1_colors plotman_obj -> new_panel, ytitle endfor soh_extra.plotman_obj=plotman_obj return ;RETURN FROM HERE!!! endif endif widget_control,done_button,/destroy ;Destroy 'Done' button message=widget_label(ev.top,value='You must select a keyword first',/ALIGN_CENTER ) soh_extra.message=message done_button=widget_button(ev.top,value='Done',uvalue='Bye') soh_extra.done_button=done_button widget_control,ev.top,set_uvalue=soh_extra return end ;----------------------------------------------------- PRO Hsi_sohdata__define ;Hessi State of Health Data Object self = {hsi_sohdata, inherits framework} RETURN END ;o=hsi_sohdata() ;o->plot,filename='/disks/sunny/ops/eng_tlm_archive/storage/vc1_frame_167_bsi_sundial_COOL_DETCHECK_2001-200-19:11:23.0',file_type='smex' ;H001APID H001CNT TADBSEPCOUNT TADBSTEPCNT TFSWVERSL2 TFSWVERSL4