Changeset 838 for sans/Dev/trunk/NCNR_User_Procedures/Common/Smear_2D.ipf
- Timestamp:
- Feb 28, 2012 4:51:26 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Common/Smear_2D.ipf
r801 r838 412 412 pixSize = rw[13]/10 //convert mm to cm (x and y are the same size pixels) 413 413 414 // qx_val = CalcQx(p+1,q+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) //+1 converts to detector coordinate system415 // qy_val = CalcQy(p+1,q+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10)416 417 414 qx_val = CalcQx(xx+1,yy+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) //+1 converts to detector coordinate system 418 415 qy_val = CalcQy(xx+1,yy+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) 419 416 420 // Redimension/N=(pixelsX*pixelsY) qx_val,qy_val,z_val421 422 ///************423 // do everything to write out the resolution too424 // un-comment these if you want to write out qz_val and qval too, then use the proper save command425 qval = CalcQval(xx+1,yy+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10)426 qz_val = CalcQz(xx+1,yy+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10)427 phi = FindPhi( pixSize*((xx+1)-xctr) , pixSize*((yy+1)-yctr)) //(dx,dy)428 r_dist = sqrt( (pixSize*((xx+1)-xctr))^2 + (pixSize*((yy+1)-yctr))^2 ) //radial distance from ctr to pt429 // Redimension/N=(pixelsX*pixelsY) qz_val,qval,phi,r_dist430 //everything in 1D now431 // Duplicate/O qval SigmaQX,SigmaQY,fsubS432 Variable SigmaQX,SigmaQY,fsubS433 434 417 Variable L2 = rw[18] 435 418 Variable BS = rw[21] … … 439 422 Variable lambdaWidth = rw[27] 440 423 Variable usingLenses = rw[28] //new 2007 424 425 Variable vz_1 = 3.956e5 //velocity [cm/s] of 1 A neutron 426 Variable g = 981.0 //gravity acceleration [cm/s^2] 427 Variable m_h = 252.8 // m/h [=] s/cm^2 428 429 Variable acc,ssd,lambda0,yg_d,qstar 430 431 G = 981. //! ACCELERATION OF GRAVITY, CM/SEC^2 432 acc = vz_1 // 3.956E5 //! CONVERT WAVELENGTH TO VELOCITY CM/SEC 433 SDD = L2 *100 //1317 434 SSD = L1 *100 //1627 //cm 435 lambda0 = lambda // 15 436 YG_d = -0.5*G*SDD*(SSD+SDD)*(LAMBDA0/acc)^2 437 Print "DISTANCE BEAM FALLS DUE TO GRAVITY (CM) = ",YG_d 438 Print "Gravity q* = ",-2*pi/lambda0*2*yg_d/sdd 439 qstar = -2*pi/lambda0*2*yg_d/sdd 440 441 442 // the gravity center is not the resolution center 443 // gravity center = beam center 444 // resolution center = offset y = dy + (2)*yg_d 445 446 447 qval = CalcQval(xx+1,yy+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) 448 qz_val = CalcQz(xx+1,yy+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) 449 phi = FindPhi( pixSize*((xx+1)-xctr) , pixSize*((yy+1)-yctr)+(2)*yg_d) //(dx,dy+yg_d) 450 r_dist = sqrt( (pixSize*((xx+1)-xctr))^2 + (pixSize*((yy+1)-yctr)+(2)*yg_d)^2 ) //radial distance from ctr to pt 451 452 Print pixSize*((yy+1)-yctr),pixSize*((yy+1)-yctr)+(2)*yg_d 453 454 // Redimension/N=(pixelsX*pixelsY) qz_val,qval,phi,r_dist 455 //everything in 1D now 456 // Duplicate/O qval SigmaQX,SigmaQY,fsubS 457 Variable SigmaQX,SigmaQY,fsubS 441 458 442 459 //Two parameters DDET and APOFF are instrument dependent. Determine … … 469 486 Print "phi, theta",phi,theta 470 487 471 FindQxQy(qval,phi,qx_ret,qy_ret)488 // FindQxQy(qval,phi,qx_ret,qy_ret) 472 489 473 490 sx = SigmaQx … … 487 504 Setscale/I x -nStdDev*maxSig+x0,nStdDev*maxSig+x0,res 488 505 Setscale/I y -nStdDev*maxSig+y0,nStdDev*maxSig+y0,res 489 // Setscale/I x -nStdDev*sx+x0,nStdDev*sx+x0,res490 // Setscale/I y -nStdDev*sy+y0,nStdDev*sy+y0,res506 ///// Setscale/I x -nStdDev*sx+x0,nStdDev*sx+x0,res 507 ///// Setscale/I y -nStdDev*sy+y0,nStdDev*sy+y0,res 491 508 492 509 Variable xPt,yPt,delx,dely,offx,offy
Note: See TracChangeset
for help on using the changeset viewer.