 Timestamp:
 Nov 3, 2008 12:48:40 PM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SASCALC.ipf
r431 r434 106 106 Variable/G root:Packages:NIST:SAS:gThick = 0.1 107 107 Variable/G root:Packages:NIST:SAS:gSig_incoh = 0.1 108 String/G root:Packages:NIST:SAS:gFuncStr = " SphereForm"108 String/G root:Packages:NIST:SAS:gFuncStr = "" 109 109 Variable/G root:Packages:NIST:SAS:gR2 = 2.54/2 110 110 Variable/G root:Packages:NIST:SAS:gDoMonteCarlo = 0 111 111 Make/O/D/N=10 root:Packages:NIST:SAS:results = 0 112 Make/O/T/N=10 root:Packages:NIST:SAS:results_desc = {"total Xsection (1/cm)","SAS Xsection (1/cm)"," # reaching detector","fraction reaching detector","# that interact","fraction singly scattered","fraction transmitted","","",""}112 Make/O/T/N=10 root:Packages:NIST:SAS:results_desc = {"total Xsection (1/cm)","SAS Xsection (1/cm)","number that scatter","number that reach detector","avg # times scattered","fraction single coherent","fraction double coherent","fraction multiple scattered","fraction transmitted",""} 113 113 114 114 //tick labels for SDD slider … … 711 711 inputWave[10] = sig_sas 712 712 713 //initialize ran1 in the XOP by passing a negative integer 714 // does nothing in the Igor code 715 results[0] = 1*trunc(datetime)/10 716 717 // Variable t0 = stopMStimer(2) 718 719 #if exists("Monte_SANSX") 720 Monte_SANSX(inputWave,ran_dev,nt,j1,j2,nn,linear_data,results) 721 #else 722 Monte_SANS(inputWave,ran_dev,nt,j1,j2,nn,linear_data,results) 723 #endif 724 // t0 = (stopMSTimer(2)  t0)*1e6 725 // Printf "Mc sim time = %g seconds\r\r",t0 713 Variable t0 = stopMStimer(2) 714 715 // threading crashes  there must be some operation in the XOP that is not threadSafe. What, I don't know... 716 // xMonte_SANS_Threaded(inputWave,ran_dev,nt,j1,j2,nn,linear_data,results) 717 Monte_SANS_NotThreaded(inputWave,ran_dev,nt,j1,j2,nn,linear_data,results) 718 719 t0 = (stopMSTimer(2)  t0)*1e6 720 Printf "MC sim time = %g seconds\r\r",t0 726 721 722 Variable trans 723 trans = results[8] //(n1n2)/n1 724 727 725 // convert to absolute scale 728 726 Variable kappa,beaminten = beamIntensity() 729 // results[6] is the fraction transmitted 730 // kappa = beamInten*pi*r1*r1*thick*(pixSize/sdd)^2*results[6]*(iMon/beaminten) 731 kappa = thick*(pixSize/sdd)^2*results[6]*iMon 727 // kappa = beamInten*pi*r1*r1*thick*(pixSize/sdd)^2*trans*(iMon/beaminten) 728 kappa = thick*(pixSize/sdd)^2*trans*iMon 732 729 733 730 linear_data = linear_data / kappa 734 731 linear_data[xCtr][yCtr] = 0 //snip out the transmitted spike 735 732 data = linear_data 736 733 734 // print sum(linear_data), kappa 735 737 736 endif 738 737 … … 1567 1566 NVAR val = root:Packages:NIST:SAS:gOffset 1568 1567 rw[19] = val // already in cm 1569 //move the beamcenter 1570 rw[16] = 64 + 2*rw[19] //approximate beam X is 64 w/no offset, 114 w/25 cm offset1568 //move the beamcenter, make it an integer value for the MC simulation 1569 rw[16] = 64 + round(2*rw[19]) //approximate beam X is 64 w/no offset, 114 w/25 cm offset 1571 1570 rw[17] = 64 //typical value 1572 1571
Note: See TracChangeset
for help on using the changeset viewer.