Ignore:
Timestamp:
Dec 3, 2008 12:49:15 PM (14 years ago)
Author:
srkline
Message:

Fixes from Lionel's bug in the calculation of Qx and Qy. Qx and Qy were not being properly calculated as components of Q and phi (azimuthal angle). Only an effect at the largest q-values (> 0.3) and even then, only in the 3rd decimal place.This incorrect calculation was only visible on the 2D data display, and in the QxQy? ASCII export. Not a terrible bug, not worth immediate release of a patch.

File:
1 edited

Legend:

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

    r457 r459  
    601601End 
    602602 
    603 //phi is defined from +x axis, proceeding CCW around [0,2Pi] 
    604 Threadsafe Function FindPhi(vx,vy) 
    605         variable vx,vy 
    606          
    607         variable phi 
    608          
    609         phi = atan(vy/vx)               //returns a value from -pi/2 to pi/2 
    610          
    611         // special cases 
    612         if(vx==0 && vy > 0) 
    613                 return(pi/2) 
    614         endif 
    615         if(vx==0 && vy < 0) 
    616                 return(3*pi/2) 
    617         endif 
    618         if(vx >= 0 && vy == 0) 
    619                 return(0) 
    620         endif 
    621         if(vx < 0 && vy == 0) 
    622                 return(pi) 
    623         endif 
    624          
    625          
    626          
    627         if(vx > 0 && vy > 0) 
    628                 return(phi) 
    629         endif 
    630         if(vx < 0 && vy > 0) 
    631                 return(abs(phi) + pi/2) 
    632         endif 
    633         if(vx < 0 && vy < 0) 
    634                 return(phi + pi) 
    635         endif 
    636         if( vx > 0 && vy < 0) 
    637                 return(abs(phi) + 3*pi/2) 
    638         endif 
    639          
    640         return(phi) 
    641 end 
    642603 
    643604 
Note: See TracChangeset for help on using the changeset viewer.