Ignore:
Timestamp:
May 4, 2011 9:47:33 AM (11 years ago)
Author:
srkline
Message:

Changed the 2D resolution calculation to include gravity. This seems to work, but will still require some testing. It requires no modifications to the smearing calculation, still using parallel and perpendicular directions.

Added a Fake Update feature to the RealTime? update. There are specific, separate instructions for how to set this up. Usef (possibly) for summer schools or demos.

Adjusted the 2D MonteCarlo? simulation to a corrected beam center. The Gauss Peak was not symmetric around the old beam center.

Corrected the AAO resolution smearing functions to work with cursors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf

    r794 r800  
    307307         
    308308        // this is really sigma_Q_parallel 
    309         SigmaQX = kap*kap/12* (3*(S1/L1)^2 + 3*(S2/LP)^2 + (proj_DDet/L2)^2 + (sin(phi))^2*8*(a_val_L2)^2*lambda^4*lambdaWidth^2) 
     309        SigmaQX = kap*kap/12 * (3*(S1/L1)^2 + 3*(S2/LP)^2 + (proj_DDet/L2)^2 + (sin(phi))^2*8*(a_val_L2)^2*lambda^4*lambdaWidth^2) 
    310310        SigmaQX += inQ*inQ*v_lambda 
    311311 
     
    313313        proj_DDet = DDet*sin(phi) + DDet*cos(phi)               //not necessary, since DDet is the same in both X and Y directions 
    314314 
    315         SigmaQY = 3*(S1/L1)^2 + 3*(S2/LP)^2 + (proj_DDet/L2)^2 + (cos(phi))^2*8*(a_val_L2)^2*lambda^4*lambdaWidth^2 
    316         SigmaQY *= kap*kap/12 
     315        SigmaQY = kap*kap/12 * (3*(S1/L1)^2 + 3*(S2/LP)^2 + (proj_DDet/L2)^2 + (cos(phi))^2*8*(a_val_L2)^2*lambda^4*lambdaWidth^2) 
    317316         
    318317        SigmaQX = sqrt(SigmaQX) 
    319318        SigmaQy = sqrt(SigmaQY) 
    320319         
     320 
     321///////////////////////////////////////////////// 
     322///      
     323        ////// this is all experimental, inclusion of gravity effect into the parallel component 
     324        // 
     325        Variable yg_d,acc,sdd,ssd,lambda0,DL_L,sig_l 
     326        Variable var_qlx,var_qly,var_ql,qx,qy,sig_perp,sig_para 
     327//      G = 981.  //!   ACCELERATION OF GRAVITY, CM/SEC^2 
     328        acc = vz_1              //      3.956E5 //!     CONVERT WAVELENGTH TO VELOCITY CM/SEC 
     329        SDD = L2                //1317 
     330        SSD = L1                //1627          //cm 
     331        lambda0 = lambda                //              15 
     332        DL_L = lambdaWidth              //0.236 
     333        SIG_L = DL_L/sqrt(6) 
     334        YG_d = -0.5*G*SDD*(SSD+SDD)*(LAMBDA0/acc)^2 
     335//      Print "DISTANCE BEAM FALLS DUE TO GRAVITY (CM) = ",YG 
     336         
     337        sig_perp = kap*kap/12 * (3*(S1/L1)^2 + 3*(S2/LP)^2 + (proj_DDet/L2)^2) 
     338        sig_perp = sqrt(sig_perp) 
     339         
     340         
     341        FindQxQy(inQ,phi,qx,qy) 
     342         
     343        VAR_QLY = SIG_L^2 * (QY+4*PI*YG_d/(SDD*LAMBDA0))^2 
     344        VAR_QLX = (SIG_L*QX)^2 
     345        VAR_QL = VAR_QLY + VAR_QLX  //! WAVELENGTH CONTRIBUTION TO VARIANCE 
     346        sig_para = (sig_perp^2 + VAR_QL)^0.5 
     347         
     348//return values PBR      
     349        SigmaQX = sig_para 
     350        SigmaQy = sig_perp 
     351         
     352//       
    321353         
    322354        results = "success" 
Note: See TracChangeset for help on using the changeset viewer.