FUNCTION HRC_VETO, startpar, endpar, PLOTX=plotx, OUTFILE=outfile ; -can supply startpar and endpar in format yyyy:doy ; to run subset of data exit_status = [1,1] if (NOT keyword_set(outfile)) then outfile="hrc_veto.gif" ; set starting and ending dates of interest if (n_params(startpar) eq 0) then begin startpar = string('1998:0') endpar = string(strmid(systime(), 20, 4) + ':366') endif if (n_params(endpar) eq 1) then $ endpar = string(strmid(systime(), 20, 4) + ':366') ttmp = fltarr(2) ttmp = strsplit(startpar,':', /extract) startpars = float(((ttmp(0) - 1998) * 31536000) + (ttmp(1) * 86400)) ttmp = fltarr(2) ttmp = strsplit(endpar,':', /extract) endpars = float(((ttmp(0) - 1998) * 31536000) + (ttmp(1) * 86400)) ; **************** plots of all data **************************** ; choose device xwidth=700 ywidth=600 if (keyword_set(plotx)) then begin set_plot, 'X' window, 0, xsize=xwidth, ysize=ywidth endif else begin set_plot, 'Z' device, set_resolution = [xwidth,ywidth] endelse !P.MULTI = [0, 1, 2, 0, 0] ; set up y margins ym = fltarr(!p.multi(2),2) ym(0,0)=2 ym(0,1)=2 ym(1,0)=4 ym(1,1)=0 chsize=1.3 loadct, 39 white = 255 bgrd = 0 red = 230 yellow = 190 blue = 100 green = 150 purple = 50 orange = 215 ;orange = 20 ;red = 140 ; if colors go nuts, try these ;yellow = 112 ;blue = 60 ;green = 80 ;purple = 40 ; hrc veto rates hi_veto=mrdfits("hI_veto.fits",1) hs_veto=mrdfits("hS_veto.fits",1) hi_veto=hi_veto(where(hi_veto.time ge startpars and hi_veto.time lt endpars)) hs_veto=hs_veto(where(hs_veto.time ge startpars and hs_veto.time lt endpars)) ymax = max([hi_veto.SHEVART_AVG,hi_veto.TLEVART_AVG,hi_veto.VLEVART_AVG, $ hs_veto.SHEVART_AVG,hs_veto.TLEVART_AVG,hs_veto.VLEVART_AVG]) xmin=min([hi_veto.time,hs_veto.time]) xmax=max([hi_veto.time,hs_veto.time]) calmin=strsplit(cxtime(xmin,'sec','cal'),"-", /extract) calmax=strsplit(cxtime(xmax,'sec','cal'),"-", /extract) titl=strcompress("HRC VETO RATES "+string(calmin(0))+string(calmin(1))+ $ " - "+string(calmax(0))+string(calmax(1))) plot, hi_veto.time, replicate(0, n_elements(hi_veto.time)), psym=3, $ xticks = 5, $ xtitle = '', ytitle = 'counts', $ title=titl, $ yrange = [1, 1.1*ymax], ystyle = 1, xstyle = 1, /ylog, $ xrange = [xmin, xmax], $ ymargin = [ym(0,0),ym(0,1)], $ xtickformat='no_axis_labels', $ charsize = chsize, charthick =1, color = white, background = bgrd, $ xminor=10 oplot, hi_veto.time, hi_veto.shevart_avg, psym=1, color = red oplot, hi_veto.time, hi_veto.tlevart_avg, psym=1, color = yellow oplot, hi_veto.time, hi_veto.vlevart_avg, psym=1, color = blue oplot, [xmin+0.53*(xmax-xmin)],[2], psym=1, color = white xout_data = convert_coord([0.99],[1.0], /normal, /to_data) xyouts, xout_data(0), ymax, 'HRC-I', alignment=1.0, $ orientation = 90, charsize=chsize plot, hs_veto.time, replicate(0, n_elements(hs_veto.time)), psym=3, $ xticks = 5, $ xtitle = 'time (DOY)', ytitle = 'counts', title = '', $ yrange = [1, 1.1*ymax], ystyle = 1, xstyle = 1, /ylog, $ xrange = [xmin, xmax], $ ymargin = [ym(1,0),ym(1,1)], $ xtickformat='s2doy_axis_labels', $ charsize = chsize, charthick =1, color = white, background = bgrd, $ xminor=10 oplot, hs_veto.time, hs_veto.shevart_avg, psym=1, color = red oplot, hs_veto.time, hs_veto.tlevart_avg, psym=1, color = yellow oplot, hs_veto.time, hs_veto.vlevart_avg, psym=1, color = blue xyouts, 0.35, 0.52, 'SHEVART', alignment = 0.5, color = red, /normal xyouts, 0.50, 0.52, 'TLEVART', alignment = 0.5, color = yellow, /normal xyouts, 0.65, 0.52, 'VLEVART', alignment = 0.5, color = blue, /normal xyouts, xout_data, ymax, 'HRC-S', alignment=1.0, $ orientation = 90, charsize=chsize ycon = convert_coord([0],[0], /device, /to_data) label_year, xmin, xmax, ycon(1), csize=chsize write_gif, outfile, tvrd() return, exit_status end