Changeset 838 for sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
- Timestamp:
- Feb 28, 2012 4:51:26 PM (11 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Menu.ipf
r740 r838 38 38 "ReBin 1D Data",OpenRebin() 39 39 End 40 40 Submenu "2-D Processing" 41 41 "2D Work file Math",Show_WorkMath_Panel() 42 42 "Tile Raw 2D files",Show_Tile_2D_Panel() 43 43 "Export 2D ASCII data",Export_RAW_Ascii_Panel() 44 "Bin QxQy Data to 1D",BinQxQy_to_1D() 44 45 End 45 46 "-" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf
r827 r838 190 190 // but written in terms of Parallel and perpendicular to the Q vector at each point 191 191 // 192 // -- it must bewritten this way since the 2D function is an ellipse with its major192 // -- it is more naturally written this way since the 2D function is an ellipse with its major 193 193 // axis pointing in the direction of Q_parallel. Hence there is no way to properly define the 194 194 // elliptical gaussian in terms of sigmaX and sigmaY 195 195 // 196 // based on notes from David Mildner, 2008 196 // For a full description of the gravity effect on the resolution, see: 197 // 198 // "The effect of gravity on the resolution of small-angle neutron diffraction peaks" 199 // D.F.R Mildner, J.G. Barker & S.R. Kline J. Appl. Cryst. (2011). 44, 1127-1129. 200 // [ doi:10.1107/S0021889811033322 ] 201 // 202 // 2/17/12 SRK 203 // NOTE: the first 2/3 of this code is the 1D code, copied here just to have the beam stop 204 // calculation here, if I decide to implement it. The real calculation is all at the 205 // bottom and is quite compact 206 // 207 // 197 208 // 198 209 // … … 324 335 // ////// this is all new, inclusion of gravity effect into the parallel component 325 336 // perpendicular component is purely geometric, no gravity component 337 // 338 // the shadow factor is calculated as above -so keep the above calculations, even though 339 // most of them are redundant. 340 // 341 326 342 //// // 327 343 Variable yg_d,acc,sdd,ssd,lambda0,DL_L,sig_l 328 344 Variable var_qlx,var_qly,var_ql,qx,qy,sig_perp,sig_para, sig_para_new 345 329 346 G = 981. //! ACCELERATION OF GRAVITY, CM/SEC^2 330 347 acc = vz_1 // 3.956E5 //! CONVERT WAVELENGTH TO VELOCITY CM/SEC … … 336 353 YG_d = -0.5*G*SDD*(SSD+SDD)*(LAMBDA0/acc)^2 337 354 ///// Print "DISTANCE BEAM FALLS DUE TO GRAVITY (CM) = ",YG 355 // Print "Gravity q* = ",-2*pi/lambda0*2*yg_d/sdd 338 356 339 357 sig_perp = kap*kap/12 * (3*(S1/L1)^2 + 3*(S2/LP)^2 + (proj_DDet/L2)^2) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/WriteQIS.ipf
r832 r838 777 777 Redimension/N=(pixelsX*pixelsY) qx_val,qy_val,z_val 778 778 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 789 780 790 781 Variable L2 = rw[18] … … 796 787 Variable usingLenses = rw[28] //new 2007 797 788 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 798 824 //Two parameters DDET and APOFF are instrument dependent. Determine 799 825 //these from the instrument name in the header. … … 819 845 // generate my own error wave for I(qx,qy) 820 846 // // sw = 0.05*sw // uniform 5% error? tends to favor the low intensity too strongly 821 // after t ehSQRT(), get rid of the "bad" errors by replacing the NaN, Inf, and zero with V_avg847 // after the SQRT(), get rid of the "bad" errors by replacing the NaN, Inf, and zero with V_avg 822 848 // THIS IS EXTREMEMLY IMPORTANT - if this is not done, there are some "bad" values in the 823 849 // error wave (things that are not numbers) - and this wrecks the smeared model fitting.
Note: See TracChangeset
for help on using the changeset viewer.