pro s2n_plot,tot,s2n ; Read files files = dialog_pickfile(/multi,filter='*.fit') if (files[0] eq '') then return nfiles = n_elements(files) ; Declare storage tot = fltarr(nfiles) s2n = fltarr(nfiles) scr = get_screen_size() window,0,xsiz=scr[0]+100,ysiz=scr[1]+100 ; read first file for setting box img = readfits(files[0])-100 tvscl,img>100<200 box_cursor,x,y,wx,wy window,1,xsiz=wx*nfiles,ysiz=wy for i = 0, nfiles-1 do begin img = readfits(files[i],header) ped = fxpar(header,'PEDESTAL') img = img + ped texp = fxpar(header,'EXPTIME') nexp = fxpar(header,'SNAPSHOT') tot[i] = texp*(nexp>1) sample = extrac(img,x,y,wx,wy) tvscl,sample,i out = moment(sample) s2n[i] = out[0]/sqrt(out[1]) endfor s2n = s2n[sort(tot)] tot = tot[sort(tot)] return end