pro lp12, first,last ; Procedure to make DC correction and flatfielding of images and aureolas. ; (data from La Palma 1995) ; INPUT parameters: first, last sequential numbers of the images ; in the series of La Palma 1995. ; Program edited from lp11 on 31 Oct 1995 scam='' read,'Camera a or b ?: ',scam sdate='' read,'Date (eg. 23Jun95): ',sdate st1=string('/scratch/sob/lap95/im'+scam+'/') ;Path stima='m14'+scam+'_im'+sdate+'.' ;input stdc='m14'+scam+'_dd'+sdate+'.' stff='m14'+scam+'_ff'+sdate+'.' stoa=scam+'_au'+sdate+'.' ;output stoim=scam+'_im'+sdate+'.' ;DARKS read,'How many darks will be used? : ',nnd list=intarr(nnd) read,'List of serial nos. of darks: ',list dcc=0. for i=0,nnd-1 do begin dcn=strtrim(string(list(i)),2) print,'Reading dark: ',st1+stdc+dcn dc=PREA(st1+stdc+dcn) dcc=dcc+dc(30:1339,3:1034) endfor dc=dcc/nnd ; resulting average dark print,'Statistics of average dark:' sta,dc ;FLATS read,'How many flatfields will be used? :',nnf list=intarr(nnf) read,'List of serial nos. of flatfields: ',list fff=0. for i=0,nnf-1 do begin dcn=strtrim(string(list(i)),2) print,'Reading flatfield: ',st1+stff+dcn ff=PREA(st1+stff+dcn) ff=ff(30:1339,3:1034)-dc ff=ff/mean(ff) fff=fff+ff endfor ff=fff/nnf print,'Statistics of average flatfield:' sta,ff w=where(ff eq 0, npoints) print,'Number of zero points in flatfield',npoints if (npoints ne 0) then ff(w)=0.001 ; replacing zeros siz=size(ff) tvscl,congrid(ff,siz(1)/2,siz(2)/2,/cubic) profiles,ff ;AUREOLAS print,'Shall we process aureolas? (y/n)' if get_kbrd(1) eq 'y' then begin read,'How many aureolas? : ',nna list=intarr(nna) read,'List of serial nos. of aureolas: ',list for i=0,nna-1 do begin dcn=strtrim(string(list(i)),2) print,'Reading aureola: ',st1+stff+dcn au=PREA(st1+stff+dcn) au=(au(30:1339,3:1034)-dc)/ff print,'Storing aureola: ',st1+stoa+dcn openw,1,st1+stoa+dcn writeu,1,au close,1 endfor endif ;IMAGES for i=first,last do begin dcn=strtrim(string(i),2) print,'Reading image: ',stima+dcn im=PREA(st1+stima+dcn) im=(float(im(30:1339,3:1034))-dc)/ff im=fix(im*100) ; short integers print,'Storing flatfielded image: ',stoim+dcn openw,1,st1+stoim+dcn writeu,1,im close,1 endfor end