;************************************************************************** ; NAME : f4calibf (procedure) ; PURPOSE : convert pol.deg. to mag.strength (Gauss) ; Dopp.signal to velocity for T4 from file to file ; CALLING SEQUENCE : ; f4calibf,filenames,dwl=dwl,bmag=bmag,scatter=scatter, ; kdpfact=kdpfact,dir=dir,outfiles=outfiles,bin=bin,ver=ver ; INPUTS : ; filenames -- polari./Dopp.signal filename, usualy 'fvyymmdd.hhmm.p' ; KEYWORD PARAMETERS : ; dwl ; wavelength position (mA), default=-80 ; bmag ; magnetic field strength in Gauss, default=0 G ; scatter ; scattered light level, default=0 ; kdpfact ; correction factor for KDP error from 1/4, default=1.0 ; dir : directory ; outfiles : output file name, default= remive '.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,Vel ; header modification ; h.value => I, Vel, Bl ; h.correct => 101, 101, 101 ; h.dx => pix1*bin ; h.unit => 'm/s' 'G*10' ; h.com => 'f4calib, dwl=## bmag=## Mon dd hh:mm:ss' ; h.d_parm(10) => dwl ; h.d_parm(11) => sactter ; h.d_parm(12) => kdpfact ; h.d_parm(13) => kdpfact2 ; h.d_parm(14) => bmag ; ; MODIFICATION HISTORY : ; K.Ichimoto, 1992/10/28 ; K.Ichimoto, 1992/11/21 use new f4calib,/ver ; K.Ichimoto, 1993/01/22 pix1=pix_size('ft1') ;========================================================================== ; pro f4calibf,filenames,dwl=dwl,bmag=bmag,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 f4data,rawfiles(i),h,img,s,v,dir=dir if h(1).correct gt 100 then begin print,'This data is already calibrated...' goto,loopend endif ss=size(img) nx=ss(1) & ny=ss(2) if bin ne 1 then begin nx=nx/bin & ny=ny/bin print,'binning to ',nx,' *',ny img=rebin(img,nx,ny) s=rebin(s,nx,ny) v=rebin(v,nx,ny) h.nx=nx & h.ny=ny endif img0=img & s0=s & v0=v 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: f4calib,img,s,v,vel,bl,h=h,scatter=scatter,dwl=dwl,bmag=bmag, $ 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 " ', $ 'change bmag " ', $ '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 & s=s0 & v=v0 goto,cal1 end 4: begin read,'enter kdpfact ==> ',kdpfact img=img0 & s=s0 & v=v0 goto,cal1 end 5: begin read,'enter bmag (G) ==> ',bmag img=img0 & s=s0 & v=v0 goto,cal1 end 6: return 7: stop endcase endif print,'outfile= ',dir+outfile nkrsave,dir+outfile,h(0),img,/nocheck nkrsave,dir+outfile,h(1),vel,/append nkrsave,dir+outfile,h(2),bl,/append loopend: endfor end