;; lfilenm='opallist_L' & fileout='OPALS/opal_L' & Iopal = 8.00e-8 ; 5C ;; David (May 18,2000) thinks the 8.00e-8 is in error, and ;; should be replaced with 8.28e-8. ;; lfilenm='opallist_L' & fileout='OPALS/opal_L' & Iopal = 8.28e-8 ; 5C ;; lfilenm='opallist_M' & fileout='OPALS/opal_M' & Iopal = 7.76e-7 ; 5B ;; lfilenm='opallist_S' & fileout='OPALS/opal_S' & Iopal = 7.76e-7 ; 5B close,13 & openr,13,lfilenm filenm =' ' xsz=2034 & ysz=2034 if(n_elements(opal_img) eq 0 ) then begin ;{ opal_img = fltarr(xsz,ysz) row_avg = fltarr(ysz) bias_img = fltarr(xsz,ysz) endif ;} opal_img(*,*) = 0.0 ovxsz = 1. / float(xsz) ii=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' )) date = float(strmid(filenm,3,6)) if(date eq 980225.) then begin ;{ odir = '/wikiwiki/f/cordyn/Data/Eclipse/POISE/opals/OPALS/Feb25/' endif ;} if(date eq 980226.) then begin ;{ odir = '/wikiwiki/f/cordyn/Data/Eclipse/POISE/opals/OPALS/Feb26/' endif ;} if ( expt eq 0.25 ) then Ex = 's' if ( expt eq 1.00 ) then Ex = 'm' if ( expt eq 4.00 ) then Ex = 'l' if ( lcvrv eq 1770 ) then Po = '1' if ( lcvrv eq 2210 ) then Po = '2' if ( lcvrv eq 2840 ) then Po = '3' if ( lcvrv eq 4450 ) then Po = '4' filenm_out = odir+'Opal_'+Ex+'p'+Po print,' ' print, filenm , expt , lcvrv print, filenm_out print,' ' ;; Reverse byte order to convert from DOS land to UNIX land. byteorder,img ;; Convert the signed integers to unsigned integers. imgL = float(img) imgL = (imgL lt 0.) * ( imgL + 2.*32768. ) + (imgL ge 0.)*(imgL) ;; Compute CCD offset. ;; do_oldway=0 if ( do_oldway eq 1 ) then begin ;{ ;; There is an offset in the CCD that is approximately the ;; average of the row's intensity / 100. This needs to be ;; removed after the bias removal. ;; David computed the average based on the "jj+1" row, ;; not the jj'th row -- an error?? for jj=0,ysz-2 do begin ;; row_avg(jj)=total(imgL(*,jj+1)) * ovxsz ;; David's way row_avg(jj)=total(imgL(*,jj )) * ovxsz ;; Alice's way bias_img(*,jj)=row_avg(jj) endfor ;; Use a column --> column (y-row) at x=4 , avoiding edge effects. bias_line = imgL(4,0+100:2033-100) bias = total(bias_line) / (float(n_elements(bias_line))) imgL = imgL - bias imgL = imgL + bias_img * 0.01 endif else begin ;}{ ;; New as of June 1, 2000 ybeg = 100 & yend = 2033-100 ybeg = 80 & yend = 2033- 80 bias_bb = -0.00953071 ;;; From ck_bias_method.pro bias_bb = -0.00962224 ;;; From ck_bias_method.pro avg of columns 0:4 ;; Get the row_bias = bias_bb * row_avg row_avg(*) = 0. for jj=1,ysz-1 do begin;{ row_avg(jj) = total(imgL(*,jj-1)) * ovxsz endfor ;} ;; Sample the "bias" column (y-row) at x=4 , avoiding edge effects. ;; This is tainted by the "row_bias" = bias_bb*row_avg ;; which will be removed below... bias_line = imgL(4, ybeg:yend) bias_line(*)=0. numi=0. for jj=0,4 do begin ;{ ;; Do an avg over the 1st 5 comlums bias_line = bias_line + imgL(jj,ybeg:yend) numi = numi + 1. endfor ;} bias_line = bias_line / numi xx = row_avg(ybeg:yend) yy = bias_line bias_aa = total ( yy - xx*bias_bb ) / (float(n_elements(bias_line))) ;; Then create the bias_img for jj=1,ysz-1 do begin;{ bias_img(*,jj) = row_avg(jj)*bias_bb + bias_aa endfor ;} imgL = imgL - bias_img endelse ;} opal_img = imgL opal_img = Iopal / opal_img openw,1,filenm_out & writeu,1,opal_img & close,1 endwhile ;} close,13 end