pro uservalues common USER_BLOCK,qval,thresh,smoothie,tolerance,resn,rando,masking,$ filename_a,filename_b common GUI_BLOCK hold={cw_pdmenu_s,flags:0,name:' '} top=widget_base(/column,title='SCF Parameters',xoffset=250,yoffset=250) qval=cw_field(top,title='Velocity Window Half-Size (in FWHMs): ',$ value=outputs.qval) thresh=cw_field(top,title=$ 'Threshold Signal to Noise:', value=outputs.s2n) middlebase=widget_base(top,/row) smoothie=widget_text(middlebase,value=$ 'Smooth to threshold signal to noise? '+outputs.smooth) switch=widget_button(middlebase,value='Switch',uvalue=1) tolerance=cw_field(top,title='Smoothing Error Tolerence (%):',$ value=outputs.toler) resn=cw_field(top,title='Size of Resolution box:',value=outputs.resn) middlebase2=widget_base(top,/row) rando=widget_text(middlebase2,value=$ 'Randomize map and reprocess? '+outputs.rando) switch2=widget_button(middlebase2,value='Switch',uvalue=3) middlebase3=widget_base(top,/row) masking=widget_text(middlebase3,value=$ 'Masking: '+mval) switch3=widget_button(middlebase3,value='Switch',uvalue=4) filename_a=cw_field(top,title='SCF Data File Name:',$ value=outfilenorm) filename_b=cw_field(top,title='Randomized Data File Name:',$ value=outfilerand) ; choices=widget_button(top,value=$ ; 'Choose which SCF Functions to Calculate...',uvalue=5) okay=widget_button(top,value='OK',uvalue=2) widget_control,/realize,top xmanager, 'uservalues', top end ;------------------------------------------------- pro uservalues_event, event @varld.cb common USER_BLOCK common GUI_BLOCK widget_control, event.id, get_uvalue=buttonpress if (buttonpress eq 2) then begin widget_control,qval,get_value=qhold outputs.qval=float(qhold(0)) widget_control,thresh,get_value=s2nhold outputs.s2n=float(s2nhold(0)) widget_control,tolerance,get_value=tolhold outputs.toler=float(tolhold(0)) widget_control,resn,get_value=resnhold outputs.resn=float(resnhold(0)) widget_control,filename_a,get_value=n1 outfilenorm=n1(0) widget_control,filename_b,get_value=n2 outfilerand=n2(0) widget_control,event.top,/destroy q=outputs.qval s2n=outputs.s2n if outputs.smooth eq 'Yes' then flag2=1 else flag2=0 tol=float(outputs.toler)/100. res=outputs.resn if outputs.rando eq 'Yes' then flag3=1 else flag3=0 if (mval eq 'Circular') then begin mask=fltarr(res,res) A=(findgen(res)-(res-1)/2)#replicate(1,res) B=transpose(A) mask=sqrt(A^2+B^2) mask=(mask le (res-1)/2) endif else begin if (mval eq 'Square') then mask=replicate(1.,res,res) if (mval eq 'Custom') then mask=maskfunc(res) endelse return endif if (buttonpress eq 1) then begin if (outputs.smooth eq 'Yes') then outputs.smooth='No'$ else outputs.smooth='Yes' widget_control,smoothie,set_value=$ 'Smooth to threshold signal to noise? '+outputs.smooth endif if (buttonpress eq 3) then begin if (outputs.rando eq 'Yes') then outputs.rando='No'$ else outputs.rando='Yes' widget_control,rando,set_value=$ 'Randomize map and reprocess? '+outputs.rando endif if (buttonpress eq 4) then begin if (mval eq 'Custom') then mval='Circular'$ else if (mval eq 'Square') then mval='Custom'$ else if (mval eq 'Circular') then mval='Square' widget_control,masking,set_value= 'Masking: '+mval endif ;if (buttonpress eq 5) then begin ; chooser ;endif end