Changeset 545
- Timestamp:
- Aug 7, 2009 2:00:32 PM (13 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SASCALC.ipf
r542 r545 908 908 909 909 Wave inten=$"root:Simulation:Simulation_i" // this will exist and send the smeared calculation to the corect DF 910 911 // the resolution-smeared intensity is calculated, including the incoherent background 910 912 func($coefStr,inten,qval) 911 913 … … 932 934 Variable sig_sas=0 933 935 936 // remember that the random deviate is the coherent portion ONLY - the incoherent background is 937 // subtracted before the calculation. 934 938 CalculateRandomDeviate(funcUnsmeared,$coefStr,wavelength,"root:Packages:NIST:SAS:ran_dev",sig_sas) 935 939 … … 940 944 Print "Sig_sas = ",sig_sas 941 945 942 Duplicate/O qval prob_i,circle_fraction,rval,nCells_expected 943 rval = sdd*tan(2*asin(qval*wavelength/4/pi)) //radial distance in cm 944 nCells_expected = 2*pi*rval/pixSize //does this need to be an integer? 945 circle_fraction = nCells / nCells_expected 946 Duplicate/O qval prob_i,countsInAnnulus 947 948 // not needed - nCells takes care of this when the error is correctly calculated 949 // Duplicate/O qval circle_fraction,rval,nCells_expected 950 // rval = sdd*tan(2*asin(qval*wavelength/4/pi)) //radial distance in cm 951 // nCells_expected = 2*pi*rval/pixSize //does this need to be an integer? 952 // circle_fraction = nCells / nCells_expected 946 953 947 954 948 prob_i = trans*thick*nCells*(pixSize/sdd)^2*inten //probability of a neutron in q-bin(i) that has nCells 955 // prob_i = trans*thick*nCells*(pixSize/sdd)^2*inten //probability of a neutron in q-bin(i) that has nCells 956 prob_i = trans*thick*(pixSize/sdd)^2*inten //probability of a neutron in q-bin(i) 949 957 950 958 Variable P_on = sum(prob_i,-inf,inf) 951 959 Print "P_on = ",P_on 952 fracScat = P_on953 960 954 aveint = (Imon*ctTime)*prob_i / circle_fraction / nCells_expected 955 956 SimDetCts = sum(aveint,-inf,inf) 961 // fracScat = P_on 962 fracScat = 1-estTrans 963 964 // aveint = (Imon*ctTime)*prob_i / circle_fraction / nCells_expected 965 aveint = (Imon*ctTime)*prob_i 966 967 countsInAnnulus = aveint*nCells 968 SimDetCts = sum(countsInAnnulus,-inf,inf) 957 969 estDetCR = SimDetCts/SimCountTime 958 970 … … 961 973 NVAR addNoise = root:Packages:NIST:SAS:g_1D_AddNoise 962 974 963 sigave = sqrt(aveint ) // assuming that N is large975 sigave = sqrt(aveint/nCells) // corrected based on John's memo, from 8/9/99 964 976 965 977 // add in random error in aveint based on the sigave -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Transmission.ipf
r502 r545 1615 1615 // apply TWO criteria 1616 1616 // (1) the label must match "well enough" 1617 // (2) the wavelength must be the same 1617 // (2) the wavelength must be the same "enough", given the unnecessary precision reported by ICE 1618 // 1619 // (for example, "6" can be anything from 6.0008 to 6.0020 in a recent experiment) 1618 1620 // 1619 1621 // passes the matching rows in the sample table back … … 1630 1632 Wave tLam = root:myGlobals:TransHeaderInfo:T_Lambda //Transmission file wavelength 1631 1633 1632 Variable num,ii,found 1634 Variable num,ii,found,tolerance=0.01 //0.01 = 1% tolerance 1633 1635 String transStr = "",testStr="" 1634 1636 … … 1642 1644 testStr=sw[ii] 1643 1645 found = stringmatch(testStr, transStr ) 1644 if( (found == 1) && ( sLam[ii] == tLam[row]) ) // both must match1646 if( (found == 1) && (abs(sLam[ii] - tLam[row]) < tolerance) ) // both must match 1645 1647 Print "Match Found at: ",transStr,snam[ii],sw[ii] 1646 1648 InsertPoints numpnts(matchRows), 1, matchRows
Note: See TracChangeset
for help on using the changeset viewer.