Ignore:
Timestamp:
May 18, 2018 10:32:22 AM (5 years ago)
Author:
srkline
Message:

Significant restructuring of V_ExecuteProtocol to make the logic of the flow more tractable and adaptable in the future.

Added major change to VSANS event mode reduction panel to allow F and M binned events to be saved to a copy of the correspondng data file. A new data reduction panel for multiple slice reduction is now presented for Event data. This allows reduction of a single slice (all 8 F,M panels, back ignored), or all of the slices.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf

    r1099 r1100  
    361361                                dQv = -$w3[0] 
    362362 
    363 //TODO: be sure that this works correctly and can be included in either 
     363//DONE: this works correctly and can be included in either 
    364364// a VSANS reduction experiment, or a standalone analysis package 
    365365// -- since this is a Proc, not a function, #conditional compile does not work, 
    366366// but, since it's a Proc, it is not compiled, so missing functions aren't flagged as a compile error 
    367                                 if (exists("NCNR_VSANS")==6)                    //defined in the main  VSANS #includes file. 
    368                                         DoAlert 0,"**Treating data as VSANS data**" 
     367//                              if (exists("NCNR_VSANS")==6)                    //defined in the main  VSANS #includes file. 
     368//                                      DoAlert 0,"**Treating data as VSANS data**" 
    369369                                        Duplicate/O $w3,$(baseStr+"_dQv")                       //save a copy for VSANS 
    370370                                        $(baseStr+"_dQv") = -$(baseStr+"_dQv") 
    371                                         V_USANS_CalcWeights(baseStr,dQv) 
    372                                 else 
    373                                         DoAlert 0,"Treating data as USANS (normal slit-smeared data)" 
    374371                                        USANS_CalcWeights(baseStr,dQv) 
    375                                 endif                            
     372//                              else 
     373//                                      DoAlert 0,"Treating data as USANS (normal slit-smeared data)" 
     374//                                      USANS_CalcWeights(baseStr,dQv) 
     375//                              endif                            
    376376 
    377377                                 
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/USANS_SlitSmearing_v40.ipf

    r616 r1100  
    22#pragma version=3.00 
    33#pragma IgorVersion=6.1 
     4 
     5/////// 
     6// JAN-MAY 2018 
     7// 
     8// 
     9// This is a first approximation to model slit smeared VSANS data 
     10// - the dQv value is now a "per-Q" quantity, rather than a single global value 
     11// - the wavelength smearing must be accounted for by a separate numerical integral 
     12//   BEFORE this step is applied. 
     13//  -- this is significant issue for White Beam conditions 
     14// 
     15 
     16 
     17 
     18 
    419 
    520//Functions for doing USANS Slit smearing by method of weight matrix 
     
    360375End 
    361376 
     377// MAY 2018 
     378// updated to use dQv as a per-q wave, not a single global value 
    362379Function CalcW1(i,j) 
    363380        Variable i,j 
     
    368385 
    369386         
    370          
    371         NVAR dQv = USANS_dQv 
     387// replaced with a wave  
     388//      NVAR dQv = USANS_dQv 
    372389         
    373390        Variable UU,UL,dqj,rU,rL,wU,wL,dqw 
    374391        Wave Qval = $(USANS_basestr+"_q"+trimStr) 
     392        Wave dQv = $(USANS_basestr+"_dQv"+trimStr) 
    375393         
    376394        UU =sqrt(Qval[j+1]^2-Qval[i]^2) 
     
    380398        rL = sqrt(UL^2+Qval[i]^2) 
    381399         
    382         wU = (1.0/dQv)*(Qval[j+1]*UU/dqw - 0.5*UU*rU/dqw - 0.5*Qval[i]^2*ln(UU+rU)/dqw ) 
    383         wL = (1.0/dQv)*(Qval[j+1]*UL/dqw - 0.5*UL*rL/dqw - 0.5*Qval[i]^2*ln(UL+rL)/dqw ) 
     400        wU = (1.0/dQv[i])*(Qval[j+1]*UU/dqw - 0.5*UU*rU/dqw - 0.5*Qval[i]^2*ln(UU+rU)/dqw ) 
     401        wL = (1.0/dQv[i])*(Qval[j+1]*UL/dqw - 0.5*UL*rL/dqw - 0.5*Qval[i]^2*ln(UL+rL)/dqw ) 
    384402         
    385403        Return wU-wL 
     
    387405End 
    388406 
     407// MAY 2018 
     408// updated to use dQv as a per-q wave, not a single global value 
    389409Function CalcW2(i,j) 
    390410        Variable i,j 
     
    395415 
    396416 
    397  
    398         NVAR dQv = USANS_dQv 
     417// replaced with a wave  
     418//      NVAR dQv = USANS_dQv 
    399419         
    400420        variable UU,UL,dqw,rU,rL,wU,wL 
    401421         
    402422        Wave Qval = $(USANS_basestr+"_q"+trimStr) 
     423        Wave dQv = $(USANS_basestr+"_dQv"+trimStr) 
    403424 
    404425        UU = sqrt(Qval[j]^2-Qval[i]^2)                   
     
    407428        rU = sqrt(UU^2+Qval[i]^2) 
    408429        rL = sqrt(UL^2+Qval[i]^2) 
    409         wU = (1.0/dQv)*( -Qval[j-1]*UU/dqw + 0.5*UU*rU/dqw + 0.5*Qval[i]^2*ln(UU+rU)/dqw ) 
    410         wL = (1.0/dQv)*( -Qval[j-1]*UL/dqw + 0.5*UL*rL/dqw + 0.5*Qval[i]^2*ln(UL+rL)/dqw ) 
     430        wU = (1.0/dQv[i])*( -Qval[j-1]*UU/dqw + 0.5*UU*rU/dqw + 0.5*Qval[i]^2*ln(UU+rU)/dqw ) 
     431        wL = (1.0/dQv[i])*( -Qval[j-1]*UL/dqw + 0.5*UL*rL/dqw + 0.5*Qval[i]^2*ln(UL+rL)/dqw ) 
    411432 
    412433        Return wU-wL 
     
    414435End 
    415436 
     437// MAY 2018 
     438// updated to use dQv as a per-q wave, not a single global value 
    416439Function CalcR(i) 
    417440        Variable i 
     
    424447        NVAR m = USANS_m 
    425448        NVAR N = USANS_N 
    426         NVAR dQv = USANS_dQv 
     449// replaced with a wave  
     450//      NVAR dQv = USANS_dQv 
    427451         
    428452        Variable retval 
     
    430454        Wave Ival = $(USANS_basestr+"_i"+trimStr) 
    431455        Variable/G USANS_intQpt = Qval[i] 
     456        Wave dQv = $(USANS_basestr+"_dQv"+trimStr) 
     457 
    432458         
    433459        Variable lower = sqrt(qval[N-1]^2-qval[i]^2) 
    434         Variable upper = dQv 
     460        Variable upper 
     461        upper = dQv[i] 
    435462 
    436463        if (i == N) 
     
    440467        retval = Integrate1D(Remainder,lower,upper) 
    441468         
    442         retval *= 1/dQv 
     469        retval *= 1/dQv[i] 
    443470         
    444471        Return retval 
Note: See TracChangeset for help on using the changeset viewer.