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/Reduction/SANS/WriteQIS.ipf

    r832 r838  
    777777        Redimension/N=(pixelsX*pixelsY) qx_val,qy_val,z_val 
    778778 
    779 ///************ 
    780 // do everything to write out the resolution too 
    781         // un-comment these if you want to write out qz_val and qval too, then use the proper save command 
    782         qval = CalcQval(p+1,q+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) 
    783         qz_val = CalcQz(p+1,q+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) 
    784         phi = FindPhi( pixSize*((p+1)-xctr) , pixSize*((q+1)-yctr))             //(dx,dy) 
    785         r_dist = sqrt(  (pixSize*((p+1)-xctr))^2 +  (pixSize*((q+1)-yctr))^2 )          //radial distance from ctr to pt 
    786         Redimension/N=(pixelsX*pixelsY) qz_val,qval,phi,r_dist 
    787         //everything in 1D now 
    788         Duplicate/O qval SigmaQX,SigmaQY,fsubS 
     779 
    789780 
    790781        Variable L2 = rw[18] 
     
    796787        Variable usingLenses = rw[28]           //new 2007 
    797788 
     789        Variable vz_1 = 3.956e5         //velocity [cm/s] of 1 A neutron 
     790        Variable g = 981.0                              //gravity acceleration [cm/s^2] 
     791        Variable m_h    = 252.8                 // m/h [=] s/cm^2 
     792 
     793        Variable acc,ssd,lambda0,yg_d,qstar 
     794                 
     795        G = 981.  //!   ACCELERATION OF GRAVITY, CM/SEC^2 
     796        acc = vz_1              //      3.956E5 //!     CONVERT WAVELENGTH TO VELOCITY CM/SEC 
     797        SDD = L2        *100    //1317 
     798        SSD = L1        *100    //1627          //cm 
     799        lambda0 = lambda                //              15 
     800        YG_d = -0.5*G*SDD*(SSD+SDD)*(LAMBDA0/acc)^2 
     801        Print "DISTANCE BEAM FALLS DUE TO GRAVITY (CM) = ",YG_d 
     802//              Print "Gravity q* = ",-2*pi/lambda0*2*yg_d/sdd 
     803        qstar = -2*pi/lambda0*2*yg_d/sdd 
     804         
     805 
     806// the gravity center is not the resolution center 
     807// gravity center = beam center 
     808// resolution center = offset y = dy + (2)*yg_d 
     809///************ 
     810// do everything to write out the resolution too 
     811        // un-comment these if you want to write out qz_val and qval too, then use the proper save command 
     812        qval = CalcQval(p+1,q+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) 
     813        qz_val = CalcQz(p+1,q+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) 
     814//      phi = FindPhi( pixSize*((p+1)-xctr) , pixSize*((q+1)-yctr))             //(dx,dy) 
     815//      r_dist = sqrt(  (pixSize*((p+1)-xctr))^2 +  (pixSize*((q+1)-yctr))^2 )          //radial distance from ctr to pt 
     816        phi = FindPhi( pixSize*((p+1)-xctr) , pixSize*((q+1)-yctr)+(2)*yg_d)            //(dx,dy+yg_d) 
     817        r_dist = sqrt(  (pixSize*((p+1)-xctr))^2 +  (pixSize*((q+1)-yctr)+(2)*yg_d)^2 )         //radial distance from ctr to pt 
     818        Redimension/N=(pixelsX*pixelsY) qz_val,qval,phi,r_dist 
     819        //everything in 1D now 
     820        Duplicate/O qval SigmaQX,SigmaQY,fsubS 
     821         
     822 
     823 
    798824        //Two parameters DDET and APOFF are instrument dependent.  Determine 
    799825        //these from the instrument name in the header. 
     
    819845        // generate my own error wave for I(qx,qy) 
    820846        //      //      sw = 0.05*sw            // uniform 5% error? tends to favor the low intensity too strongly 
    821         // after teh SQRT(),  get rid of the "bad" errors by replacing the NaN, Inf, and zero with V_avg 
     847        // after the SQRT(),  get rid of the "bad" errors by replacing the NaN, Inf, and zero with V_avg 
    822848        // THIS IS EXTREMEMLY IMPORTANT - if this is not done, there are some "bad" values in the  
    823849        // error wave (things that are not numbers) - and this wrecks the smeared model fitting. 
Note: See TracChangeset for help on using the changeset viewer.