Ignore:
Timestamp:
Jul 21, 2017 2:56:37 PM (5 years ago)
Author:
srkline
Message:

adding the annular average option to the protocol definition and execution.

File:
1 edited

Legend:

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

    r1056 r1057  
    3232//              WIDTH=value             total width of rectangular section, in pixels 
    3333//              SIDE=string             string from set {left,right,both} **note NOT capitalized 
     34 
    3435//              QCENTER=value           q-value (1/A) of center of annulus for annular average 
    35 //              QDELTA=value            total width of annulus centered at QCENTER 
     36//              QDELTA=value            (+/-) width of annulus centered at QCENTER, in units of q 
     37//              DETGROUP=value  string with "F" or "M" to name the detector group where the annulus lies. 
     38 
    3639//              PLOT=string             string from set {Yes,No} = truth of generating plot of averaged data 
    3740//              SAVE=string             string from set {Yes,No} = truth of saving averaged data to disk, now with "Concatenate"  or "Individual" 
     
    13531356// 
    13541357//Proc V_GetAvgInfo(av_typ,autoSave,autoName,autoPlot,side,phi,dphi,width,QCtr,QDelta) 
    1355 Proc V_GetAvgInfo(av_typ,autoSave,autoName,binType) 
     1358Proc V_GetAvgInfo(av_typ,autoSave,autoName,binType,qCtr,qDelta,detGroup) 
    13561359        String av_typ,autoSave,AutoName,binType 
    13571360//      Variable phi=0,dphi=10,width=10,Qctr = 0.01,qDelta=10 
     1361        Variable Qctr=0.1,qDelta=0.01 
     1362        String detGroup="F" 
    13581363 
    13591364//      Prompt av_typ, "Type of Average",popup,"Circular;Sector;Rectangular;Annular;2D_ASCII;QxQy_ASCII;PNG_Graphic;Sector_PlusMinus;" 
    1360         Prompt av_typ, "Type of Average",popup,"Circular;" 
     1365        Prompt av_typ, "Type of Average",popup,"Circular;Annular;" 
    13611366 
    13621367// comment out above line in DEMO_MODIFIED version, and uncomment the line below (to disable PNG save) 
     
    13691374//      Prompt dphi, "Azimuthal range (0,45) degrees (Sector only)" 
    13701375//      Prompt width, "Width of Rectangular average (1,128)" 
    1371 //      Prompt Qctr, "q-value of center of annulus" 
    1372 //      Prompt Qdelta,"Pixel width of annulus" 
    13731376        Prompt binType,"Binning Type?",popup,ksBinTypeStr 
    13741377 
     1378        Prompt Qctr, "q-value of center of annulus" 
     1379        Prompt Qdelta,"(+/-) q-width of annulus" 
     1380        Prompt detGroup,"Group for annulus" 
     1381         
    13751382        //assign results of dialog to key=value string, semicolon separated 
    13761383        //do only what is necessary, based on av_typ 
     
    14011408//      Endif 
    14021409//       
    1403 //      if(cmpstr(av_typ,"Annular")==0) 
    1404 //              root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "QCENTER=" + num2str(QCtr) + ";" 
    1405 //              root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "QDELTA=" + num2str(QDelta) + ";" 
    1406 //      Endif 
     1410        if(cmpstr(av_typ,"Annular")==0) 
     1411                root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "QCENTER=" + num2str(QCtr) + ";" 
     1412                root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "QDELTA=" + num2str(QDelta) + ";" 
     1413                root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "DETGROUP=" + detGroup + ";" 
     1414        Endif 
    14071415End 
    14081416 
     
    14111419// -- this is the original(SANS) version, and needs to be updated for VSANS as the averaging options are 
    14121420//    worked out 
     1421// -- there have been changes made to V_GetAvgInfo() above -- so work from that version, NOT this one. 
     1422// 
    14131423// 
    14141424//procedure called by protocol panel to ask user for average type choices 
     
    24242434                case "Annular": 
    24252435//                      AnnularAverageTo1D(activeType) 
     2436                        String detGroup = StringByKey("DETGROUP",prot[5],"=",";") 
     2437                        Variable qCtr_Ann = NumberByKey("QCENTER",prot[5],"=",";") 
     2438                        Variable qWidth = NumberByKey("QDELTA",prot[5],"=",";") 
     2439                        V_QBinAllPanels_Annular(activeType,detGroup,qCtr_Ann,qWidth) 
    24262440                        break 
    24272441                case "Circular": 
     
    24442458// x- !!!need to split out the panel draw and the binning calls from V_PlotData_Panel 
    24452459// 
    2446         V_PlotData_Panel()              //this brings the plot window to the front, or draws it (ONLY) 
    2447         V_Update1D_Graph(activeType,binType)            //update the graph, data was already binned 
    2448          
     2460// TODO: 
     2461// -- BAD logic here, skipping the normal graph if annular is chosen. Go back and see how I do this 
     2462// in SANS for a better and more foolproof way to do this 
     2463        // 
     2464        if(cmpstr(av_type,"Annular") != 0) 
     2465                V_PlotData_Panel()              //this brings the plot window to the front, or draws it (ONLY) 
     2466                V_Update1D_Graph(activeType,binType)            //update the graph, data was already binned 
     2467        endif 
    24492468///// end of averaging dispatch 
    24502469 
     
    25122531                        case "Annular": 
    25132532//                              WritePhiave_W_Protocol(activeType,fullPath,dialog) 
     2533                                V_fWrite1DAnnular("root:Packages:NIST:VSANS:",activeType,detGroup,newFileName+".phi") 
     2534                                Print "data written to:  "+ newFileName+".phi" 
     2535 
    25142536                                break 
    25152537                        case "2D_ASCII": 
     
    25452567                                        V_Write1DData_ITX("root:Packages:NIST:VSANS:",activeType,newFileName,binType) 
    25462568                                endif 
     2569                                Print "data written to:  "+ newFileName+"."+exten 
    25472570 
    25482571                endswitch 
    25492572                 
    2550                 Print "data written to:  "+ newFileName+"."+exten 
    25512573        Endif 
    25522574         
Note: See TracChangeset for help on using the changeset viewer.