Ignore:
Timestamp:
Feb 5, 2019 3:13:21 PM (4 years ago)
Author:
srkline
Message:

adding procedures for calculating sector averages of the data

still need to add overlay of sector angles.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf

    r1119 r1121  
    13181318        SVAR gAvgInfoStr = root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr 
    13191319         
    1320         String av_typ,autoSave,AutoName,binType 
    1321 //      Variable phi=0,dphi=10,width=10,Qctr = 0.01,qDelta=10 
    1322         Variable Qctr,qDelta 
     1320        String av_typ,autoSave,AutoName,binType,side 
     1321        Variable phi,dphi,width=10,Qctr = 0.01,qDelta=10 
    13231322        String detGroup 
    13241323         
     
    13341333        qDelta = NumberByKey("QDELTA", gAvgInfoStr  ,"=",";") 
    13351334        detGroup = StringByKey("DETGROUP", gAvgInfoStr  ,"=",";") 
     1335        phi = NumberByKey("PHI", gAvgInfoStr  ,"=",";") 
     1336        dphi = NumberByKey("DPHI", gAvgInfoStr  ,"=",";") 
     1337 
    13361338//      Execute "V_GetAvgInfo_Full()" 
    13371339//              Execute "V_GetAvgInfo()" 
     
    13401342 
    13411343//      Prompt av_typ, "Type of Average",popup,"Circular;Sector;Rectangular;Annular;2D_ASCII;QxQy_ASCII;PNG_Graphic;Sector_PlusMinus;" 
    1342         Prompt av_typ, "Type of Average",popup,"Circular;Narrow_Slit;Annular;QxQy_ASCII;" 
     1344        Prompt av_typ, "Type of Average",popup,"Circular;Narrow_Slit;Annular;Sector;QxQy_ASCII;" 
    13431345 
    13441346// comment out above line in DEMO_MODIFIED version, and uncomment the line below (to disable PNG save) 
     
    13471349        Prompt autoName,"Auto-Name files?",popup,"Auto;Manual" 
    13481350//      Prompt autoPlot,"Plot the averaged Data?",popup,"Yes;No" 
    1349 //      Prompt side,"Include detector halves?",popup,"both;right;left" 
    1350 //      Prompt phi,"Orientation Angle (-90,90) degrees (Rectangular or Sector)" 
    1351 //      Prompt dphi, "Azimuthal range (0,45) degrees (Sector only)" 
     1351        Prompt side,"Include detector halves?",popup,"both;right;left" 
     1352        Prompt phi,"Orientation Angle (-90,90) degrees (Rectangular or Sector)" 
     1353        Prompt dphi, "Azimuthal range (0,45) degrees (Sector only)" 
    13521354//      Prompt width, "Width of Rectangular average (1,128)" 
    13531355        Prompt binType,"Binning Type?",popup,ksBinTypeStr 
     
    13581360 
    13591361         
    1360         DoPrompt "Enter Averaging Parameters",av_typ,autoSave,autoName,binType,qCtr,qDelta,detGroup 
     1362        DoPrompt "Enter Averaging Parameters",av_typ,autoSave,autoName,binType,qCtr,qDelta,detGroup,side,phi,dphi 
    13611363        if (V_Flag) 
    13621364                return(0)                                                               // User canceled 
     
    13811383        gAvgInfoStr += "BINTYPE=" + binType + ";" 
    13821384         
    1383 //      if(cmpstr(av_typ,"Sector")==0 || cmpstr(av_typ,"Sector_PlusMinus")==0) 
    1384 //              gAvgInfoStr += "SIDE=" + side + ";" 
    1385 //              gAvgInfoStr += "PHI=" + num2str(phi) + ";" 
    1386 //              gAvgInfoStr += "DPHI=" + num2str(dphi) + ";" 
    1387 //      Endif 
     1385        if(cmpstr(av_typ,"Sector")==0 || cmpstr(av_typ,"Sector_PlusMinus")==0) 
     1386                gAvgInfoStr += "SIDE=" + side + ";" 
     1387                gAvgInfoStr += "PHI=" + num2str(phi) + ";" 
     1388                gAvgInfoStr += "DPHI=" + num2str(dphi) + ";" 
     1389        Endif 
    13881390//       
    13891391//      if(cmpstr(av_typ,"Rectangular")==0) 
     
    31623164                         
    31633165                case "Sector": 
    3164 //                      CircularAverageTo1D(activeType) 
     3166                        String side = StringByKey("SIDE",avgStr,"=",";") 
     3167                        Variable phi_rad = (Pi/180)*NumberByKey("PHI",avgStr,"=",";")           //in radians  
     3168                        Variable dphi_rad = (Pi/180)*NumberByKey("DPHI",avgStr,"=",";") 
     3169                        V_QBinAllPanels_Sector(activeType,binType,collimationStr,side,phi_rad,dphi_rad) 
    31653170                        break 
    31663171                case "Sector_PlusMinus": 
     
    32183223 
    32193224                        case "Circular": 
     3225                        case "Sector": 
    32203226                                V_PlotData_Panel()              //this brings the plot window to the front, or draws it (ONLY) 
    32213227                                V_Update1D_Graph(activeType,binType)            //update the graph, data was already binned                              
    3222                                 break 
    3223                         case "Sector": 
    3224         //                      CircularAverageTo1D(activeType) 
    32253228                                break 
    32263229                        case "Sector_PlusMinus": 
Note: See TracChangeset for help on using the changeset viewer.