PRO iflat,list,dd,ff ; ;Flatfielding of infrared frames. ;INPUT: list - string array with names of raw files ; dd - darkfield array (float) ; ff - flatfield array (float) ;OUTPUT: plain binary files, 224x224, integer, values multiplied by 10000, ; name 'ifXX.seq', where XX is the date and seq the frame number, ; equal to the subscript of list array (beginning from 0). ;CALLED: readfits.pro and its subroutines to read raw images, ; wherenan.pro to fix division by zero ;*****************path & name to be modified ***************** path='25jun/' name=path+'if25.' ;************************************************************* window,0,xsiz=224,ysiz=224 fd=ff-dd ;flatfield - dark si=size(list) for i=0,si(1)-1 do begin im=readfits(path+list(i)) byteorder,im im=im(6:229,6:229) ;setting working field im=(im-dd)/fd ;this is float w=wherenan(im,cn) ;when dividing by zero, if cn ne 0 then im(w)=1. ; set the result to 1 (mean value) im=im > 0.6 ;setting reasonable intensity limits im=im < 1.2 im=fix(10000*im) ;this is integer scaled to 10000 openw,1,name+strtrim(i,2) print, 'Processing ',list(i),' , writing ',name+strtrim(i,2) writeu,1,im close,1 tvscl,im endfor END