Ignore:
Timestamp:
Feb 6, 2012 12:19:28 PM (11 years ago)
Author:
srkline
Message:

moving the Polarization routines to a temporary "beta" menu location on the macros menu, numbering the panels.

Created a loader for the polarization routines that will load the SANS reduction if needed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_PolarizationCorrection.ipf

    r829 r835  
    7575 
    7676// main entry to the PolCor Panel 
    77 Macro ShowPolCorSetup() 
     77Proc ShowPolCorSetup() 
    7878 
    7979        Variable restore=0 
     
    269269        Button button4,pos={620,18},size={30,20},proc=PolCorHelpParButtonProc,title="?" 
    270270        Button button12,pos={440,473},size={120,20},proc=Display4XSButton,title="Display 4 XS" 
     271        Button button13,pos={440,446},size={120,20},proc=ClearPolCorEntries,title="Clear Entries" 
    271272 
    272273        PopupMenu popup1,pos={210,24},size={102,20},title="Condition" 
     
    10151016         
    10161017        Variable row,Psm, PsmPf, PCell,err_Psm, err_PsmPf, err_PCell 
    1017         Variable ii,jj,muPo,err_muPo,gam,err_gam,monCts,t1,num 
     1018        Variable ii,jj,muPo,err_muPo,gam,err_gam,monCts,t1,num,fileCount 
    10181019 
    10191020        Variable ea_uu, ea_ud, ea_dd, ea_du 
     
    10571058 
    10581059        // loop over the (10) rows in the listWave 
     1060        fileCount=0 
    10591061        for(ii=0;ii<num;ii+=1) 
    10601062                runStr =        lb[ii][0]               //the run number 
    10611063                if(cmpstr(runStr, "" ) != 0) 
    1062                          
     1064                 
     1065                        fileCount += 1          //one more file is added 
    10631066                        // get run number (str) 
    10641067                        // get file name 
     
    10851088                        // get file info (monitor counts) 
    10861089                        monCts = getMonitorCount(fname) 
    1087                         monCts /= 1e8           //just to get reasonable values 
     1090                        monCts /= 1e8           //to get a normalized value to add proportionally 
    10881091                         
    10891092                        Variable err_monCts 
     
    12091212// can't take the SQRT here, since the matrix won't necessarily be full yet,  
    12101213         
    1211          
     1214// but now need to re-normalize the row based on the number of files that were added 
     1215// pType has only one value as passed in, so the row has already been set. It would be more correct 
     1216// to switch based on pType... 
     1217         
     1218        matA[row][0] /= fileCount 
     1219        matA[row][1] /= fileCount 
     1220        matA[row][2] /= fileCount 
     1221        matA[row][3] /= fileCount        
     1222         
     1223        matA_err[row][0] /= fileCount 
     1224        matA_err[row][1] /= fileCount 
     1225        matA_err[row][2] /= fileCount 
     1226        matA_err[row][3] /= fileCount    
     1227                                 
    12121228        SetDataFolder root: 
    12131229        return(0) 
     
    24492465End 
    24502466 
     2467// clear the entries for all 4 XS for the currently selected Tab only 
     2468// clears both the run numbers and the cell assignments 
     2469// 
     2470Function ClearPolCorEntries(ba) : ButtonControl 
     2471        STRUCT WMButtonAction &ba 
     2472 
     2473        switch( ba.eventCode ) 
     2474                case 2: // mouse up 
     2475                        // click code here 
     2476                        // 
     2477//                      String type 
     2478                        Variable tabNum 
     2479                        ControlInfo/W=PolCor_Panel PolCorTab 
     2480//                      type = S_value 
     2481//                      Print "selected data type = ",type,V_Value 
     2482                        tabNum = V_Value 
     2483                         
     2484                        WAVE/T twDD = $("root:Packages:NIST:Polarization:ListWave_"+num2str(tabNum)+"_DD") 
     2485                        WAVE/T twUU = $("root:Packages:NIST:Polarization:ListWave_"+num2str(tabNum)+"_UU") 
     2486                        WAVE/T twUD = $("root:Packages:NIST:Polarization:ListWave_"+num2str(tabNum)+"_UD") 
     2487                        WAVE/T twDU = $("root:Packages:NIST:Polarization:ListWave_"+num2str(tabNum)+"_DU") 
     2488                         
     2489                        twDD = "" 
     2490                        twUU = "" 
     2491                        twUD = "" 
     2492                        twDU = "" 
     2493                         
     2494                        break 
     2495                case -1: // control being killed 
     2496                        break 
     2497        endswitch 
     2498 
     2499        return 0 
     2500End 
    24512501 
    24522502 
Note: See TracChangeset for help on using the changeset viewer.