- Timestamp:
- Feb 28, 2012 4:51:26 PM (10 years ago)
- Location:
- sans/Dev/trunk
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Cubes_Includes.ipf
r836 r838 26 26 Submenu "Matrix Info" 27 27 "Number of Points" 28 "Fill Statistics" 28 // "Fill Statistics" //only valid for concentrated spheres... 29 29 "Center_to_Center" 30 30 "Davg_to_Np" -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Fit_3Cyl_KR.ipf
r798 r838 109 109 NVAR FFT_N = root:FFT_N 110 110 NVAR FFT_SolventSLD = root:FFT_SolventSLD 111 112 FFT_SolventSLD = trunc(sldSolv*1e6) //spits back an integer, maybe not correct 111 NVAR FFT_delRho = root:FFT_delRho //the SLD multiplier, should have been initialized to 1e-7 112 113 FFT_SolventSLD = trunc(sldSolv/FFT_delRho) //spits back an integer, maybe not correct 113 114 114 115 // generate the matrix and erase it -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Panel.ipf
r836 r838 11 11 // put the SLD multiplier on the panel somewhere - only 2 values are allowed - so use 12 12 // radio buttons, or just display the value of the global, make the change at the command 13 // line -- or keep the multiplier at 10^-7 and always use 2 digits 13 // line -- or keep the multiplier at 10^-7 and always use 2 digits (10^-7 is probably 14 // better to use, just to allow more flexibility from the start). 15 16 // TO DO: 17 // -- I need to change a lot of routines (most notably Gizmo) to take "10" as the default SLD 18 // rather than "1" 14 19 // 15 20 //////////// … … 51 56 52 57 Variable/G root:FFT_SolventSLD = 0 53 Variable/G root:FFT_delRho = 1e- 6//multiplier for SLD (other value is 1e-7)58 Variable/G root:FFT_delRho = 1e-7 //multiplier for SLD (other value is 1e-7) 54 59 55 60 FFT_Qmax :=2*pi/FFT_T … … 104 109 Button FFTButton_12,disable=2 // hide this button 105 110 Button FFTButton_13,pos={14,109},size={120,20},proc=FFTFillSolventMatrixProc,title="Solvent Matrix" 106 SetVariable FFTSetVar_5,pos={155,111},size={150,15},title="Solvent SLD (10^- 6)"111 SetVariable FFTSetVar_5,pos={155,111},size={150,15},title="Solvent SLD (10^-7)" 107 112 SetVariable FFTSetVar_5,limits={-99,99,1},value= FFT_SolventSLD,live= 1 108 113 Button FFTButton_15,pos={209,430},size={90,20},proc=Interp2DSliceButton,title="Interp 2D" … … 118 123 case 2: 119 124 // click code here 120 DisplayHelpTopic/Z/K=1 "Real-Space Modeling "125 DisplayHelpTopic/Z/K=1 "Real-Space Modeling of SANS Data" 121 126 if(V_flag !=0) 122 127 DoAlert 0,"The Real-Space Modeling Help file could not be found" -
sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtils2D_v40.ipf
r794 r838 1039 1039 1040 1040 fDoBinning_QxQy2D(folderStr) 1041 1042 SetDataFolder $("root:"+folderStr) 1043 Display iBin_qxqy vs qBin_qxqy 1044 ModifyGraph mirror=2,grid=1,log=1 1045 ModifyGraph mode=4,marker=19,msize=2 1046 ErrorBars/T=0 iBin_qxqy Y,wave=(eBin2D_qxqy,eBin2D_qxqy) 1047 legend 1048 1049 SetDataFolder root: 1041 1050 End 1042 1051 … … 1052 1061 SetDataFolder $("root:"+folderStr) 1053 1062 1054 WAVE inten = $("smeared_sf2D")1055 1056 //WAVE inten = $(folderStr + "_i")1063 // WAVE inten = $("smeared_sf2D") 1064 1065 WAVE inten = $(folderStr + "_i") 1057 1066 WAVE iErr = $(folderStr + "_iErr") 1058 1067 WAVE qx = $(folderStr + "_qx") -
sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf
r814 r838 1194 1194 list = RemoveFromList("FillYZCircle;FillZCylinder;PadMatrix;RandomFill3DMat;RandomPoints2D;SobolFill3DMat;SphereAtEachPoint;UnConnectedRodFill;XYZV_toByteVoxels;",list,";") 1195 1195 list = RemoveFromList("MakeTriplet;SobolPoints2D;X_CylindersAtPoints;X_CylindersHexagonalGrid;X_CylindersSquareGrid;maxDistance_Threaded;KR_MultiCylinder;",list,";") 1196 list = RemoveFromList("X_CoreShellCylinderHexGrid;",list,";") 1196 1197 1197 1198 -
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 -
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.