 Timestamp:
 Jun 24, 2011 9:46:25 AM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf
r811 r813 297 297 298 298 299 // for test case with no gravity, set a_val = 0300 // note that gravity has no wavelength dependence. the lambda^4 cancels out.301 // 302 // a_val = 0303 // a_val_l2 = 0304 305 // the detector pixel is square, so correct for phi306 proj_DDet = DDet*cos(phi) + DDet*sin(phi)307 308 // this is really sigma_Q_parallel309 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_lambda311 312 //this is really sigma_Q_perpendicular313 proj_DDet = DDet*sin(phi) + DDet*cos(phi) //not necessary, since DDet is the same in both X and Y directions314 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 // 320 320 321 321 ///////////////////////////////////////////////// … … 323 323 // ////// this is all experimental, inclusion of gravity effect into the parallel component 324 324 //// // 325 //Variable yg_d,acc,sdd,ssd,lambda0,DL_L,sig_l326 //Variable var_qlx,var_qly,var_ql,qx,qy,sig_perp,sig_para327 //G = 981. //! ACCELERATION OF GRAVITY, CM/SEC^2328 //acc = vz_1 // 3.956E5 //! CONVERT WAVELENGTH TO VELOCITY CM/SEC329 //SDD = L2 //1317330 //SSD = L1 //1627 //cm331 //lambda0 = lambda // 15332 //DL_L = lambdaWidth //0.236333 //SIG_L = DL_L/sqrt(6)334 //YG_d = 0.5*G*SDD*(SSD+SDD)*(LAMBDA0/acc)^2335 ///// //Print "DISTANCE BEAM FALLS DUE TO GRAVITY (CM) = ",YG336 //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))^2344 //VAR_QLX = (SIG_L*QX)^2345 //VAR_QL = VAR_QLY + VAR_QLX //! WAVELENGTH CONTRIBUTION TO VARIANCE346 //sig_para = (sig_perp^2 + VAR_QL)^0.5347 //348 ///// //return values PBR349 //SigmaQX = sig_para350 //SigmaQy = sig_perp351 //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 //// 353 353 354 354 results = "success"
Note: See TracChangeset
for help on using the changeset viewer.