Changeset 605
- Timestamp:
- Nov 25, 2009 2:40:15 PM (13 years ago)
- Location:
- sans/Dev/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/CatVSTable.ipf
r588 r605 47 47 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:XCenter" 48 48 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:YCenter" 49 //Make/O/B/N=0 $"root:myGlobals:CatVSHeaderInfo:NumGuides"49 Make/O/B/N=0 $"root:myGlobals:CatVSHeaderInfo:nGuides" 50 50 Make/O/B/N=0 $"root:myGlobals:CatVSHeaderInfo:NumAttens" 51 51 Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:RunNumber" … … 73 73 WAVE XCenter = $"root:myGlobals:CatVSHeaderInfo:XCenter" 74 74 WAVE YCenter = $"root:myGlobals:CatVSHeaderInfo:YCenter" 75 //WAVE/B NumGuides = $"root:myGlobals:CatVSHeaderInfo:NumGuides"75 WAVE/B NumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 76 76 WAVE/B NumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 77 77 WAVE RunNumber = $"root:myGlobals:CatVSHeaderInfo:RunNumber" … … 101 101 ModifyTable width(:myGlobals:CatVSHeaderInfo:Reactorpower)=50 //activate for ILL, June 2008 102 102 #endif 103 104 ModifyTable width(:myGlobals:CatVSHeaderInfo:nGuides)=40 103 105 104 106 ModifyTable width(Point)=0 //JUN04, remove point numbers - confuses users since point != run … … 190 192 Wave GXCenter = $"root:myGlobals:CatVSHeaderInfo:XCenter" 191 193 Wave GYCenter = $"root:myGlobals:CatVSHeaderInfo:YCenter" 192 //Wave/B GNumGuides = $"root:myGlobals:CatVSHeaderInfo:NumGuides"194 Wave/B GNumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 193 195 Wave/B GNumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 194 196 Wave GRunNumber = $"root:myGlobals:CatVSHeaderInfo:RunNumber" … … 202 204 Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GReactPow 203 205 #else 204 Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR 206 // Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR 207 Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,gNumGuides 205 208 #endif 206 209 … … 223 226 Wave XCenter = $"root:myGlobals:CatVSHeaderInfo:XCenter" 224 227 Wave YCenter = $"root:myGlobals:CatVSHeaderInfo:YCenter" 225 //Wave/B NumGuides = $"root:myGlobals:CatVSHeaderInfo:NumGuides"228 Wave/B NumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 226 229 Wave/B NumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 227 230 Wave RotAngle = $"root:myGlobals:CatVSHeaderInfo:RotAngle" … … 235 238 #else 236 239 // original order, magnetic at the end 237 Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR as "Data File Catalog" 240 // Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR as "Data File Catalog" 241 // with numGuides 242 Edit Filenames, Labels, DateAndTime, SDD, Lambda, numGuides, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR as "Data File Catalog" 238 243 // alternate ordering, put the magnetic information first 239 244 // Edit Filenames, Labels, RotAngle, Temperature, Field, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens as "Data File Catalog" … … 270 275 Wave GXCenter = $"root:myGlobals:CatVSHeaderInfo:XCenter" 271 276 Wave GYCenter = $"root:myGlobals:CatVSHeaderInfo:YCenter" 272 //Wave/B GNumGuides = $"root:myGlobals:CatVSHeaderInfo:NumGuides"277 Wave/B GNumGuides = $"root:myGlobals:CatVSHeaderInfo:nGuides" 273 278 Wave/B GNumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 274 279 Wave GRunNumber = $"root:myGlobals:CatVSHeaderInfo:RunNumber" … … 373 378 GReactPow[lastPoint] = getReactorPower(fname) 374 379 #endif 380 381 // number of guides 382 InsertPoints lastPoint,1,GNumGuides 383 GNumGuides[lastPoint] = numGuides(getSourceToSampleDist(fname)) 375 384 376 385 return(0) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf
r598 r605 114 114 mt = ThreadGroupCreate(nthreads) 115 115 NVAR gInitTime = root:Packages:NIST:SAS:gRanDateTime //time that SASCALC was started 116 Print "thread group ID = ",mt116 // Print "thread group ID = ",mt 117 117 118 118 inputWave[0] = NNeutron/nthreads //split up the number of neutrons -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SASCALC.ipf
r598 r605 187 187 // Variable/G c = 0.023 188 188 189 //new values, from 2/2009 190 Variable/G phi_0 = 3.4e13 191 Variable/G b = 0.0185 192 Variable/G c = 0.0135 189 //new values, from 11/2009 --- BeamFluxReport_2009.ifn 190 Variable/G phi_0 = 2.42e13 191 Variable/G b = 0.0 192 Variable/G c = -0.0243 193 Variable/G gGuide_loss = 0.924 193 194 194 195 //fwhm values (new variables) (+3, 0, -3, calibrated 2009) … … 248 249 // Variable/G c = 0.028 249 250 250 //new values, from 6/2009 251 Variable/G phi_0 = 3.2e13 252 Variable/G b = 0.0448 253 Variable/G c = 0.0463 251 //new values, from 11/2009 252 Variable/G phi_0 = 2.55e13 253 Variable/G b = 0.0395 254 Variable/G c = 0.0442 255 Variable/G gGuide_loss = 0.974 254 256 255 257 //fwhm values (new variables) … … 2010 2012 2011 2013 Variable alpha,f,t,t4,t5,t6,as,solid_angle,l1,d2_phi 2012 Variable a1,a2,retVal ,guide_loss=0.952014 Variable a1,a2,retVal 2013 2015 SetDataFolder root:Packages:NIST:SAS 2014 2016 NVAR l_gap=l_gap,guide_width =guide_width,ng = gNg … … 2016 2018 NVAR lambda=gLambda,t1=t1,t2=t2,t3=t3,phi_0=phi_0 2017 2019 NVAR lambda_width=gDeltaLambda 2020 NVAR guide_loss=gGuide_loss 2018 2021 2019 2022 l1 = sourceToSampleDist() -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/WorkFileUtils.ipf
r588 r605 484 484 //rad is the distance of pixel ij from the sample 485 485 //domega is the ratio of the solid angle of pixel ij versus center pixel 486 // product xy = 1 for a detector with a linear spatial response (modern Ordela) 487 // solid angle calculated, dW^3 >=1, so multiply data to raise measured values to correct values. 486 488 rad = sqrt(dtdis2 + xd^2 + yd^2) 487 489 domega = rad/dtdist 488 490 ratio = domega^3 489 // solidAngle[ii][jj] = ratio //testing only490 491 xy = xx[ii]*yy[jj] 491 492 data[ii][jj] *= xy*ratio 493 // solidAngle[ii][jj] = xy*ratio //testing only 494 492 495 493 // multiplicative correctionfor detector efficiency JBG memo det_eff_cor2.doc 3/20/07496 // correction factor for detector efficiency JBG memo det_eff_cor2.doc 3/20/07 494 497 // correction inserted 11/2007 SRK 495 // large angle detector efficiency correction is >= 1 and will "bump up"the highest angles498 // large angle detector efficiency is >= 1 and will "bump up" the measured value at the highest angles 496 499 // so divide here to get the correct answer (5/22/08 SRK) 497 500 if(doEfficiency) … … 501 504 #else 502 505 data[ii][jj] /= DetEffCorr(lambda,dtdist,xd,yd) 503 // solidAngle[ii][jj]= DetEffCorr(lambda,dtdist,xd,yd) //testing only506 // solidAngle[ii][jj] /= DetEffCorr(lambda,dtdist,xd,yd) //testing only 504 507 #endif 505 508 endif 506 509 507 // large angle transmission correction is <= 1 and will "bump up" the highest angles 510 // large angle transmission calculation is <= 1 and will "bump down" the measured value at the highest angles 511 // so divide here to get the correct answer 508 512 if(doTrans) 509 513 … … 520 524 521 525 data[ii][jj] /= LargeAngleTransmissionCorr(trans,dtdist,xd,yd) //moved from 1D avg SRK 11/2007 522 solidAngle[ii][jj]= LargeAngleTransmissionCorr(trans,dtdist,xd,yd) //testing only526 // solidAngle[ii][jj] /= LargeAngleTransmissionCorr(trans,dtdist,xd,yd) //testing only 523 527 endif 524 528 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/COR_Graph.ipf
r577 r605 488 488 Wave/T listW=$(USANSFolder+":Globals:MainPanel:"+type+"Wave") 489 489 Variable ii,num=numpnts(listW) 490 String fname="",fpath="" 490 String fname="",fpath="",str="" 491 491 PathInfo bt5PathName 492 492 fpath = S_Path … … 519 519 Variable pkHt=0 520 520 pkHt = interp(zeroAngle,tmpangle,tmpdetcts) 521 String str="" 521 522 if(numtype(pkHt) != 0) // bad but it warns, useful if only positive angles are available, use the smallest 523 str = "Can't find peak at angle = "+num2str(zeroAngle)+" Using the value at angle = "+num2str(tmpAngle[0]) 524 pkHt = tmpDetCts[0] 525 endif 526 522 527 str=note(tmpDetCts) 523 528 str = ReplaceNumberByKey("PEAKANG",str,zeroAngle,":",";") -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/U_CALC.ipf
r583 r605 121 121 String/G gTotTimeStr="" 122 122 Variable/G gAnalyzerOmega = 7.1e-7 //solid angle of the analyzer, in steradians 123 Variable/G gBeamCurrent=25000 //beam current Ed*I (n/s) for 5/8" diam = 25000 n/s123 // Variable/G gBeamCurrent=25000 // (?? not used) beam current Ed*I (n/s) for 5/8" diam = 25000 n/s 124 124 Variable/G gThick=0.1 //sample thickness (cm) 125 125 Variable/G gSamTrans=0.8 … … 459 459 SetVariable totalTime,pos={left+20,335},size={150,15},title="Count time (h:m)",value= gTotTimeStr 460 460 SetVariable totalTime,limits={-inf,inf,0},noedit=1 461 SetVariable valdisp0_2,pos={left+20,365},size={ 190,15},title="Multiple Coherent Scattering"462 SetVariable valdisp0_2,limits={-inf,inf,0}, noedit=1,value=g_MultScattFraction461 SetVariable valdisp0_2,pos={left+20,365},size={200,15},title="Multiple Coherent Scattering" 462 SetVariable valdisp0_2,limits={-inf,inf,0},format="%8f",noedit=1,value=g_MultScattFraction 463 463 // ValDisplay valdisp0_3,pos={left+20,420},size={220,13},title="Estimated transmission" 464 464 // ValDisplay valdisp0_3,limits={0,0,0},barmisc={0,1000},value=root:Packages:NIST:USANS:Globals:U_Sim:g_1DEstTrans … … 1606 1606 endif 1607 1607 endfor 1608 1608 1609 // no save the fake "COR" file that is the combination and rescaling of the data sets 1610 // - the combination is in root:Sim_USANS: 1611 NVAR g_1D_PlotCR = root:Packages:NIST:USANS:Globals:U_Sim:g_1D_PlotCR 1612 1613 if(g_1D_PlotCR) // right now, save COR only if the CR is plotted 1614 SaveFakeCOR(baseName) 1615 endif 1616 1609 1617 break 1610 1618 endswitch 1611 1619 1612 1620 return 0 1621 End 1622 1623 1624 Function SaveFakeCOR(nameStr) 1625 String nameStr 1626 1627 NVAR gThick = root:Packages:NIST:USANS:Globals:U_Sim:gThick 1628 NVAR gSamTrans = root:Packages:NIST:USANS:Globals:U_Sim:gSamTrans 1629 NVAR gAnalyzerOmega = root:Packages:NIST:USANS:Globals:U_Sim:gAnalyzerOmega 1630 NVAR g_MultScattFraction = root:Packages:NIST:USANS:Globals:U_Sim:g_MultScattFraction 1631 SVAR funcStr = root:Packages:NIST:USANS:Globals:U_Sim:gFuncStr 1632 1633 String folder = "root:Sim_USANS:",fileStr="" 1634 String termStr="\r\n" //VAX uses only <CR> as terminator, but only CRLF seems to FTP correctly to VAX 1635 String destStr="",formatStr = "%15.6g %15.6g %15.6g %15.6g %15.6g %15.6g"+termStr 1636 1637 Variable refNum,integer,realval 1638 //*****these waves MUST EXIST, or IGOR Pro will crash, with a type 2 error**** 1639 WAVE qvals =$(folder + "Sim_USANS_q") 1640 WAVE inten=$(folder + "Sim_USANS_i") 1641 WAVE sig=$(folder + "Sim_USANS_s") 1642 1643 //check each wave 1644 If(!(WaveExists(qvals))) 1645 Abort "qvals DNExist in SaveFakeCOR()" 1646 Endif 1647 If(!(WaveExists(inten))) 1648 Abort "inten DNExist in SaveFakeCOR()" 1649 Endif 1650 If(!(WaveExists(sig))) 1651 Abort "sig DNExist in SaveFakeCOR()" 1652 Endif 1653 1654 //dummy wave for the resolution 1655 Duplicate/O qvals,dumWave 1656 SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 1657 NVAR DQv=$(USANSFolder+":Globals:MainPanel:gDQv") 1658 dumWave = - DQv 1659 1660 //temp waves for the rescaling 1661 Duplicate/O qvals,tq,ti,te 1662 ti=inten 1663 te=sig 1664 tq=qvals 1665 1666 //rescale 1667 ti *= 1.0e6 / GetUSANSBeamIntensity() //converts to "SAM" scaled data 1668 ti *= 1/(gSamTrans*gThick*gAnalyzerOmega*1.0e6) //converts to "COR" scaling (approx, since I don't know Twide) 1669 //rescale error appropriately too 1670 te *= 1.0e6 / GetUSANSBeamIntensity() //converts to "SAM" scaled data 1671 te *= 1/(gSamTrans*gThick*gAnalyzerOmega*1.0e6) //converts to "COR" scaling (approx, since I don't know Twide) 1672 1673 // add fake error to every few data points to mark it as simulated data 1674 te[2,numpnts(te)-1;7] *= 10 1675 1676 // now trim off the q-values less than 3e-5 1677 if(tq[0] < 3e-5) 1678 do 1679 DeletePoints 0, 1, ti,tq,te,dumWave 1680 while(tq[0] < 3e-5) 1681 endif 1682 1683 String samStr="",empStr="",dateStr="",samLabelStr="",paramStr="",empLevStr="",bkgLevStr="",pkStr="" 1684 samStr = "SIM FILES: "+StringByKey("FILE",note(inten),":",";") 1685 empStr = "EMP FILES: "+"none" 1686 empLevStr = "EMP LEVEL: " + "none" 1687 bkgLevStr = "BKG LEVEL: " + "not used" 1688 paramStr = "Ds = "+num2str(gthick)+" cm ; " 1689 paramStr += "Twide = "+"unknown"+" ; " 1690 paramStr += "Trock = "+num2str(gSamTrans) 1691 pkStr += "Multiple coherent scattering fraction: "+num2str(g_MultScattFraction) 1692 1693 //these strings are always the same 1694 samLabelStr ="LABEL: "+"Simulated USANS Data from: "+funcStr 1695 dateStr = date()+" at "+time()// + " "+Secs2Time(DateTime,2) 1696 1697 1698 fileStr=nameStr+".cor" 1699 //actually open the file 1700 Open refNum as fileStr 1701 1702 fprintf refnum,"%s"+termStr,samStr 1703 fprintf refnum,"%s"+termStr,dateStr 1704 fprintf refnum,"%s"+termStr,samLabelStr 1705 fprintf refnum,"%s"+termStr,empStr 1706 fprintf refnum,"%s"+termStr,paramStr 1707 fprintf refnum,"%s"+termStr,pkStr 1708 fprintf refnum,"%s"+termStr,empLevStr + " ; "+bkglevStr 1709 1710 // 1711 wfprintf refnum, formatStr, tq,ti,te,dumWave,dumWave,dumWave 1712 1713 Close refnum 1714 1715 Killwaves/Z dumWave,ti,te,tq 1716 1717 1718 1719 return(0) 1613 1720 End 1614 1721 … … 1657 1764 // set up some of the strings needed 1658 1765 fileStr=nameStr+num2str(num+set)+".bt5" 1659 dateStr = date() // + " "+Secs2Time(DateTime,2)1766 dateStr = date() 1660 1767 ctTime = countingTime[first] 1661 1768 numPts = last-first+1
Note: See TracChangeset
for help on using the changeset viewer.