lfilenm='eclipse4' lfilenm='opallist_SML+eclipse' close,13 & openr,13,lfilenm filenm =' ' xsz=2034 & ysz=2034 & ovxsz = 1. / float(xsz) ybeg = 100 yend = 2033-100 ylen = 1+(yend-ybeg) ovy = 1. / float(ylen) row_avg = fltarr(ylen) row_avg(*) = 0. while ( not eof(13) ) do begin ;{ readf,13,filenm img = readfits(filenm,hdr, SILENT=1) xsz = fix (sxpar (hdr , 'NAXIS1' )) ysz = fix (sxpar (hdr , 'NAXIS2' )) expt = float(sxpar (hdr , 'SHUTTER')) lcvrv = fix (sxpar (hdr , 'LCVR-V' )) lcvrt = float(sxpar (hdr , 'LCVR-T' )) print, filenm , expt ;; Reverse byte order to convert from DOS land to UNIX land. byteorder,img ;; Convert the signed integers to unsigned integers. fimg = float(img) fimg = (fimg lt 0.) * ( fimg + 2.*32768. ) + (fimg ge 0.)*(fimg) bias_bb = -0.00951220 bias_bb = -0.00953071 ;;; From ck_bias_method.pro bias_bb = -0.00962224 ;;; From ck_bias_method.pro avg of columns 0:4 ;; Use a column (y-row) at x=4 , avoiding edge effects, ;; to see what the total image bias is. bias_line = fimg(4,ybeg:yend) bias_line(*)=0. numi=0. for jj=0,4 do begin ;{ bias_line = bias_line + fimg(jj,ybeg:yend) numi = numi + 1. endfor ;} print,numi bias_line = bias_line / numi ;; Get the row_avg for jj=0,ylen-1 do begin;{ kk=jj+ybeg-1 row_avg(jj) = total(fimg(*,kk)) * ovxsz endfor ;} xx = row_avg yy = bias_line bias_aa = total ( yy - xx*bias_bb ) / (float(n_elements(bias_line))) bias_fit = xx*bias_bb + bias_aa !p.multi=[0,1,3] plot,[0,2033],[0,50000],title=filenm,psym=2,/nodata,/ynoz oplot,fimg(720,ybeg:yend) ,psym=1 plot,[0,2034],[2000,3400],title=filenm,psym=2,/nodata,/ynoz oplot,yy,psym=2 plot,[0,2034],[-200,200],title=filenm,psym=2,/nodata,/ynoz oplot,yy - bias_fit,psym=2 !p.multi=[0,1,1] wset,0 & cursor,x,y,/NORMAL endwhile ;} close,13 end