 Timestamp:
 Apr 14, 2009 3:31:17 PM (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf
r475 r490 426 426 // so get it from the wave scaling instead 427 427 Q0 =left + binarysearchinterp(ran_dev,abs(enoise(1)))*delta 428 theta = Q0/2/Pi*wavelength //SAS approximation 428 theta = Q0/2/Pi*wavelength //SAS approximation. 1% error at theta=30 deg (theta/2=15deg) 429 429 430 430 //Print "q0, theta = ",q0,theta … … 520 520 // then it must be a transmitted neutron 521 521 // don't need to calculate, just increment the proper counters 522 MC_linear_data[xCtr][yCtr] += 1 522 523 MC_linear_data[xCtr+xx/pixsize][yCtr+yy/pixsize] += 1 523 524 isOn += 1 524 525 nt[0] += 1 … … 922 923 CheckBox check0,pos={216,180},size={68,14},title="Raw counts",variable = root:Packages:NIST:SAS:gRawCounts 923 924 CheckBox check0_1,pos={216,199},size={60,14},title="Yes Offset",variable= root:Packages:NIST:SAS:gDoTraceOffset 925 CheckBox check0_2,pos={216,199+19},size={60,14},title="Beam Stop in",variable= root:Packages:NIST:SAS:gBeamStopIn 926 CheckBox check0_3,pos={216,199+2*19},size={60,14},title="use XOP",variable= root:Packages:NIST:SAS:gUse_MC_XOP 924 927 925 928 String fldrSav0= GetDataFolder(1) … … 1064 1067 End 1065 1068 1066 1069 // calculates the fraction of the scattering that reaches the detector, given the random deviate function 1070 // and qmin and qmax 1071 // 1072 // 1073 // still some question of the corners and number of pixels per qbin 1074 Function FractionReachingDetector(ran_dev,Qmin,Qmax) 1075 wave ran_dev 1076 Variable Qmin,Qmax 1077 1078 Variable r1,r2,frac 1079 r1=x2pnt(ran_dev,Qmin) 1080 r2=x2pnt(ran_dev,Qmax) 1081 1082 // no normalization needed  the full qrange is defined as [0,1] 1083 frac = ran_dev[r2]  ran_dev[r1] 1084 1085 return frac 1086 End 1067 1087 1068 1088
Note: See TracChangeset
for help on using the changeset viewer.