;+ ; PROJECT: ; SDAC ; NAME: ; QLDISPLAY ; ; PURPOSE: ; Main procedure for display of BATSE quicklook plots. Provides menu to ; let user choose time and plot either orbital or 24-hour quicklook plots. ; ; ; CATEGORY: ; CGRO/BATSE ; ; CALLING SEQUENCE: ; QLDISPLAY ; ; ; CALLS: ; BATSE_TIME_INPUT, UTIME, LOC_FILE, PATH_DIR, FIX_MAILADDR, QL_PLOTTER, SETUT, ; SPS, TEK_PRINT, SET_GRAPHICS, ALPHA_PAGE, GRAPHICS_PAGE, YOHKOH_FORMAT ; ; INPUTS: ; none explicit, only through commons; ; ; OPTIONAL INPUTS: ; none ; ; OUTPUTS: ; none explicit, only through commons; ; ; OPTIONAL OUTPUTS: ; none ; ; KEYWORDS: ; none ; COMMON BLOCKS: ; none ; ; SIDE EFFECTS: ; none ; ; RESTRICTIONS: ; none ; ; PROCEDURE: ; none ; ; MODIFICATION HISTORY: ; Kim Tolbert July, 1992 ; ; Modified 9/3/92 to add SequentialPlots command to allow user to autmatically ; make lots of plots easily. Prompts for orbital or full-day, end time, ; screen, mail, or print plot, and mail address, and then loops through from ; TIME to the end time requested. ; Mod 4-jun-94 KT. Initialize PostScript device to landscape. Also ; changed ql_day_plot and ql_orbit_plot to not set device on each plot. ; User can now select orientation in selectdevices. ; Mod 23-sep-94 AES. Use menu format for sequentialplot questions, ; rather than asking questions one at a time. ; Mod 13-oct-94 by AES. Check for long window when entering procedure - ; if one exists, replace it with a standard size window. Otherwise do ; nothing. ; Mod 28-jun-95 by AES use lowercase filenames ; VERSION 7, richard.schwartz@gsfc.nasa.gov, 26-aug-1997, ; used loc_file with path_dir('batse') to locate help files. ; Version 8, richard.schwartz@gsfc.nasa.gov, 2-feb-1998, use have_windows and sps. ; Version 9, richard.schwartz@gsfc.nasa.gov, 18-mar-1998, specify window number from current. ; Version 9, richard.schwartz@gsfc.nasa.gov, now accepts all ANYTIM compatible time strings for ; time parameters TIME, START, and END. ;- ; ----------------------------------------------------------------------------- pro qldisplay !quiet = 1 ; @fscom @remotecom hxrbs_format, old_format=old_time_format result=execute("if (!d.window ne -1) and (have_windows()) then " + $ "window,!d.window, retain=2") dable = ['Enable', 'Disable'] ; ; set_graphics ; inline = ' ' time = utime('91/4/19,0') st_time = utime('91/4/19,0') end_time = utime('91/4/20,0') itype = 1 xmulti = 1 ymulti = 1 !p.multi = [0,xmulti,ymulti] checkvar, noplotfile, 1 save_bangp = replicate(!p, 2) save_bangx = replicate(!x, 2) save_bangy = replicate(!y, 2) data_plotted = 0 savedev = !d.name sps,/landscape if xdevice(savedev,/is_it_x) eq 'X' then set_x else set_plot, savedev ; start: alpha_page print, ' ' print, $ '---------------------------------------------------------------------' print, $ 'Quick-Look Plot Display Program - draws the archived quick-look plots ' print, $ 'on your terminal and/or to a plot file.' print, $ '---------------------------------------------------------------------' print, ' ' print,'Change options by entering first 3 letters of item, comma, new value.' print,'After setting options, enter one of the available commands.' print, ' ' ; print,format=' print,format='("Time ", t40, A)', atime(time,/hxr) print,format='("Multiple plots per page", T40,i1,"x",i1)', xmulti,ymulti print,format='("Create plot file Enable/Disable", T40,A)', dable(noplotfile) addrexist = size(mailaddr) if addrexist(1) ne 0 then print,format='("Email address", T40, A)', mailaddr print,' ' print, $ 'Commands: ListMenu OrbitPlot 24HourPlot SequentialPlots HardPlot MailPlot' print, $ ' SelectDevices Help Exit' print, 'Change parameters or enter a command' ; ; Prompt for input and read response from operator. ; on_ioerror,errorinput on_error,3 read: read,inline origline = inline ; ; if input parameter is TIME, then recast the value as a hxrbs time! ; inline = batse_time_input( inline, ['TIM']) inline = strupcase( strcompress (inline, /remove_all)) ; ; Compare commands. ; cmnd = strmid(inline, 0, 3) ; if cmnd eq 'LIS' then goto,start ; if (cmnd eq 'EXI') or (cmnd eq 'QUI') or (cmnd eq 'RET') then goto,getout ; if cmnd eq 'HEL' then begin helpname = 'help_qlplot.txt' helpfile=loc_file(path=[curdir(), path_dir('batse'),'BATSE_DATA'],helpname) if helpfile ne '' then read_seqfile, morebf, helpfile else print,'Unable to find '+helpname more, morebf mailfile, helpfile endif ; if cmnd eq 'ORB' or cmnd eq '24H' then begin if noplotfile then begin print, ' ' print,'NOTE: To mail a plot to yourself or to make a hardcopy ', $ 'of this plot (via ' print,' HardPlot command), CREATE PLOT FILE must be ENABLED ', $ 'before graphing.' print, ' ' endif if cmnd eq 'ORB' then begin print, 'Press return to plot orbit containing time selected by ' + $ 'TIME parameter.' print, 'Otherwise, select orbit(s) to plot by orbit number (orbit ' + $ 'one is the first' print, 'orbit of the day; there are 15-17 orbits per day) print, ' ' fselect, orbits, ocount, what = 'orbit #''s as ' if ocount eq 0 then begin ql_plotter, time=time, orbtime=time, plotfile=not(noplotfile), $ norbits, period, midnights, days, cosines, $ xrange, yrange, seconds, arrays endif else begin for i=0,ocount-1 do begin ql_plotter, time=time, orbit=orbits(i), plotfile=not(noplotfile), $ norbits, period, midnights, days, cosines, $ xrange, yrange, seconds, arrays endfor endelse endif else begin if !p.multi(1)+!p.multi(2) gt 2 then print, $ 'Note: Multiple plots not allowed for 24 hour plot.' pmultisave=!p.multi !p.multi=0 ql_plotter, time=time, /full, plotfile=not(noplotfile), $ norbits, period, midnights, days, cosines, $ xrange, yrange, seconds, arrays !p.multi=pmultisave endelse ; if not(noplotfile) then data_plotted = 1 goto,read endif ; ;*******************************************************************; ;Big changes in the sequential plot option - now use menu, rather ;than asking a series of questions. ; if cmnd eq 'SEQ' then begin st_time=time otype=0 ptype=0 p_type=['Orbit','Full-day'] out_type=['Terminal','Terminal + Mail','Terminal + Printer',$ 'Terminal + File'] seqmenu: print,' ' print,$ '----------------------------------------------------------------------' print,' ' print,'SequentialPlot Options Menu' print,' ' print,$ '----------------------------------------------------------------------' print,' ' print, ' ' print,'Change options by entering first 3 letters of item, comma, new value.' print,'After setting options, enter one of the available commands.' print, ' ' print,format='("Start time of plot",T46,A)',atime(st_time,/hxr) print,format='("End time of plot",T46,A)',atime(end_time,/hxr) print,format='("Plot type Orbit/Full-day",T46,A)',p_type(ptype) print,format='("Outprint Terminal/Mail/Printer/File",T46,A)',out_type(otype) print,' ' print,'Commands: ListMenu SequentialPlot Exit' print,' ' print,'Change parameters or enter a command' print,' ' on_ioerror,seqerrorinput seqread: seqinline=' ' read,seqinline seqorigline = seqinline ; ; if input parameter is START or END, then recast the value as a hxrbs time! ; seqinline = batse_time_input( seqinline, ['STA','END']) seqinline = strupcase(strcompress(seqinline,/remove_all)) comnd = strmid(seqinline,0,3) if comnd eq 'LIS' then goto,seqmenu if comnd eq 'EXI' then goto,seqabort if comnd eq 'SEQ' then goto,seqplot par=strmid(seqinline,0,3) seqstrt = strpos(seqinline,',') + 1 ; case 1 of par eq 'PLO':begin if seqstrt eq 0 then goto, seqerrorinput seqstrng = strmid(seqinline,seqstrt,3) case seqstrng of 'ORB': ptype = 0 'FUL': ptype = 1 else: print,'Enter either ''orbit'' or ''full-day''. Try again.' endcase end ; par eq 'STA':begin if seqstrt eq 0 then goto, seqerrorinput st_time = strmid(seqinline,seqstrt,21) st_time=utime(st_time,error=error) if error then goto, seqerrorinput end ; par eq 'END':begin if seqstrt eq 0 then goto, seqerrorinput end_time = strmid(seqinline,seqstrt,21) end_time=utime(end_time,error=error) if error then goto, seqerrorinput end ; par eq 'OUT':begin if seqstrt eq 0 then goto, seqerrorinput seqstrng = strmid(seqinline,seqstrt,3) case seqstrng of 'TER': otype = 0 'MAI': otype = 1 'PRI': otype = 2 'FIL': otype = 3 else: print,'Enter Terminal, Mail, Printer, or File.'$ ,' Try again.' endcase end else: goto,seqerrorinput endcase ; ; if (otype eq 1) or (otype eq 1) or (otype eq 3) then begin noplotfile = 0 print, ' ' print, 'Setting CREATE PLOT FILE to ENABLE.' endif if (otype eq 3) and (!p.multi(1)+!p.multi(2) gt 2) then !p.multi=0 $ else !p.multi=[0,xmulti,ymulti] if (otype eq 1) and ((size(mailaddr))(1) eq 0) then $ fix_mailaddr, mailaddr=mailaddr ; ; seqplot: if comnd eq 'SEQ' then begin looptime = st_time pagedone = 0 data_plotted = 0 seqloop: if ptype eq 0 then begin ql_plotter, time=looptime, orbtime=looptime, plotfile=not(noplotfile), $ norbits, period, midnights, days, cosines, $ xrange, yrange, seconds, arrays, error=error if not(error) then begin data_plotted = 1 if !p.multi(0) eq 0 then pagedone = 1 endif endif else begin ql_plotter, time=looptime, /full, plotfile=not(noplotfile), $ norbits, period, midnights, days, cosines, $ xrange, yrange, seconds, arrays, error=error if not(error) then begin data_plotted = 1 pagedone = 1 endif endelse plottime = 5640. ;94 minutes = 5640 seconds is a typical orbit if (size(period))(1) ne 0 then plottime = period(0) if otype eq 3 then plottime = 86400.d0 looptime = looptime + plottime if data_plotted and (pagedone or (looptime ge end_time+plottime)) then begin if otype eq 1 then mailplot, file='qlarchive', /verify if otype eq 2 then tek_print, filename='qlarchive' if otype eq 3 then begin set_graphics, printer=hard_device if hard_device eq 'PS' then begin ; if ps plot file, close file curr_device = !d.name set_plot,'ps' device,/close set_plot,curr_device endif prfile = strlowcase (findfile ('qlarchive.'+hard_device)) print,'Plot file saved in: ',prfile(0) endif data_plotted = 0 pagedone = 0 endif ; if looptime lt end_time+plottime then goto,seqloop endif ; endloop: goto,seqmenu seqabort: print, 'Exiting SequentialPlots menu.' goto,start ; seqerrorinput: print,'Error in input. Please reenter.' goto,seqread endif ; ;End of SequentialPlot section ;*************************************************************************** ; if cmnd eq 'SEL' then begin select_dev goto,start endif ; if (cmnd eq 'HAR') or (cmnd eq 'LAS')then begin if data_plotted and not(noplotfile) then begin tek_print,filename='qlarchive' endif else begin if not(data_plotted) then print,'No data to plot' if noplotfile then print,'You didn''t create a plot file.' if noplotfile then print,'Set CREATE PLOT FILE to ENABLE before ', $ 'making plot.' endelse goto,read endif ; if cmnd eq 'MAI' then begin if data_plotted and not(noplotfile) then begin mailplot, file='qlarchive', /verify endif else begin if not(data_plotted) then print,'No data plotted' if noplotfile then print,'You didn''t create a plot file.' if noplotfile then print,'Set CREATE PLOT FILE to ENABLE before ', $ 'making plot.' endelse goto,read endif ; if cmnd eq 'DEL' then begin del_plotfile goto,read endif ; param = cmnd strt = strpos(inline, ',') + 1 case 1 of ; param eq 'TIM': begin strng = strmid(inline,strt,21) setut,utbase=strng, utstart=strng, error = error if error then begin print,'Please reenter.' goto,read endif getut,utstart=time end ; param eq 'TYP': begin strng = strmid(inline,strt,3) temp = -1 if strng eq 'ORB' then temp = 0 if strng eq 'FUL' then temp = 1 if temp eq -1 then goto,errorinput itype = temp end ; param eq 'MUL': begin s = strmid(inline, strt, 20) xpos = strpos(s, 'X') if xpos eq -1 then begin ix = fix(s) if ix ne 1 then begin print, 'Error - enter either:' print, '1 to disable multiple plots or ' print, 'm x n for m plots across, n plots down.' endif else begin xmulti = 1 ymulti = 1 !p.multi = [0,1,1] endelse endif else begin ix = fix (strtrim(strmid(s,0,xpos),2)) iy = fix (strtrim(strmid(s,xpos+1,20),2)) if (ix lt 1) or (iy lt 1) or (ix gt 9) or (iy gt 9) then goto,errorinput xmulti = ix ymulti = iy !p.multi = [0,xmulti,ymulti] endelse end ; param eq 'CRE': begin strng = strmid(inline,strt,3) temp = -1 if strng eq 'ENA' then temp = 0 if strng eq 'DIS' then temp = 1 if temp eq -1 then goto,errorinput noplotfile = temp if not noplotfile then begin cd,current=dir print, 'Plot file will be created called ' case !version.os of 'OSF' : print, dir,'/qlarchive.tek or .ps for Tektronix or PostScript' 'vms' : print, dir,'qlarchive.tek or .ps for Tektronix or PostScript' endcase endif end ; param eq 'EMA': begin mailaddr = strmid (inline, strt, 100) end ; else: begin errorinput: print,'Error in input -- please reenter.' end endcase goto,read ; getout: if old_time_format eq 'YOHKOH' then yohkoh_format end