Pro dqe_analysis, testdir, infile = infile, outdir = outdir, $ plotname = plotname, suffix = suffix if (strmid(testdir, strlen(testdir)-1, 1) ne path_sep()) then begin testdir = testdir + path_sep() endif if (not keyword_set(outdir)) then begin outdir = testdir endif if (strmid(outdir, strlen(outdir)-1, 1) ne path_sep()) then begin outdir = outdir + path_sep() endif if (not keyword_set(infile)) then begin infile = 'qevals.txt' endif if (not keyword_set(suffix)) then begin suffix = '' endif sca = '' regionstr = '' temp = '' datestring = '' openr, inlun, testdir + infile, /get_lun readf, inlun, sca readf, inlun, regionstr readf, inlun, temp readf, inlun, datestring free_lun, inlun readcol, testdir + infile, lambda, qe, format='(F, F)' if (not keyword_set(plotname)) then begin plotname = 'dqe_' + sca + suffix + '.jpg' endif plottitle = 'QE vs. Wavelength for ' + sca xtitle = 'Wavelength (nm)' ytitle = 'QE (e-/photon)' black = 0 white = 255 ; set up to plot to memory buffer. This plot will later be ; written from memory to a JPEG file. set_plot, 'z' ; set plot margin & tick marks !Y.MINOR=10 !y.margin=[6,4] !x.margin=[12,12] ; set some size values !p.charsize = 8.0 !p.charthick = 15.0 !p.thick = 15.0 !x.thick = 20.0 !y.thick = 20.0 device, set_resolution=[8000, 6000] device, set_font='Courier' ; define a circular plot symbol circsym, 6, 1 ; make the plot plot, lambda, qe, title = plottitle, xtitle = xtitle, $ ytitle = ytitle, background = white, color = black, psym = -8 ; add annotations for region, date, temperature yrange = !y.crange[1] - !y.crange[0] ymax = !y.crange[1] xrange = !x.crange[1] - !x.crange[0] xmin = !x.crange[0] xloc = xmin + xrange * 0.05 yloc = ymax - ((findgen(3) + 1) * 0.03 * yrange) xyouts, xloc, yloc[0], 'Region: ' + regionstr, color = black xyouts, xloc, yloc[1], 'Detector Temperature: ' + temp, color = black xyouts, xloc, yloc[2], 'Date: ' + datestring, color = black ; add the file name in the bottom left corner xyouts, 0.05, 0.01, outdir + plotname, color = black, /normal jpgimg = tvrd() write_jpeg, outdir + plotname, $ congrid(jpgimg, 1600, 1200, /interp, /center), quality=100 device, /close end