Changeset 1214


Ignore:
Timestamp:
Sep 24, 2019 11:16:36 AM (3 years ago)
Author:
krzywon
Message:

Separate averaging specific parameters from protocol panel to overcome input limit for macros.

File:
1 edited

Legend:

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

    r1213 r1214  
    966966// somewhat confusing and complex, but may be as good as it gets. 
    967967// 
    968 Proc GetAvgInfo(av_typ,autoSave,autoName,autoPlot,side,phi,dphi,width,QCtr,QDelta) 
    969         String av_typ,autoSave,AutoName,autoPlot,side 
    970         Variable phi=0,dphi=10,width=10,Qctr = 0.01,qDelta=10 
    971         Prompt av_typ, "Type of Average",popup,"Circular;Sector;Rectangular;Annular;Elliptical;2D_NXcanSAS;2D_ASCII;QxQy_ASCII;PNG_Graphic;Sector_PlusMinus;" 
     968Proc GetAvgInfo(av_typ,autoSave,autoName,autoPlot) 
     969        String av_typ,autoSave,AutoName,autoPlot 
     970        Prompt av_typ, "Type of Average - A 2nd window will open for averaging specific parameters",popup,"Circular;Sector;Rectangular;Annular;Elliptical;2D_NXcanSAS;2D_ASCII;QxQy_ASCII;PNG_Graphic;Sector_PlusMinus;" 
    972971// comment out above line in DEMO_MODIFIED version, and uncomment the line below (to disable PNG save) 
    973972//      Prompt av_typ, "Type of Average",popup,"Circular;Sector;Rectangular;Annular;2D_ASCII;QxQy_ASCII" 
     
    975974        Prompt autoName,"Auto-Name files?",popup,"Auto;Manual" 
    976975        Prompt autoPlot,"Plot the averaged Data?",popup,"Yes;No" 
    977         Prompt side,"Include detector halves?",popup,"both;right;left" 
    978         Prompt phi,"Orientation Angle (-90,90) degrees (Rectangular, Elliptical, or Sector)" 
    979         Prompt dphi, "Azimuthal range (0,45) degrees (Sector only)" 
    980         Prompt width, "Width of Rectangular average (1,128)" 
    981         Prompt Qctr, "q-value of center of annulus -OR- Ratio of minor to major axes of ellipse" 
    982         Prompt Qdelta,"Pixel width of annulus" 
    983  
     976 
     977        Print "TESTING" 
    984978        //assign results of dialog to key=value string, semicolon separated 
    985979        //do only what is necessary, based on av_typ 
     
    993987         
    994988        if(cmpstr(av_typ,"Sector")==0 || cmpstr(av_typ,"Sector_PlusMinus")==0) 
    995                 root:myGlobals:Protocols:gAvgInfoStr += "SIDE=" + side + ";" 
    996                 root:myGlobals:Protocols:gAvgInfoStr += "PHI=" + num2str(phi) + ";" 
    997                 root:myGlobals:Protocols:gAvgInfoStr += "DPHI=" + num2str(dphi) + ";" 
     989                Execute "GetSectorAvgInfo()" 
    998990        Endif 
    999991         
    1000992        if(cmpstr(av_typ,"Rectangular")==0) 
    1001                 root:myGlobals:Protocols:gAvgInfoStr += "SIDE=" + side + ";" 
    1002                 root:myGlobals:Protocols:gAvgInfoStr += "PHI=" + num2str(phi) + ";" 
    1003                 root:myGlobals:Protocols:gAvgInfoStr += "WIDTH=" + num2str(width) + ";" 
     993                Execute "GetRectangularAvgInfo()" 
    1004994        Endif 
    1005995         
    1006996        if(cmpstr(av_typ,"Annular")==0) 
    1007                 root:myGlobals:Protocols:gAvgInfoStr += "QCENTER=" + num2str(QCtr) + ";" 
    1008                 root:myGlobals:Protocols:gAvgInfoStr += "QDELTA=" + num2str(QDelta) + ";" 
     997                Execute "GetAnnularAvgInfo()" 
    1009998        Endif 
    1010999         
     
    10121001                Execute "GetEllipticalAvgInfo()" 
    10131002        Endif 
     1003End 
     1004 
     1005Proc GetSectorAvgInfo(side,phi,width) 
     1006        String side 
     1007        Variable phi=0,dphi=10 
     1008        Prompt side,"Include detector halves?",popup,"both;right;left" 
     1009        Prompt phi,"Orientation Angle (-90,90) degrees (Rectangular, Elliptical, or Sector)" 
     1010        Prompt dphi, "Azimuthal range (0,45) degrees (Sector only)" 
     1011         
     1012        root:myGlobals:Protocols:gAvgInfoStr += "SIDE=" + side + ";" 
     1013        root:myGlobals:Protocols:gAvgInfoStr += "PHI=" + num2str(phi) + ";" 
     1014        root:myGlobals:Protocols:gAvgInfoStr += "DPHI=" + num2str(dphi) + ";" 
     1015End 
     1016 
     1017Proc GetRectangularAvgInfo(side,phi,width) 
     1018        String side 
     1019        Variable phi=0,width=10 
     1020        Prompt side,"Include detector halves?",popup,"both;right;left" 
     1021        Prompt phi,"Orientation Angle (-90,90) degrees (Rectangular, Elliptical, or Sector)" 
     1022        Prompt width, "Width of Rectangular average (1,128)" 
     1023         
     1024        root:myGlobals:Protocols:gAvgInfoStr += "SIDE=" + side + ";" 
     1025        root:myGlobals:Protocols:gAvgInfoStr += "PHI=" + num2str(phi) + ";" 
     1026        root:myGlobals:Protocols:gAvgInfoStr += "WIDTH=" + num2str(width) + ";" 
     1027End 
     1028 
     1029Proc GetAnnularAvgInfo(QCtr,QDelta) 
     1030        Variable QCtr=0.01,QDelta=10 
     1031        Prompt Qctr, "q-value of center of annulus -OR- Ratio of minor to major axes of ellipse" 
     1032        Prompt Qdelta,"Pixel width of annulus" 
     1033 
     1034        root:myGlobals:Protocols:gAvgInfoStr += "QCENTER=" + num2str(QCtr) + ";" 
     1035        root:myGlobals:Protocols:gAvgInfoStr += "QDELTA=" + num2str(QDelta) + ";" 
    10141036End 
    10151037 
Note: See TracChangeset for help on using the changeset viewer.