Ignore:
Timestamp:
Jun 24, 2011 9:46:25 AM (12 years ago)
Author:
srkline
Message:

switched the 2d resolution calculation back to using the latest gravity correction terms. Still not sure if these are final, but I think it's close.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
Files:
2 edited

Legend:

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

    r811 r813  
    534534                Vz = (ssd - 0)/magn 
    535535                 
    536 //              Vx = 0.0                        // Initialize direction vector. 
    537 //              Vy = 0.0 
    538 //              Vz = 1.0 
    539                  
    540                  
    541536// 
    542537//              if(n1 == 1) 
     
    600595                                        while(!find_theta) 
    601596                                        ran = abs(enoise(1))            //[0,1] 
    602                                         PHI = 2.0*PI*Ran                        //Chooses azimuthal scattering angle. 
     597                                        PHI = 2.0*PI*Ran                        //Chooses azimuthal scattering angle. Currently this is random 
    603598                                ELSE 
    604599                                        //NEUTRON scattered incoherently 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf

    r811 r813  
    297297 
    298298 
    299 // for test case with no gravity, set a_val = 0 
    300 // note that gravity has no wavelength dependence. the lambda^4 cancels out. 
    301 // 
    302 //      a_val = 0 
    303 //      a_val_l2 = 0 
    304  
    305         // the detector pixel is square, so correct for phi 
    306         proj_DDet = DDet*cos(phi) + DDet*sin(phi) 
    307          
    308         // 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) 
    310         SigmaQX += inQ*inQ*v_lambda 
    311  
    312         //this is really sigma_Q_perpendicular 
    313         proj_DDet = DDet*sin(phi) + DDet*cos(phi)               //not necessary, since DDet is the same in both X and Y directions 
    314  
    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) 
    316          
    317         SigmaQX = sqrt(SigmaQX) 
    318         SigmaQy = sqrt(SigmaQY) 
    319          
     299//// for test case with no gravity, set a_val = 0 
     300//// note that gravity has no wavelength dependence. the lambda^4 cancels out. 
     301//// 
     302////    a_val = 0 
     303////    a_val_l2 = 0 
     304// 
     305//      // the detector pixel is square, so correct for phi 
     306//      proj_DDet = DDet*cos(phi) + DDet*sin(phi) 
     307//       
     308//      // 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) 
     310//      SigmaQX += inQ*inQ*v_lambda 
     311// 
     312//      //this is really sigma_Q_perpendicular 
     313//      proj_DDet = DDet*sin(phi) + DDet*cos(phi)               //not necessary, since DDet is the same in both X and Y directions 
     314// 
     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) 
     316//       
     317//      SigmaQX = sqrt(SigmaQX) 
     318//      SigmaQy = sqrt(SigmaQY) 
     319//       
    320320 
    321321///////////////////////////////////////////////// 
     
    323323//      ////// this is all experimental, inclusion of gravity effect into the parallel component 
    324324////    // 
    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 //////   
     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/(2*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////     
    353353         
    354354        results = "success" 
Note: See TracChangeset for help on using the changeset viewer.