- Timestamp:
- Nov 6, 2009 5:50:45 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf
r597 r598 1098 1098 Endif 1099 1099 1100 NVAR actSimTime = root:Packages:NIST:SAS:g_actSimTime 1101 String str = "" 1102 sprintf str,"%30s\t\t%g seconds\r","MonteCarlo Simulation time = ",actSimTime 1103 1100 1104 Open refNum as fullpath+".txt" 1101 1105 wfprintf refNum, "%30s\t\t%g\r",results_desc,results 1106 FBinWrite refNum,str 1102 1107 FStatus refNum 1103 1108 FSetPos refNum,V_logEOF … … 1239 1244 t0 *= imon/1000/ThreadProcessorCount //projected time, in seconds (using threads for the calculation) 1240 1245 1246 Print "Estimated Simulation time (s) = ",t0 1247 1241 1248 // to correct for detector efficiency, send only the fraction of neutrons that are actually counted 1242 1249 NVAR detectorEff = root:Packages:NIST:SAS:g_detectorEff 1250 NVAR actSimTime = root:Packages:NIST:SAS:g_actSimTime 1251 NVAR SimTimeWarn = root:Packages:NIST:SAS:g_SimTimeWarn 1243 1252 1244 1253 inputWave[0] = imon * detectorEff //reset number of input neutrons before full simulation 1245 1254 1246 if(t0> 10)1255 if(t0>SimTimeWarn) 1247 1256 sprintf str,"The simulation will take approximately %d seconds.\r- Proceed?",t0 1248 1257 DoAlert 1,str … … 1268 1277 t0 = (stopMSTimer(-2) - t0)*1e-6 1269 1278 Printf "MC sim time = %g seconds\r",t0 1279 actSimTime = t0 1270 1280 1271 1281 trans = results[8] //(n1-n2)/n1 … … 1307 1317 if(!rawCts) //go ahead and do the linear scaling 1308 1318 linear_data = linear_data / kappa 1319 linear_data /= detectorEff 1309 1320 endif 1310 1321 data = linear_data … … 1781 1792 sigave[10,50;10] = 10*sigave[p] 1782 1793 1783 // convert to absolute scale 1794 // convert to absolute scale, remembering to un-correct for the detector efficiency 1784 1795 if(doABS) 1785 1796 Variable kappa = thick*(pixSize/sdd)^2*trans*iMon 1786 1797 aveint /= kappa 1787 1798 sigave /= kappa 1799 aveint /= detectorEff 1800 sigave /= detectorEff 1788 1801 endif 1789 1802 … … 1837 1850 //Function Script_2DMC() 1838 1851 // 1852 // 1853 // NVAR SimTimeWarn = root:Packages:NIST:SAS:g_SimTimeWarn 1854 // SimTimeWarn = 36000 //sets the threshold for the warning dialog to 10 hours 1839 1855 // STRUCT WMButtonAction ba 1840 1856 // ba.eventCode = 2 //fake mouse click on button 1841 1857 // 1842 1858 // NVAR detDist = root:Packages:NIST:SAS:gDetDist 1843 // 1859 // 1844 1860 // detDist = 200 //set directly in cm 1845 1861 // MC_DoItButtonProc(ba) … … 1854 1870 // SaveAsVAXButtonProc("",runIndex=107,simLabel="this is run 107, SDD = 400") 1855 1871 // 1872 // 1873 // SimTimeWarn = 10 //back to 10 seconds for manual operation 1856 1874 // return(0) 1857 1875 //end
Note: See TracChangeset
for help on using the changeset viewer.