Changeset 901 for sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
- Timestamp:
- Feb 22, 2013 3:21:48 PM (10 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/CatVSTable.ipf
r898 r901 49 49 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:XCenter" 50 50 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:YCenter" 51 Make/O/B/N=0 $"root:myGlobals:CatVSHeaderInfo:nGuides" 52 Make/O/B/N=0 $"root:myGlobals:CatVSHeaderInfo:NumAttens" 51 // Make/O/B/N=0 $"root:myGlobals:CatVSHeaderInfo:nGuides" 52 // Make/O/B/N=0 $"root:myGlobals:CatVSHeaderInfo:NumAttens" 53 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:nGuides" 54 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:NumAttens" 53 55 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:RunNumber" 54 56 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:IsTrans" … … 78 80 WAVE XCenter = $"root:myGlobals:CatVSHeaderInfo:XCenter" 79 81 WAVE YCenter = $"root:myGlobals:CatVSHeaderInfo:YCenter" 80 WAVE/B nGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 81 WAVE/B NumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 82 // WAVE/B nGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 83 // WAVE/B NumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 84 WAVE nGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 85 WAVE NumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 82 86 WAVE RunNumber = $"root:myGlobals:CatVSHeaderInfo:RunNumber" 83 87 WAVE IsTrans = $"root:myGlobals:CatVSHeaderInfo:IsTrans" … … 220 224 Wave GXCenter = $"root:myGlobals:CatVSHeaderInfo:XCenter" 221 225 Wave GYCenter = $"root:myGlobals:CatVSHeaderInfo:YCenter" 222 Wave/B GNumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 223 Wave/B GNumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 226 // Wave/B GNumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 227 // Wave/B GNumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 228 Wave GNumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 229 Wave GNumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 224 230 Wave GRunNumber = $"root:myGlobals:CatVSHeaderInfo:RunNumber" 225 231 Wave GIsTrans = $"root:myGlobals:CatVSHeaderInfo:IsTrans" … … 266 272 Wave XCenter = $"root:myGlobals:CatVSHeaderInfo:XCenter" 267 273 Wave YCenter = $"root:myGlobals:CatVSHeaderInfo:YCenter" 268 Wave/B NumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 269 Wave/B NumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 274 // Wave/B NumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 275 // Wave/B NumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 276 Wave NumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 277 Wave NumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 270 278 Wave RotAngle = $"root:myGlobals:CatVSHeaderInfo:RotAngle" 271 279 Wave Temperature = $"root:myGlobals:CatVSHeaderInfo:Temperature" … … 328 336 Wave GXCenter = $"root:myGlobals:CatVSHeaderInfo:XCenter" 329 337 Wave GYCenter = $"root:myGlobals:CatVSHeaderInfo:YCenter" 330 Wave/B GNumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 331 Wave/B GNumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 338 // Wave/B GNumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 339 // Wave/B GNumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 340 Wave GNumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 341 Wave GNumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 332 342 Wave GRunNumber = $"root:myGlobals:CatVSHeaderInfo:RunNumber" 333 343 Wave GIsTrans = $"root:myGlobals:CatVSHeaderInfo:IsTrans" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MC_SimulationScripting.ipf
r899 r901 105 105 // -- scattering from an empty cell is NOT provided in 2D 106 106 107 xMenu "Macros"107 Menu "Macros" 108 108 Submenu "Simulation Scripting - Beta" 109 109 "Save Configuration",Sim_saveConfProc() -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf
r898 r901 406 406 xCtr = inputWave[3] 407 407 yCtr = inputWave[4] 408 // xCtr += 1 409 // yCtr += 1 408 410 sdd = inputWave[5] 409 411 pixSize = inputWave[6] … … 587 589 // so get it from the wave scaling instead 588 590 Q0 =left + binarysearchinterp(ran_dev,abs(enoise(1)))*delta 589 theta = Q0/2/Pi*currWavelength //SAS approximation. 1% error at theta=30 deg (theta/2=15deg) 591 // theta = Q0/2/Pi*currWavelength //SAS approximation. 1% error at theta=30 deg (theta/2=15deg) 592 theta = 2*asin(Q0*currWavelength/4/pi) //exact 590 593 591 594 //Print "q0, theta = ",q0,theta … … 651 654 if(xPixel != -1 && yPixel != -1) 652 655 //if(index==1) // only the single scattering events 653 if( xPixel > 127 || yPixel > 127 )656 if( xPixel > 127 || yPixel > 127 || xPixel < 0 || yPixel < 0) 654 657 print "error XY=",xPixel,yPixel 655 658 endif … … 891 894 892 895 893 // xCtr and yCtr here are the "optical" center of the detector ~(6 5,65) and the full fall due to896 // xCtr and yCtr here are the "optical" center of the detector ~(64,64) and the full fall due to 894 897 // gravity is calculated from this horizontal axis 898 // 899 // -- be sure to subtract 1 from xCtr and yCtr here to convert to array (pixel) units. As 900 // passed in, xCtr and yCtr are in detector coordinates 895 901 // 896 902 ThreadSafe Function FindPixel(testQ,testPhi,lam,yg_d,sdd,pixSize,xCtr,yCtr,xPixel,yPixel) 897 903 Variable testQ,testPhi,lam,yg_d,sdd,pixSize,xCtr,yCtr,&xPixel,&yPixel 898 904 899 Variable theta,dy,dx,qx,qy 905 Variable theta,dy,dx,qx,qy,qz 906 907 theta = 2*asin(testQ*lam/4/pi) 908 900 909 //decompose to qx,qy 901 qx = testQ*cos(testPhi) 902 qy = testQ*sin(testPhi) 903 910 qx = testQ*cos(theta/2)*cos(testPhi) 911 qy = testQ*cos(theta/2)*sin(testPhi) 912 qz = testQ*sin(theta/2) 913 904 914 // correct qy for gravity 905 915 // qy = 4*pi/lam * (theta/2) … … 910 920 theta = 2*asin(qy*lam/4/pi) 911 921 dy = sdd*tan(theta) 922 // dy += 912 923 yPixel = round(yCtr + dy/pixSize) 913 924 … … 919 930 NVAR pixelsY = root:myGlobals:gNPixelsY 920 931 932 xPixel -= 1 933 yPixel -= 1 934 935 921 936 //if on detector, return xPix and yPix values, otherwise -1 922 937 if(yPixel >= pixelsY || yPixel < 0) … … 929 944 return(0) 930 945 End 946 947 //// xCtr and yCtr here are the "optical" center of the detector ~(64,64) and the full fall due to 948 //// gravity is calculated from this horizontal axis 949 //// 950 //// -- be sure to subtract 1 from xCtr and yCtr here to convert to array (pixel) units. As 951 //// passed in, xCtr and yCtr are in detector coordinates 952 //// 953 //ThreadSafe Function FindPixel(testQ,testPhi,lam,yg_d,sdd,pixSize,xCtr,yCtr,xPixel,yPixel) 954 // Variable testQ,testPhi,lam,yg_d,sdd,pixSize,xCtr,yCtr,&xPixel,&yPixel 955 // 956 // Variable theta,dy,dx,qx,qy 957 // 958 //// theta = 2*asin(testQ*lam/4/pi) 959 // 960 // //decompose to qx,qy 961 // qx = testQ*cos(testPhi) 962 // qy = testQ*sin(testPhi) 963 // 964 //// correct qy for gravity 965 //// qy = 4*pi/lam * (theta/2) 966 // qy += 4*pi/lam*(yg_d/sdd/2) 967 // 968 // 969 // //convert qx,qy to pixel locations relative to # of pixels x, y from center 970 // theta = 2*asin(qy*lam/4/pi) 971 // dy = sdd*tan(theta) 972 // yPixel = round(yCtr + dy/pixSize) 973 // 974 // theta = 2*asin(qx*lam/4/pi) 975 // dx = sdd*tan(theta) 976 // xPixel = round(xCtr + dx/pixSize) 977 // 978 // NVAR pixelsX = root:myGlobals:gNPixelsX 979 // NVAR pixelsY = root:myGlobals:gNPixelsY 980 // 981 // xPixel -= 1 982 // yPixel -= 1 983 // 984 // 985 // //if on detector, return xPix and yPix values, otherwise -1 986 // if(yPixel >= pixelsY || yPixel < 0) 987 // yPixel = -1 988 // endif 989 // if(xPixel >= pixelsX || xPixel < 0) 990 // xPixel = -1 991 // endif 992 // 993 // return(0) 994 //End 931 995 932 996 Function MC_CheckFunctionAndCoef(funcStr,coefStr) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf
r899 r901 1761 1761 Variable atten_err, attenFactor 1762 1762 1763 // 22 FEB 2013 - not sure what changed with the writeout of ICE data files... but .... 1764 // to account for ICE occasionally writing out "3" as 2.9998, make sure I can construct 1765 // a single digit -> string "3" to identify the proper wave in the lookup table 1766 1767 attenNo = round(attenNo) 1768 1763 1769 strswitch(instr) 1764 1770 case "CGB": … … 1813 1819 Variable attenFactor=1,loc 1814 1820 String instr=fileStr[1,3] //filestr is "[NGnSANSn] " or "[NGnSANSnn]" (11 characters total) 1815 1821 1822 1823 // 22 FEB 2013 - not sure what changed with the writeout of ICE data files... but .... 1824 // to account for ICE occasionally writing out "3" as 2.9998, make sure I can construct 1825 // a single digit -> string "3" to identify the proper wave in the lookup table 1826 1827 attenNo = round(attenNo) 1828 1829 1816 1830 strswitch(instr) 1817 1831 case "CGB": -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ProDiv.ipf
r899 r901 371 371 372 372 373 // reduce the off-center, keep in STO373 // reduce the off-center, keep in COR 374 374 //patch trans 375 375 num = ItemsInList(gPlex_off, ",") … … 393 393 if(strlen(str) > 0) 394 394 proto[1] = str 395 err = CheckDIVBeamCenter(str,1 05,65)395 err = CheckDIVBeamCenter(str,110,65) 396 396 if(err) 397 397 Abort "Off-center EMP files do not have correct beam center" … … 402 402 str = ParseRunNumberList(gPlex_off) 403 403 if(strlen(str) > 0) 404 err = CheckDIVBeamCenter(str,1 05,65)404 err = CheckDIVBeamCenter(str,110,65) 405 405 if(err) 406 Abort "O n-center EMPfiles do not have correct beam center"406 Abort "Off-center PLEX files do not have correct beam center" 407 407 endif 408 408 ExecuteProtocol("root:myGlobals:Protocols:DIV_Protocol",str) … … 580 580 Variable xc,yc 581 581 582 Variable err,ii,num,tmpX,tmpY,badCtr,tol= 5582 Variable err,ii,num,tmpX,tmpY,badCtr,tol=10 583 583 String fileStr,pathStr,acct 584 584 … … 592 592 // get the account, to identify the instrument 593 593 fileStr = pathStr + StringFromList(ii, str,",") 594 acct = getAcctName(fileStr)595 String instr=acct[1,3] //filestr is "[NGnSANSn] " or "[NGnSANSnn]" (11 characters total)596 if(cmpstr(instr,"NGA")==0 || cmpstr(instr,"NGB")==0 )597 tol=20 //if the 10m SANS, give an extra-wide tolerance, and show an alert598 DoAlert 0,"NGB SANS instrument. Be sure that the correct beam centers are entered for all of the plex files."599 endif594 // acct = getAcctName(fileStr) 595 // String instr=acct[1,3] //filestr is "[NGnSANSn] " or "[NGnSANSnn]" (11 characters total) 596 // if(cmpstr(instr,"NGA")==0 || cmpstr(instr,"NGB")==0 ) 597 // tol=20 //if the 10m SANS, give an extra-wide tolerance, and show an alert 598 // DoAlert 0,"NGB SANS instrument. Be sure that the correct beam centers are entered for all of the plex files." 599 // endif 600 600 601 601 do -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SASCALC.ipf
r899 r901 2145 2145 rw[19] = val // already in cm 2146 2146 //move the beamcenter, make it an integer value for the MC simulation 2147 rw[16] = 64 + round(2*rw[19]) + 0.5 //approximate beam X is 64 w/no offset, 114 w/25 cm offset2148 rw[17] = 64 + 0.5 //typical value2147 rw[16] = 64 + round(2*rw[19]) //+ 0.5 //approximate beam X is 64 w/no offset, 114 w/25 cm offset 2148 rw[17] = 64 //+ 0.5 //typical value 2149 2149 2150 2150 return(val)
Note: See TracChangeset
for help on using the changeset viewer.