Ignore:
Timestamp:
Sep 18, 2019 2:31:55 PM (3 years ago)
Author:
krzywon
Message:

Combine elliptical averaging with circular averaging and wrote the binning routine. Need to verify calculations and fix issues with elliptical drawing routine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/branches/elliptical_averaging/NCNR_User_Procedures/Reduction/SANS/AvgGraphics.ipf

    r1208 r1212  
    3232        //ok, create the globals, fill the keyword string with all possible values (default) 
    3333        String/G root:myGlobals:Drawing:gDrawInfoStr = "AVTYPE=Circular;PHI=0;DPHI=0;WIDTH=0;SIDE=both;" 
    34                 root:myGlobals:Drawing:gDrawInfoStr += "QCENTER=0;QDELTA=0;" 
     34                root:myGlobals:Drawing:gDrawInfoStr += "QCENTER=0;QDELTA=0;RATIOAXES=1;" 
    3535        Variable/G root:myGlobals:Drawing:gDrawPhi =0 
    3636        Variable/G root:myGlobals:Drawing:gDrawWidth = 1 
     
    133133                        break 
    134134                case "Elliptical": 
    135                         EllipticalAverageTo1D(type) 
    136                         break 
    137135                case "Circular": 
    138136                case "Sector": 
    139                         //circular or sector 
     137                        //circular, elliptical, or sector 
    140138                        CircularAverageTo1D(type)               //graph is drawn here 
    141139                        break 
     
    309307                        SetVariable width_p,disable=yes 
    310308                        SetVariable RAxes_p,disable=no 
    311                         popupmenu sides,disable=no 
     309                        popupmenu sides,disable=yes 
    312310                        break 
    313311                default:                                                        // optional default expression executed 
     
    350348        SetVariable DPhi_p,help={"Enter the +/- range (0,45) of azimuthal angles to be included in the average.  The bounding angles will be drawin in blue."} 
    351349        SetVariable DPhi_p,limits={0,90,1},value= root:myGlobals:Drawing:gDrawDPhi 
    352         SetVariable RAxes_p,pos={166,176},size={110,15},proc=DeltaPhiSetVarProc,title="Axis Ratio" 
     350        SetVariable RAxes_p,pos={166,176},size={110,15},proc=AxisRatioSetVarProc,title="Axis Ratio" 
    353351        SetVariable RAxes_p,help={"Enter the ratio of the minor to major axes for an isointensity contour.  By definition, this value should be less than 1."} 
    354352        SetVariable RAxes_p,limits={0,1,0.001},value= root:myGlobals:Drawing:gDrawRAxes 
     
    491489                variable RAxes = NumberByKey("RATIOAXES",drawStr,"=",";") 
    492490                 
     491                rr=0 
     492                gg=50000 
     493                bb=0 
     494                 
    493495                Make/O/N=(128,128) ellipsewave 
    494496                variable b = 64 
    495497                variable a = RAxes * b 
    496                 DrawAnEllipsoid("ellipsewave",x0,y0,a,b,phi) 
     498                DrawAnEllipsoid("ellipsewave",x0,y0,a,b,phi,rr,gg,bb) 
    497499          
    498500                Return 0                //exit the Draw routine 
     
    826828// OUTPUTS: 
    827829//   make all changes directly in xywave 
    828 Function DrawAnEllipsoid(wname,xo,yo,a,b,phi) 
     830Function DrawAnEllipsoid(wname,xo,yo,a,b,phi,rr,gg,bb) 
    829831    string wname 
    830     variable xo,yo,a,b,phi 
     832    variable xo,yo,a,b,phi,rr,gg,bb 
    831833    int ii 
    832834 
    833835    wave xywave = $wname 
    834836     
    835     make/FREE/n=361 urx,ury 
    836     make/n=361 xw,yw = 0 
     837    make/O/FREE/N=361 urx,ury 
     838    make/O/N=361 xw,yw = 0 
    837839    
    838840    variable cosalpha = cos(phi*Pi/180), sinalpha = sin(phi*Pi/180) 
     
    848850    xywave[xw,yw] = 1 
    849851     
    850     rr=0 
    851     gg=50000 
    852     bb=0 
    853      
    854852         //SetDrawEnv/W=SANS_Data xcoord= bottom,ycoord= left,linefgc= (rr,gg,bb),linethick= (thick),fillpat=0 
    855853         //AppendImage/W=SANS_Data ellipsewave 
     
    944942        ControlInfo/W=Average_Panel RAxes_p 
    945943        Variable val = V_Value 
    946         SVAR tempStr = root:myGlobals:Drawing:gDrawRAxes 
     944        SVAR tempStr = root:myGlobals:Drawing:gDrawInfoStr 
    947945        String newStr = ReplaceNumberByKey("RATIOAXES", tempStr, val, "=", ";") 
    948946         
    949         String/G root:myGlobals:Drawing:gDrawRAxes = newStr 
     947        String/G root:myGlobals:Drawing:gDrawInfoStr = newStr 
    950948         
    951949        //redraw the angles 
Note: See TracChangeset for help on using the changeset viewer.