;************************************************************************** ; NAME : f1calibf (procedure) ; PURPOSE : convert pol.deg. to mag.strength (Gauss) for T1 ; from file to file ; CALLING SEQUENCE : ; f1calibf,filenames,dwl=dwl,scatter=scatter,kdpfact=kdpfact, ; dir=dir,outfiles=outfiles,bin=bin,ver=ver ; INPUTS : ; filenames -- polarization filename, usualy 'fbyymmdd.hhmm.p' ; KEYWORD PARAMETERS : ; dwl ; wavelength position (mA), default=-80 ; scatter ; sacttered light intensity ; if not set, scatter=imin (imin/imax < 0.17, limb image) ; =imax*0.1 ( > 0.17, disk image) ; kdpfact ; correction factor for KDP error from 1/4, default=1.0 ; dir : directory ; outfiles : output file name, default= remove '.p' ; bin : binning factor, default=1 ; ver : confirm the result before saving it ; ; OUTPUTS : ; none ; SIDE EFFECTS : ; new file is created which containes the calibrated data img,Bl,Bx,By ; header modification ; h.value => I, Bx, By, Bl ; h.correct => 101, 101, 101, 101 ; h.dx => pix1*bin ; h.unit => 'G*10' ; h.com => 'f1calib1, dwl=## Mon dd hh:mm:ss' ; h.d_parm(10) => dwl ; h.d_parm(11) => sactter ; h.d_parm(12) => kdpfact ; ; MODIFICATION HISTORY : ; K.Ichimoto, 1992/10/24 ; K.Ichimoto, 1992/11/21 use new f1calib, /ver ; K.Ichimoto, 1993/01/22 pix1=pix_size('ft1') ;========================================================================== ; pro f1calibf,filenames,dwl=dwl,scatter=scatter,kdpfact=kdpfact, $ dir=dir,outfiles=outfiles,bin=bin,ver=ver ;pix1=0.6738 ; arc sec. for 1 pixel pix1=pix_size('ft1') ; arc sec. for 1 pixel if keyword_set(dir) then dir=dir else dir='' if keyword_set(bin) then bin=fix(bin) else bin=1 rawfiles=filenames nn=n_elements(rawfiles) for i=0,nn-1 do begin f1data,rawfiles(i),h,img,q,u,v,dir=dir if h(1).correct gt 100 then begin print,'This data is already calibrated...' goto,loopend endif s=size(img) nx=s(1) & ny=s(2) if bin ne 1 then begin nx=nx/bin & ny=ny/bin print,'binning to ',nx,' *',ny img=rebin(img,nx,ny) q=rebin(q,nx,ny) u=rebin(u,nx,ny) v=rebin(v,nx,ny) h.nx=nx & h.ny=ny endif img0=img & v0=v & q0=q & u0=u h.dx=string(pix1*bin,format='(f6.4)') h.dy=string(pix1*bin,format='(f6.4)') if keyword_set(outfiles) then outfile=outfiles(i) else $ outfile=strmid(rawfiles(i),0,strlen(rawfiles(i))-2) cal1: f1calib,img,q,u,v,bx,by,bl,h=h,scatter=scatter,dwl=dwl,kdpfact=kdpfact if keyword_set(ver) then begin ans='' magtv2,img,bx,by,bl,h=h,bin=bin,mag=bin menustr=['f1calib: verbose menu', $ 'OK, save this data', $ 'change dwl and try again', $ 'change scatter " ', $ 'change kdpfact " ', $ 'return', $ 'stop here'] choice=wmenu(menustr,title=0,init=1) case choice of 1: 2: begin read,'enter dwl (mA) ==> ',dwl img=img0 & v=v0 & q=q0 & u=u0 goto,cal1 end 3: begin read,'enter scatter ==> ',scatter img=img0 & v=v0 & q=q0 & u=u0 goto,cal1 end 4: begin read,'enter kdpfact ==> ',kdpfact img=img0 & v=v0 & q=q0 & u=u0 goto,cal1 end 5: return 6: stop endcase endif print,'outfile= ',dir+outfile nkrsave,dir+outfile,h(0),img,/nocheck nkrsave,dir+outfile,h(1),bx,/append nkrsave,dir+outfile,h(2),by,/append nkrsave,dir+outfile,h(3),bl,/append loopend: endfor end