Changeset 816 for sans/Dev/trunk/NCNR_User_Procedures
- Timestamp:
- Jul 13, 2011 3:02:15 PM (12 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures
- Files:
-
- 5 added
- 4 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Debye_Spheres.ipf
r798 r816 838 838 // make a lookup table to get from rho@xyz to the index 839 839 Variable maxSLD = WaveMax(SLD_id) 840 Make/O/D/N=(maxSLD+1) SLDlookup 840 Variable minSLD = abs(WaveMin(SLD_id)) 841 // Make/O/D/N=(maxSLD+1) SLDlookup 842 Make/O/D/N=(maxSLD+minSLD+1) SLDlookup 841 843 SLDLookup = NaN 842 844 ii=0 843 845 do 844 SLDLookup[SLD_id[ii] ] = ii846 SLDLookup[SLD_id[ii]+minSLD] = ii 845 847 ii+=1 846 848 while(ii<numpnts(SLD_id)) … … 880 882 rhoi = rho[ii] 881 883 // find the Nij. Not sure if these are what I really need... 882 PSFIndex = psf_id_mat[ SLDLookup[rhoi ] ][ SLDlookup[rhoi] ]884 PSFIndex = psf_id_mat[ SLDLookup[rhoi+minSLD] ][ SLDlookup[rhoi+minSLD] ] 883 885 Nij[PSFIndex] += 1 //these are just the Ni counts 884 886 endfor … … 887 889 // t1 = ticks 888 890 889 // this is the double loop that has been XOPed891 ////// this is the double loop that has been XOPed 890 892 // for(ii=0;ii<num;ii+=1) 891 893 // for(kk=(ii+1);kk<num;kk+=1) … … 898 900 // rhoi = rho[ii] 899 901 // rhok = rho[kk] 900 // PSFIndex = psf_id_mat[ SLDLookup[rhoi ] ][ SLDlookup[rhok] ]902 // PSFIndex = psf_id_mat[ SLDLookup[rhoi+minSLD] ][ SLDlookup[rhok+minSLD] ] 901 903 // binMatrix[binIndex][PSFIndex] += 1 902 904 // … … 907 909 // binMatrix is returned 908 910 911 912 909 913 nthreads=ThreadProcessorCount 910 914 if(nthreads == 1) 911 binSLDDistanceX(xv, yv, zv, rho, binMatrix, SLDLookup, psf_id_mat, grid, binWidth,0,numpnts(xv))915 binSLDDistanceX(xv, yv, zv, rho, binMatrix, SLDLookup, psf_id_mat, minSLD, grid, binWidth,0,numpnts(xv)) 912 916 else 913 binSLDDistance_SLD_Threaded(xv, yv, zv, rho, binMatrix, SLDLookup, psf_id_mat, grid, binWidth) 914 endif 917 binSLDDistance_SLD_Threaded(xv, yv, zv, rho, binMatrix, SLDLookup, psf_id_mat, minSLD, grid, binWidth) 918 endif 919 920 915 921 916 922 // Printf "binned the distances and SLDs = %g seconds\r",(ticks-t1)/60.15 … … 960 966 // now add up everything to get the intensity 961 967 // use the psf_id_mat[][] to get the Gij index 968 // 969 // 962 970 963 971 vol=4*Pi/3*rval*rval*rval … … 972 980 index = psf_id_mat[ii][ii] 973 981 974 F2Q = fQR*fQR*SLD_id[ii]*SLD_id[ii]*vol*vol 982 // F2Q = fQR*fQR*(SLD_id[ii]-solventSLD)*(SLD_id[ii]-solventSLD)*vol*vol 983 F2Q = fQR*fQR*(SLD_id[ii])*(SLD_id[ii])*vol*vol 975 984 976 985 Iqr[kk] += Nij[index]*F2Q //these are just the "ii" numbers … … 981 990 WAVE Sij = $("root:Sij"+num2str(index)) //switch the Sij 982 991 983 Iqr[kk] += fQR*fQR*SLD_id[ii]*SLD_id[jj]*vol*vol*Sij[kk] //factor of 2 removed, not sure why 992 // Iqr[kk] += fQR*fQR*(SLD_id[ii]-solventSLD)*(SLD_id[jj]-solventSLD)*vol*vol*Sij[kk] //factor of 2 removed, not sure why 993 Iqr[kk] += fQR*fQR*(SLD_id[ii])*(SLD_id[jj])*vol*vol*Sij[kk] //factor of 2 removed, not sure why 984 994 985 995 endfor … … 995 1005 996 1006 // support up to 8 threads at this time 997 Function binSLDDistance_SLD_Threaded(xv, yv, zv, rho, binMatrix, SLDLookup, psf_id_mat, grid, binWidth)1007 Function binSLDDistance_SLD_Threaded(xv, yv, zv, rho, binMatrix, SLDLookup, psf_id_mat, minSLD, grid, binWidth) 998 1008 Wave xv, yv, zv, rho, binMatrix, SLDLookup, psf_id_mat 999 Variable grid, binWidth1009 Variable minSLD, grid, binWidth 1000 1010 1001 1011 Variable nthreads,mt,left,right … … 1032 1042 //Print (ii*num/nthreads),((ii+1)*num/nthreads) 1033 1043 //ThreadStart mt,ii,binDistance_WF(xv, yv, zv, binMatrix0, grid, binWidth,(ii*num/nthreads),((ii+1)*num/nthreads)) 1034 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix0, SLDLookup, psf_id_mat, grid, binWidth, left*num, right*num)1044 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix0, SLDLookup, psf_id_mat, minSLD, grid, binWidth, left*num, right*num) 1035 1045 endif 1036 1046 if(ii==1) 1037 1047 Wave binMatrix1 1038 1048 binMatrix1 = 0 1039 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix1, SLDLookup, psf_id_mat, grid, binWidth, left*num, right*num)1049 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix1, SLDLookup, psf_id_mat, minSLD, grid, binWidth, left*num, right*num) 1040 1050 endif 1041 1051 if(ii==2) 1042 1052 Wave binMatrix2 1043 1053 binMatrix2 = 0 1044 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix2, SLDLookup, psf_id_mat, grid, binWidth, left*num, right*num)1054 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix2, SLDLookup, psf_id_mat, minSLD, grid, binWidth, left*num, right*num) 1045 1055 endif 1046 1056 if(ii==3) 1047 1057 Wave binMatrix3 1048 1058 binMatrix3 = 0 1049 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix3, SLDLookup, psf_id_mat, grid, binWidth, left*num, right*num)1059 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix3, SLDLookup, psf_id_mat, minSLD, grid, binWidth, left*num, right*num) 1050 1060 endif 1051 1061 if(ii==4) 1052 1062 Wave binMatrix4 1053 1063 binMatrix4 = 0 1054 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix4, SLDLookup, psf_id_mat, grid, binWidth, left*num, right*num)1064 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix4, SLDLookup, psf_id_mat, minSLD, grid, binWidth, left*num, right*num) 1055 1065 endif 1056 1066 if(ii==5) 1057 1067 Wave binMatrix5 1058 1068 binMatrix5 = 0 1059 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix5, SLDLookup, psf_id_mat, grid, binWidth, left*num, right*num)1069 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix5, SLDLookup, psf_id_mat, minSLD, grid, binWidth, left*num, right*num) 1060 1070 endif 1061 1071 if(ii==6) 1062 1072 Wave binMatrix6 1063 1073 binMatrix6 = 0 1064 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix6, SLDLookup, psf_id_mat, grid, binWidth, left*num, right*num)1074 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix6, SLDLookup, psf_id_mat, minSLD, grid, binWidth, left*num, right*num) 1065 1075 endif 1066 1076 if(ii==7) 1067 1077 Wave binMatrix7 1068 1078 binMatrix7 = 0 1069 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix7, SLDLookup, psf_id_mat, grid, binWidth, left*num, right*num)1079 ThreadStart mt,ii,binDistance_SLD_WF(xv, yv, zv, rho, binMatrix7, SLDLookup, psf_id_mat, minSLD, grid, binWidth, left*num, right*num) 1070 1080 endif 1071 1081 … … 1116 1126 1117 1127 // this is just a worker function to get the ThreadStart operation to compile 1118 ThreadSafe Function binDistance_SLD_WF(xv, yv, zv, rho, binMatrix, SLDLookup, psf_id_mat, grid, binWidth, p1,p2)1128 ThreadSafe Function binDistance_SLD_WF(xv, yv, zv, rho, binMatrix, SLDLookup, psf_id_mat, minSLD, grid, binWidth, p1,p2) 1119 1129 Wave xv, yv, zv, rho, binMatrix, SLDLookup, psf_id_mat 1120 Variable grid, binWidth, p1,p21130 Variable minSLD, grid, binWidth, p1,p2 1121 1131 1122 1132 Variable ret 1123 ret = binSLDDistanceX(xv, yv, zv, rho, binMatrix, SLDLookup, psf_id_mat, grid, binWidth, p1,p2)1133 ret = binSLDDistanceX(xv, yv, zv, rho, binMatrix, SLDLookup, psf_id_mat, minSLD, grid, binWidth, p1,p2) 1124 1134 1125 1135 return(0) -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/Models_2D/CoreShellCyl2D_v40.ipf
r794 r816 339 339 340 340 for(i=0;i<nthreads;i+=1) 341 // Print (i*npt/nthreads),((i+1)*npt/nthreads-1)342 ThreadStart mt,i,SmearedCoreShellCylinder2D_T(s.coefW,s.xw[0],s.xw[1],s.qz,s.sQpl,s.sQpp,s.fs,s.zw,wt,xi, (i*npt/nthreads),((i+1)*npt/nthreads-1),nord)341 // Print trunc(i*npt/nthreads),trunc((i+1)*npt/nthreads-1) 342 ThreadStart mt,i,SmearedCoreShellCylinder2D_T(s.coefW,s.xw[0],s.xw[1],s.qz,s.sQpl,s.sQpp,s.fs,s.zw,wt,xi,trunc(i*npt/nthreads),trunc((i+1)*npt/nthreads-1),nord) 343 343 endfor 344 344 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/Models_2D/Cylinder_2D_v40.ipf
r794 r816 374 374 375 375 for(i=0;i<nthreads;i+=1) 376 // Print (i*npt/nthreads),((i+1)*npt/nthreads-1)377 ThreadStart mt,i,SmearedCylinder2D_T(s.coefW,s.xw[0],s.xw[1],s.qz,s.sQpl,s.sQpp,s.fs,s.zw,wt,xi, (i*npt/nthreads),((i+1)*npt/nthreads-1),nord)376 // Print trunc(i*npt/nthreads),trunc((i+1)*npt/nthreads-1) 377 ThreadStart mt,i,SmearedCylinder2D_T(s.coefW,s.xw[0],s.xw[1],s.qz,s.sQpl,s.sQpp,s.fs,s.zw,wt,xi,trunc(i*npt/nthreads),trunc((i+1)*npt/nthreads-1),nord) 378 378 endfor 379 379 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/Models_2D/Ellipsoid2D_v40.ipf
r794 r816 333 333 334 334 for(i=0;i<nthreads;i+=1) 335 // Print (i*npt/nthreads),((i+1)*npt/nthreads-1)336 ThreadStart mt,i,SmearedEllipsoid2D_T(s.coefW,s.xw[0],s.xw[1],s.qz,s.sQpl,s.sQpp,s.fs,s.zw,wt,xi, (i*npt/nthreads),((i+1)*npt/nthreads-1),nord)335 // Print trunc(i*npt/nthreads),trunc((i+1)*npt/nthreads-1) 336 ThreadStart mt,i,SmearedEllipsoid2D_T(s.coefW,s.xw[0],s.xw[1],s.qz,s.sQpl,s.sQpp,s.fs,s.zw,wt,xi,trunc(i*npt/nthreads),trunc((i+1)*npt/nthreads-1),nord) 337 337 endfor 338 338 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/Models_2D/EllipticalCylinder2D_v40.ipf
r794 r816 336 336 337 337 for(i=0;i<nthreads;i+=1) 338 // Print (i*npt/nthreads),((i+1)*npt/nthreads-1)339 ThreadStart mt,i,SmearedEllipticalCyl2D_T(s.coefW,s.xw[0],s.xw[1],s.qz,s.sQpl,s.sQpp,s.fs,s.zw,wt,xi, (i*npt/nthreads),((i+1)*npt/nthreads-1),nord)338 // Print trunc(i*npt/nthreads),trunc((i+1)*npt/nthreads-1) 339 ThreadStart mt,i,SmearedEllipticalCyl2D_T(s.coefW,s.xw[0],s.xw[1],s.qz,s.sQpl,s.sQpp,s.fs,s.zw,wt,xi,trunc(i*npt/nthreads),trunc((i+1)*npt/nthreads-1),nord) 340 340 endfor 341 341 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/Models_2D/PeakGauss2D_v40.ipf
r800 r816 284 284 Variable t1=StopMSTimer(-2) 285 285 286 // print "npt = ",npt 286 287 for(i=0;i<nthreads;i+=1) 287 // Print (i*npt/nthreads),((i+1)*npt/nthreads-1)288 ThreadStart mt,i,SmearPeakGauss2D_T(s.coefW,s.xw[0],s.xw[1],s.qz,s.sQpl,s.sQpp,s.fs,s.zw,wt,xi, (i*npt/nthreads),((i+1)*npt/nthreads-1),nord)288 // Print trunc(i*npt/nthreads),trunc((i+1)*npt/nthreads-1) 289 ThreadStart mt,i,SmearPeakGauss2D_T(s.coefW,s.xw[0],s.xw[1],s.qz,s.sQpl,s.sQpp,s.fs,s.zw,wt,xi,trunc(i*npt/nthreads),trunc((i+1)*npt/nthreads-1),nord) 289 290 endfor 290 291 -
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/Models_2D/Sphere_2D_v40.ipf
r794 r816 303 303 304 304 for(i=0;i<nthreads;i+=1) 305 // Print (i*npt/nthreads),((i+1)*npt/nthreads-1)306 ThreadStart mt,i,SmearedSphere2D_T(s.coefW,s.xw[0],s.xw[1],s.qz,s.sQpl,s.sQpp,s.fs,s.zw,wt,xi, (i*npt/nthreads),((i+1)*npt/nthreads-1),nord)305 // Print trunc(i*npt/nthreads),trunc((i+1)*npt/nthreads-1) 306 ThreadStart mt,i,SmearedSphere2D_T(s.coefW,s.xw[0],s.xw[1],s.qz,s.sQpl,s.sQpp,s.fs,s.zw,wt,xi,trunc(i*npt/nthreads),trunc((i+1)*npt/nthreads-1),nord) 307 307 endfor 308 308 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Include_Polarization.ipf
r805 r816 8 8 // JUN 2011 SRK 9 9 10 #include "PolCorr"11 #include "Pol arizationPanels"12 #include "Pol arizationCorrection"13 #include " FlipperPanel"10 //#include "Pol_PolCorr" 11 #include "Pol_PolarizationPanels" 12 #include "Pol_PolarizationCorrection" 13 #include "Pol_FlipperPanel" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf
r813 r816 1559 1559 NVAR ctTime = root:Packages:NIST:SAS:gCntTime 1560 1560 1561 // make the error wave, if data is exported as qxqy 1562 Duplicate/O linear_data root:Packages:NIST:SAS:linear_data_error 1563 WAVE linear_data_error = root:Packages:NIST:SAS:linear_data_error 1564 linear_data_error = 1 + sqrt(linear_data + 0.75) 1565 1561 1566 if(!rawCts) //go ahead and do the abs scaling to the linear_data 1562 1567 linear_data = linear_data / kappa 1563 1568 linear_data /= detectorEff 1569 linear_data_error /= kappa 1564 1570 endif 1565 1571
Note: See TracChangeset
for help on using the changeset viewer.