pro linter, npts,x,y,argx,argy ; binary search liner interpolation routine ; narg = number of entries in xarg and yarg tables (narg.ge.1) ; xarg = table of x arguments in any order (including random) ; yarg = interpolated value of y returned for each xarg ; npts = number of entries in x and y tables (npts.ge.2) ; x = ascending or descending table od x's (unequal d(x) permitted) ; y = input table of y's .... y(i) = f(x(i)) narg=1 xarg=fltarr(narg) yarg=fltarr(narg) xarg(0)=argx ascend = 0 if (x(0) gt x(1)) then ascend = 1 for i=0,narg-1 do begin istart = 0 iend = npts-1 if(ascend eq 1) then goto, l200 ; ; ascendinbg table of x's if(xarg(i) le x(0)) then goto, l400 if(xarg(i) ge x(npts-1)) then goto, l425 l100: index=(iend+istart)/2 if (istart eq index) then goto, l450 if (xarg(i) lt x(index)) then goto, l150 istart = index goto, l100 l150: iend = index goto, l100 ; ; decsending table of x's l200: if (xarg(i) ge x(0)) then goto, l400 if (xarg(i) le x(npts-1)) then goto, l425 l300: index = (iend+istart)/2 if (istart eq index) then goto, l450 if (xarg(i) lt x(index)) then goto, l350 iend = index goto, l300 l350: istart = index goto, l300 ; l400: yarg(i) = y(0) goto, l500 l425: yarg(i) = y(npts-1) goto, l500 l450: yarg(i) = y(index)+(xarg(i)-x(index)) * $ (y(index+1)-y(index))/(x(index+1)-x(index)) l500: endfor argy=yarg(0) return end pro qxcalc,yfq,xfq,nq ; input: nq order of q ; yfq fq/fh ; output: xfq fn/fh for resonance nq ; nq = fix(yfq) q2x = [0.6,0.7,0.8,0.9,1.0,1.1,1.3,1.5,1.6,1.8,1.9,2.02, $ 2.05,2.1,2.15,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.82,2.825] q2y = [2.0374,2.0511,2.0671,2.0855,2.1064,2.1299,2.1848, $ 2.2510,2.2886,2.3727,2.4195,2.4797,2.4955,2.5224, $ 2.5500,2.5785,2.6377,2.7000,2.7653,2.8335,2.9046, $ 2.9785,2.9936,2.9975] n2 = n_elements(q2x) q3x = [0.6,0.7,0.8,1.0,1.2,1.3,1.5,1.7,1.9,2.1,2.3, $ 2.5,2.7,2.9,3.1,3.3,3.5,3.7,3.8] q3y = [3.0180,3.0242,3.0316,3.0497,3.0725,3.0858,3.1164, $ 3.1527,3.1952,3.2445,3.3011,3.3655,3.4382,3.5194, $ 3.6091,3.7072,3.8125,3.9202,3.9736] n3 = n_elements(q3x) q4x = [0.95,1.0,1.2,1.4,1.5,1.6,1.8,2.0,2.3,2.6,2.8,3.0, $ 3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.7,4.75] q4y = [4.0262,4.0290,4.0417,4.0573,4.0662,4.0758,4.0975, $ 4.1227,4.1676,4.2221,4.2644,4.3120,4.3653,4.4247, $ 4.4901,4.5626,4.6413,4.7258,4.8151,4.9059,4.9489, $ 4.9850] n4 = n_elements(q4x) q5x = [1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.2,2.4, $ 2.6,2.8,3.0,3.4,3.8,4.2,4.4,4.7,5.0,5.3,5.6,5.7] q5y = [5.0235,5.0276,5.0322,5.0373,5.0428,5.0489,5.0554, $ 5.0624,5.0697,5.0780,5.0958,5.1160,5.1387,5.1642, $ 5.1927,5.2599,5.3426,5.4434,5.5013,5.5979,5.7046, $ 5.8226,5.9383,5.9709] n5 = n_elements(q5x) case nq of 2: begin arg = q2y val = q2x end 3: begin arg = q3y val = q3x end 4: begin arg = q4y val = q4x end 5: begin arg = q5y val = q5x end else: xfq = 0.0 endcase if (nq ge 2 and nq le 5) then begin n = n_elements(arg) ; check for range if (yfq lt arg(0)) or (yfq gt arg(n-1)) then begin xfq = 0.0 return endif ; interpolation routine nn = n yyfq = yfq linter,nn,arg,val,yyfq,xxfq xfq=xxfq endif return end pro qcalc,nq,xfh,yfh ; input: nq order of q ; xfh fn/fh ; output: fhy f/fh for resonance nq q2x = [0.6,0.7,0.8,0.9,1.0,1.1,1.3,1.5,1.6,1.8,1.9,2.02, $ 2.05,2.1,2.15,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.82,2.825] q2y = [2.0374,2.0511,2.0671,2.0855,2.1064,2.1299,2.1848, $ 2.2510,2.2886,2.3727,2.4195,2.4797,2.4955,2.5224, $ 2.5500,2.5785,2.6377,2.7000,2.7653,2.8335,2.9046, $ 2.9785,2.9936,2.9975] n2 = n_elements(q2x) q3x = [0.6,0.7,0.8,1.0,1.2,1.3,1.5,1.7,1.9,2.1,2.3, $ 2.5,2.7,2.9,3.1,3.3,3.5,3.7,3.8] q3y = [3.0180,3.0242,3.0316,3.0497,3.0725,3.0858,3.1164, $ 3.1527,3.1952,3.2445,3.3011,3.3655,3.4382,3.5194, $ 3.6091,3.7072,3.8125,3.9202,3.9736] n3 = n_elements(q3x) q4x = [0.95,1.0,1.2,1.4,1.5,1.6,1.8,2.0,2.3,2.6,2.8,3.0, $ 3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.7,4.75] q4y = [4.0262,4.0290,4.0417,4.0573,4.0662,4.0758,4.0975, $ 4.1227,4.1676,4.2221,4.2644,4.3120,4.3653,4.4247, $ 4.4901,4.5626,4.6413,4.7258,4.8151,4.9059,4.9489, $ 4.9850] n4 = n_elements(q4x) q5x = [1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.2,2.4, $ 2.6,2.8,3.0,3.4,3.8,4.2,4.4,4.7,5.0,5.3,5.6,5.7] q5y = [5.0235,5.0276,5.0322,5.0373,5.0428,5.0489,5.0554, $ 5.0624,5.0697,5.0780,5.0958,5.1160,5.1387,5.1642, $ 5.1927,5.2599,5.3426,5.4434,5.5013,5.5979,5.7046, $ 5.8226,5.9383,5.9709] n5 = n_elements(q5x) case nq of 2: begin arg = q2x val = q2y end 3: begin arg = q3x val = q3y end 4: begin arg = q4x val = q4y end 5: begin arg = q5x val = q5y end else: yfh = 0.0 endcase n = n_elements(arg) ; check for range if (xfh lt arg(0)) or (xfh gt arg(n-1)) then begin yfh = 0.0 return endif ; interpolation routine nn = n xxfh = xfh linter,nn,arg,val,xxfh,yyfh yfh=yyfh return end pro call_vlad1,fn,fh,fd,n,ii ; ; finds plasma freq fn in khz ; for input: fh gyro freq(khz) ; : n order of d-resonance ; : ii -1 for dn-, 0 for dn, +1 for dn+ ; : fd fdnii(khz) ; if ii eq 0 then begin fn=(fd/0.95)*(fd/0.95) / (n*fh) return endif if abs(ii) eq 1 then begin fdn=sqrt(fd*fd - ii*fh*fh) fn=(fdn/0.95)*(fdn/0.95) / (n*fh) return endif print,'Bad it' fn = 0.0 return end pro benson_fqfh,vfh,vfq,vn,file_res ; ; program to calc fn,fx,fz by ; inputing fh and fq ; written by Joe Fainberg 03/04/92, 08/02/94 (FORTRAN) ; modified by Gary Burgess ,code 587, 6/26/2000 (converting to IDL) ; ; openw,unit7,'FHFN.OUT',/get_lun ; c1=' ' ; read,'INPUT DATE/TIME = ',c1 ; printf,unit7,'DATE=',systime(0) ; free_lun,unit7 ;get_lun,unit7 unit7 = 7 openu,unit7,file_res tmp = fstat(unit7) point_lun,unit7, tmp.size fh = vfh fq = vfq nq = vn fqfh = fq/fh qxcalc,fqfh,fnfh,nq fn = fnfh*fh if fn eq 0.0 then return fz = fh/2. * (-1 +sqrt((1 + 4*(fn/fh)*(fn/fh)))) fx = fz + fh fuh = sqrt(fn*fn + fh*fh) fds = 0.95 * sqrt(fn*fh) print,format= $ '(" FH=",f6.3," FN=",f6.3," FN/FH=",f6.3," FX=",f6.3," FZ=",f6.3," FUH=",f6.3)', fh,fn,fn/fh,fx,fz,fuh printf,unit7,format= $ '(" FH=",f6.3," FN=",f6.3," FN/FH=",f6.3," FX=",f6.3," FZ=",f6.3," FUH=",f6.3)', fh,fn,fn/fh,fx,fz,fuh xfh = fn/fh qcalc,2,xfh,q2 q2 = q2 * fh qcalc,3,xfh,q3 q3 = q3 * fh qcalc,4,xfh,q4 q4 = q4 * fh qcalc,5,xfh,q5 q5 = q5 * fh print,format= $ '(" Q2=",f6.3," Q3=",f6.3," Q4=",f6.3," Q5=",f6.3)', q2,q3,q4,q5 printf,unit7,format= $ '(" Q2=",f6.3," Q3=",f6.3," Q4=",f6.3," Q5=",f6.3)', q2,q3,q4,q5 print,' N FDN-- FDN- FDN FDN+ FDN++', $ ' FDN-- FDN- FDN FDN+ FDN++' print,format='(47x," NORMALIZED/FH")' printf,unit7,' N FDN-- FDN- FDN FDN+ FDN++ FDN-- FDN- FDN FDN+ FDN++' printf,unit7,format='(47x," NORMALIZED/FH")' for j=1,5 do begin fdn = sqrt(float(j))*fds test = fdn*fdn - fh*fh fdl = 0.0 if test ge 0.0 then fdl = sqrt(test) test = test - fh*fh fdll = 0.0 if test ge 0.0 then fdll = sqrt(test) fdu = sqrt(fdn*fdn + fh*fh) fduu = sqrt(fdn*fdn + 2*fh*fh) print,format='(1x,i5,5f7.3,4x,5f7.3)', $ j,fdll,fdl,fdn,fdu,fduu,fdll/fh,fdl/fh,fdn/fh,fdu/fh,fduu/fh printf,unit7,format='(1x,i5,5f7.3,4x,5f7.3)', $ j,fdll,fdl,fdn,fdu,fduu,fdll/fh,fdl/fh,fdn/fh,fdu/fh,fduu/fh endfor print,' ' printf,unit7,' ' close,unit7 return end pro benson_fhfd,vfh,vfd,vn,vii,file_res ; ; program to calc fn,fx,fz, and fdn-,fdn,fdn+ by ; inputing fh and fn ; written by Joe Fainberg 03/04/92, 08/02/94 (FORTRAN) ; modified by Gary Burgess ,code 587, 6/26/2000 (converting to IDL) ; ; openw,unit7,'FHFN.OUT',/get_lun ; c1=' ' ; read,'INPUT DATE/TIME = ',c1 ; printf,unit7,'DATE=',systime(0) ; free_lun,unit7 ;get_lun,unit7 unit7 = 7 openu,unit7,file_res tmp = fstat(unit7) point_lun,unit7, tmp.size fh = vfh fd = vfd n = vn ii = vii call_vlad1,fn,fh,fd,n,ii if fn eq 0.0 then return fz = fh/2. * (-1 +sqrt((1 + 4*(fn/fh)*(fn/fh)))) fx = fz + fh fuh = sqrt(fn*fn + fh*fh) fds = 0.95 * sqrt(fn*fh) print,format= $ '(" FH=",f6.3," FN=",f6.3," FN/FH=",f6.3," FX=",f6.3," FZ=",f6.3," FUH=",f6.3)', fh,fn,fn/fh,fx,fz,fuh printf,unit7,format= $ '(" FH=",f6.3," FN=",f6.3," FN/FH=",f6.3," FX=",f6.3," FZ=",f6.3," FUH=",f6.3)', fh,fn,fn/fh,fx,fz,fuh xfh = fn/fh qcalc,2,xfh,q2 q2 = q2 * fh qcalc,3,xfh,q3 q3 = q3 * fh qcalc,4,xfh,q4 q4 = q4 * fh qcalc,5,xfh,q5 q5 = q5 * fh print,format= $ '(" Q2=",f6.3," Q3=",f6.3," Q4=",f6.3," Q5=",f6.3)', q2,q3,q4,q5 printf,unit7,format= $ '(" Q2=",f6.3," Q3=",f6.3," Q4=",f6.3," Q5=",f6.3)', q2,q3,q4,q5 print,' N FDN-- FDN- FDN FDN+ FDN++', $ ' FDN-- FDN- FDN FDN+ FDN++' print,format='(47x," NORMALIZED/FH")' printf,unit7,' N FDN-- FDN- FDN FDN+ FDN++ FDN-- FDN- FDN FDN+ FDN++' printf,unit7,format='(47x," NORMALIZED/FH")' for j=1,5 do begin fdn = sqrt(float(j))*fds test = fdn*fdn - fh*fh fdl = 0.0 if test ge 0.0 then fdl = sqrt(test) test = test - fh*fh fdll = 0.0 if test ge 0.0 then fdll = sqrt(test) fdu = sqrt(fdn*fdn + fh*fh) fduu = sqrt(fdn*fdn + 2*fh*fh) print,format='(1x,i5,5f7.3,4x,5f7.3)', $ j,fdll,fdl,fdn,fdu,fduu,fdll/fh,fdl/fh,fdn/fh,fdu/fh,fduu/fh printf,unit7,format='(1x,i5,5f7.3,4x,5f7.3)', $ j,fdll,fdl,fdn,fdu,fduu,fdll/fh,fdl/fh,fdn/fh,fdu/fh,fduu/fh endfor print,' ' printf,unit7,' ' close,unit7 return end pro benson_fhfn,vfh,vfn,file_res ; ; program to calc fn,fx,fz, and fdn-,fdn,fdn+ by ; inputing fh and fn ; written by Joe Fainberg 03/04/92, 08/02/94 (FORTRAN) ; modified by Gary Burgess ,code 587, 6/26/2000 (converting to IDL) ; ; openw,unit7,'FHFN.OUT',/get_lun ; c1=' ' ; read,'INPUT DATE/TIME = ',c1 ; printf,unit7,'DATE=',systime(0) ; free_lun,unit7 ; get_lun,unit7 unit7 = 7 openu,unit7,file_res tmp = fstat(unit7) point_lun,unit7, tmp.size ; read,'INPUT FH,FN CONTROL Z to stop, output file as FHFN.OUT : ',fh,fn ;print,fh,fn fh = vfh fn = vfn ; printf,unit7,'INPUT(FH):',fh,fn if fn eq 0.0 then return fz = fh/2. * (-1 +sqrt((1 + 4*(fn/fh)*(fn/fh)))) fx = fz + fh fuh = sqrt(fn*fn + fh*fh) fds = 0.95 * sqrt(fn*fh) print,format= $ '(" FH=",f6.3," FN=",f6.3," FN/FH=",f6.3," FX=",f6.3," FZ=",f6.3," FUH=",f6.3)', fh,fn,fn/fh,fx,fz,fuh printf,unit7,format= $ '(" FH=",f6.3," FN=",f6.3," FN/FH=",f6.3," FX=",f6.3," FZ=",f6.3," FUH=",f6.3)', fh,fn,fn/fh,fx,fz,fuh xfh = fn/fh qcalc,2,xfh,q2 q2 = q2 * fh qcalc,3,xfh,q3 q3 = q3 * fh qcalc,4,xfh,q4 q4 = q4 * fh qcalc,5,xfh,q5 q5 = q5 * fh print,format= $ '(" Q2=",f6.3," Q3=",f6.3," Q4=",f6.3," Q5=",f6.3)', q2,q3,q4,q5 printf,unit7,format= $ '(" Q2=",f6.3," Q3=",f6.3," Q4=",f6.3," Q5=",f6.3)', q2,q3,q4,q5 print,' N FDN-- FDN- FDN FDN+ FDN++', $ ' FDN-- FDN- FDN FDN+ FDN++' print,format='(47x," NORMALIZED/FH")' printf,unit7,' N FDN-- FDN- FDN FDN+ FDN++ FDN-- FDN- FDN FDN+ FDN++' printf,unit7,format='(47x," NORMALIZED/FH")' for j=1,5 do begin fdn = sqrt(float(j))*fds test = fdn*fdn - fh*fh fdl = 0.0 if test ge 0.0 then fdl = sqrt(test) test = test - fh*fh fdll = 0.0 if test ge 0.0 then fdll = sqrt(test) fdu = sqrt(fdn*fdn + fh*fh) fduu = sqrt(fdn*fdn + 2*fh*fh) print,format='(1x,i5,5f7.3,4x,5f7.3)', $ j,fdll,fdl,fdn,fdu,fduu,fdll/fh,fdl/fh,fdn/fh,fdu/fh,fduu/fh printf,unit7,format='(1x,i5,5f7.3,4x,5f7.3)', $ j,fdll,fdl,fdn,fdu,fduu,fdll/fh,fdl/fh,fdn/fh,fdu/fh,fduu/fh endfor print,' ' printf,unit7,' ' close,unit7 return end pro call_dn,vn,vfh,vfd,vii,file_res,lasttext print,format= $ '(" fd=",f6.2," fh=",f6.2," vn=",i2)',vfd,vfh,vn if vii eq -1 then $ wmap=string(format= $ '("Dn-, fd=",f6.2," fh=",f6.2," vn=",i2)',vfd,vfh,vn) if vii eq 0 then $ wmap=string(format= $ '("Dn , fd=",f6.2," fh=",f6.2," vn=",i2)',vfd,vfh,vn) if vii eq 1 then $ wmap=string(format= $ '("Dn+, fd=",f6.2," fh=",f6.2," vn=",i2)',vfd,vfh,vn) WIDGET_CONTROL,lasttext,SET_VALUE=wmap ;get_lun,unitres unitres = 8 openu,unitres,file_res tmp=fstat(unitres) point_lun,unitres,tmp.size if vii eq -1 then $ printf,unitres,'Dn- resonance n value:',vn if vii eq 0 then $ printf,unitres,'Dn resonance n value:',vn if vii eq 1 then $ printf,unitres,'Dn+ resonance n value:',vn printf,unitres,format= $ '(" fd=",f6.2," fh=",f6.2," vn=",i2)',vfd,vfh,vn close,unitres benson_fhfd,vfh,vfd,vn,vii,file_res return end pro call_qn,qn,vfh,vfq,file_res,lasttext fqfh = vfq/vfh vn = qn print,format= $ '(" fq=",f6.2," fh=",f6.2," vn=",i2," fq/fh=",f6.2)', $ vfq,vfh,vn,fqfh wmap=string(format= $ '("Qn, fq=",f6.2," fh=",f6.2," vn=",i2," fq/fh=",f6.2)', $ vfq,vfh,vn,fqfh) WIDGET_CONTROL,lasttext,SET_VALUE=wmap ;get_lun,unitres unitres = 8 openu,unitres,file_res tmp=fstat(unitres) point_lun,unitres,tmp.size printf,unitres,'Qn resonance n value:',vn printf,unitres,format= $ '(" fq=",f6.2," fh=",f6.2," vn=",i2," fq/fh=",f6.2)', $ vfq,vfh,vn,fqfh close,unitres benson_fqfh,vfh,vfq,vn,file_res return end pro checkfile,state,file_res widget_control,state.res.outfile,get_value=file_res state.res.resfile = file_res on_ioerror,eod ;get_lun,unitres unitres = 8 openu,unitres,file_res goto, jump eod: print,' Output to ',file_res openw,unitres,file_res printf,unitres,'*******************************' printf,unitres,'DATE=',systime(0) printf,unitres,'FILE=',file_res printf,unitres,'*******************************' jump: close,unitres return end pro rescutoff_eh,event widget_control,event.id,get_uvalue=uval widget_control,event.top,get_uvalue=state @catch_error case uval of 'newres' : begin widget_control,state.res.outfile,get_value=file_res print,'New File: ',file_res on_ioerror,eod ; get_lun,unitres unitres = 8 openu,unitres,file_res close,unitres spawn,'rm -f ' + file_res eod: end 'zcutoff' : begin print,'Z cutoff' clk_freq_iono = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vfn = sqrt(clk_freq_iono*(clk_freq_iono + vfh)) fz = clk_freq_iono ft = sqrt(vfh*vfh + vfn*vfn) fx = (vfh + sqrt(vfh*vfh + 4*vfn*vfn))/2.0 print,format= $ '(" fz=",f6.2," fh=",f6.2," fn=",f6.2," ft=",f6.2," fx=",f6.2)', $ fz,vfh,vfn,ft,fx line=string(format= $ '("fz=",f6.2," fh=",f6.2," fn=",f6.2," ft=",f6.2," fx=",f6.2)', $ fz,vfh,vfn,ft,fx) WIDGET_CONTROL,state.lasttext,SET_VALUE=line checkfile,state,file_res unitres = 8 openu,unitres,file_res ;,/get_lun tmp=fstat(unitres) point_lun,unitres,tmp.size printf,unitres,'Z cutoff' printf,unitres,format= $ '(" fz=",f6.2," fh=",f6.2," fn=",f6.2," ft=",f6.2," fx=",f6.2)', $ fz,vfh,vfn,ft,fx close,unitres benson_fhfn,vfh,vfn,file_res end 'nelectron' : begin print,'N electron plasma' clk_freq_iono = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vfn = clk_freq_iono fx = (vfh + sqrt(vfh*vfh + 4*vfn*vfn))/2.0 fz = (-vfh + sqrt(vfh*vfh + 4*vfn*vfn))/2.0 ft = sqrt(vfh*vfh + vfn*vfn) print,format= $ '(" fn=",f6.2," fh=",f6.2," ft=",f6.2," fz=",f6.2," fx=",f6.2)', $ vfn,vfh,ft,fz,fx line=string(format= $ '("fn=",f6.2," fh=",f6.2," ft=",f6.2," fz=",f6.2," fx=",f6.2)', $ vfn,vfh,ft,fz,fx) WIDGET_CONTROL,state.lasttext,SET_VALUE=line checkfile,state,file_res unitres = 8 openu,unitres,file_res ;,/get_lun tmp=fstat(unitres) point_lun,unitres,tmp.size printf,unitres,'N electron plasma' printf,unitres,format= $ '(" fn=",f6.2," fh=",f6.2," ft=",f6.2," fz=",f6.2," fx=",f6.2)', $ vfn,vfh,ft,fz,fx close,unitres benson_fhfn,vfh,vfn,file_res end 'tupper' : begin print,'T upper-hybrid' clk_freq_iono = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vfn = sqrt(clk_freq_iono*clk_freq_iono - vfh*vfh) ft = clk_freq_iono fz = (-vfh + sqrt(vfh*vfh + 4*vfn*vfn))/2.0 fx = (vfh + sqrt(vfh*vfh + 4*vfn*vfn))/2.0 print,format= $ '(" ft=",f6.2," fh=",f6.2," fn=",f6.2," fz=",f6.2," fx=",f6.2)', $ ft,vfh,vfn,fz,fx line=string(format= $ '("ft=",f6.2," fh=",f6.2," fn=",f6.2," fz=",f6.2," fx=",f6.2)', $ ft,vfh,vfn,fz,fx) WIDGET_CONTROL,state.lasttext,SET_VALUE=line checkfile,state,file_res unitres = 8 openu,unitres,file_res ;,/get_lun tmp=fstat(unitres) point_lun,unitres,tmp.size printf,unitres,'T upper-hybrid' printf,unitres,format= $ '(" ft=",f6.2," fh=",f6.2," fn=",f6.2," fz=",f6.2," fx=",f6.2)', $ ft,vfh,vfn,fz,fx close,unitres benson_fhfn,vfh,vfn,file_res end 'xcutoff' : begin print,'X cutoff' clk_freq_iono = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vfn = sqrt(clk_freq_iono*(clk_freq_iono - vfh)) fx = clk_freq_iono fz = (-vfh + sqrt(vfh*vfh + 4*vfn*vfn))/2.0 ft = sqrt(vfh*vfh + vfn*vfn) print,format= $ '(" fx=",f6.2," fh=",f6.2," fn=",f6.2," ft=",f6.2," fz=",f6.2)', $ fx,vfh,vfn,ft,fz line=string(format= $ '("fx=",f6.2," fh=",f6.2," fn=",f6.2," ft=",f6.2," fz=",f6.2)', $ fx,vfh,vfn,ft,fz) WIDGET_CONTROL,state.lasttext,SET_VALUE=line checkfile,state,file_res unitres = 8 openu,unitres,file_res ;,/get_lun tmp=fstat(unitres) point_lun,unitres,tmp.size printf,unitres,'X cutoff' printf,unitres,format= $ '(" fx=",f6.2," fh=",f6.2," fn=",f6.2," ft=",f6.2," fz=",f6.2)', $ fx,vfh,vfn,ft,fz close,unitres benson_fhfn,vfh,vfn,file_res end 'd1+res' : begin vn = 1 print,'Dn+ resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = +1 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd2+res' : begin vn = 2 print,'Dn+ resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = +1 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd3+res' : begin vn = 3 print,'Dn+ resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = +1 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd4+res' : begin vn = 4 print,'Dn+ resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = +1 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd5+res' : begin vn = 5 print,'Dn+ resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = +1 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd1res' : begin vn = 1 print,'Dn resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = 0 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd2res' : begin vn = 2 print,'Dn resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = 0 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd3res' : begin vn = 3 print,'Dn resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = 0 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd4res' : begin vn = 4 print,'Dn resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = 0 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd5res' : begin vn = 5 print,'Dn resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = 0 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd1-res' : begin vn = 1 print,'Dn- resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = -1 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd2-res' : begin vn = 2 print,'Dn- resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = -1 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd3-res' : begin vn = 3 print,'Dn- resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = -1 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd4-res' : begin vn = 4 print,'Dn- resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = -1 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'd5-res' : begin vn = 5 print,'Dn- resonance n value:',vn vfd = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh vii = -1 checkfile,state,file_res call_dn,vn,vfh,vfd,vii,file_res,state.lasttext end 'q2res' : begin qn = 2 print,'Qn resonance n value:',qn vfq = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh checkfile,state,file_res call_qn,qn,vfh,vfq,file_res,state.lasttext end 'q3res' : begin qn = 3 print,'Qn resonance n value:',qn vfq = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh checkfile,state,file_res call_qn,qn,vfh,vfq,file_res,state.lasttext end 'q4res' : begin qn = 4 print,'Qn resonance n value:',qn vfq = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh checkfile,state,file_res call_qn,qn,vfh,vfq,file_res,state.lasttext end 'q5res' : begin qn = 5 print,'Qn resonance n value:',qn vfq = state.res.freqclick ;vfh = state.res.fhclick widget_control,state.res.outclick(1),get_value=getfh vfh = getfh checkfile,state,file_res call_qn,qn,vfh,vfq,file_res,state.lasttext end 'fhmodel' : begin ; widget_control,state.res.outclick(2),set_button=1 widget_control,state.res.outclick(4),set_button=0 widget_control,state.res.outclick(3),get_value=getfh widget_control,state.res.outclick(1),set_value=getfh widget_control,state.res.outclick(5),set_value=0.0 state.res.setbutton_fh = 1 end 'fhinput' : begin widget_control,state.res.outclick(2),set_button=0 ; widget_control,state.res.outclick(4),set_button=1 widget_control,state.res.outclick(5),get_value=getfh widget_control,state.res.outclick(1),set_value=getfh state.res.setbutton_fh = 2 end 'fhenter' : begin if state.res.setbutton_fh eq 2 then begin widget_control,state.res.outclick(5),get_value=getfh widget_control,state.res.outclick(1),set_value=getfh endif end else : endcase if(widget_info(event.top,/valid)) then $ widget_control,event.top,set_uvalue=state return end