Ignore:
Timestamp:
Feb 28, 2012 4:51:26 PM (10 years ago)
Author:
srkline
Message:

adding two new help files for real space modeling and description of the 2D resolution function

cleaning up the FFT routines for addition as a beta operation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Smear_2D.ipf

    r801 r838  
    412412        pixSize = rw[13]/10             //convert mm to cm (x and y are the same size pixels) 
    413413         
    414 //      qx_val = CalcQx(p+1,q+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10)          //+1 converts to detector coordinate system 
    415 //      qy_val = CalcQy(p+1,q+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) 
    416          
    417414        qx_val = CalcQx(xx+1,yy+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10)                //+1 converts to detector coordinate system 
    418415        qy_val = CalcQy(xx+1,yy+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) 
    419416         
    420 //      Redimension/N=(pixelsX*pixelsY) qx_val,qy_val,z_val 
    421  
    422 ///************ 
    423 // do everything to write out the resolution too 
    424         // un-comment these if you want to write out qz_val and qval too, then use the proper save command 
    425         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 pt 
    429 //      Redimension/N=(pixelsX*pixelsY) qz_val,qval,phi,r_dist 
    430         //everything in 1D now 
    431 //      Duplicate/O qval SigmaQX,SigmaQY,fsubS 
    432         Variable SigmaQX,SigmaQY,fsubS 
    433  
    434417        Variable L2 = rw[18] 
    435418        Variable BS = rw[21] 
     
    439422        Variable lambdaWidth = rw[27]    
    440423        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 
    441458 
    442459        //Two parameters DDET and APOFF are instrument dependent.  Determine 
     
    469486        Print "phi, theta",phi,theta 
    470487         
    471         FindQxQy(qval,phi,qx_ret,qy_ret) 
     488//      FindQxQy(qval,phi,qx_ret,qy_ret) 
    472489         
    473490        sx = SigmaQx 
     
    487504        Setscale/I x -nStdDev*maxSig+x0,nStdDev*maxSig+x0,res 
    488505        Setscale/I y -nStdDev*maxSig+y0,nStdDev*maxSig+y0,res 
    489 //      Setscale/I x -nStdDev*sx+x0,nStdDev*sx+x0,res 
    490 //      Setscale/I y -nStdDev*sy+y0,nStdDev*sy+y0,res 
     506/////   Setscale/I x -nStdDev*sx+x0,nStdDev*sx+x0,res 
     507/////   Setscale/I y -nStdDev*sy+y0,nStdDev*sy+y0,res 
    491508         
    492509        Variable xPt,yPt,delx,dely,offx,offy 
Note: See TracChangeset for help on using the changeset viewer.