Changeset 1137 for sans/Dev/trunk/NCNR_User_Procedures/Reduction
- Timestamp:
- Mar 28, 2019 11:12:06 AM (4 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/BT5_Loader.ipf
r1133 r1137 37 37 Make/O/D/N=(num) $(USANSFolder+":"+type+":MonCts") 38 38 Make/O/D/N=(num) $(USANSFolder+":"+type+":TransCts") 39 Make/O/D/N=(num) $(USANSFolder+":"+type+":CtTime") 39 40 Wave Angle = $(USANSFolder+":"+type+":Angle") 40 41 Wave DetCts = $(USANSFolder+":"+type+":DetCts") … … 42 43 Wave MonCts = $(USANSFolder+":"+type+":MonCts") 43 44 Wave TransCts = $(USANSFolder+":"+type+":TransCts") 45 Wave CtTime = $(USANSFolder+":"+type+":CtTime") 44 46 45 47 Open/R refNum as fname //if fname is "", a dialog will be presented … … 85 87 86 88 Variable useNewDataFormat 87 89 NVAR gRawUSANSisQvalues = root:Packages:NIST:gRawUSANSisQvalues 90 91 88 92 // test by date 89 93 Variable thisFileSecs … … 98 102 99 103 USANS_DetectorDeadtime(filedt,MainDeadTime,TransDeadTime) 104 105 // Print "Overriding Transmission DeadTime, set to 1e-9 s" 106 // TransDeadTime = 1e-9 107 // MainDeadTime = 1e-9 108 100 109 101 110 //skip line 2 … … 119 128 break // Hit blank line. End of data in the file. 120 129 endif 130 //1st line of pair 121 131 sscanf buffer,"%g%g%g%g%g",v1,v2,v3,v4,v5 // 5 values here now 122 132 angle[numlinesloaded] = v1 //[0] is the ANGLE 133 if(gRawUSANSisQvalues==1) 134 // in this mode, each data point is collected for a different time 135 countTime = v2 * 60 // convert MIN to seconds 136 endif 137 123 138 124 139 FReadLine refNum,buffer //assume a 2nd line is there, w/16 values … … 152 167 endif 153 168 169 CtTime[numlinesloaded] = countTime 170 154 171 numlinesloaded += 1 //2 lines in file read, one "real" line of data 155 172 while(1) … … 158 175 //Print "numlines = ",numlinesloaded 159 176 //trim the waves to the correct number of points 160 Redimension/N=(numlinesloaded) Angle,MonCts,DetCts,TransCts,ErrDetCts 177 Redimension/N=(numlinesloaded) Angle,MonCts,DetCts,TransCts,ErrDetCts,CtTime 161 178 162 179 //remove LF from end of filelabel -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/Main_USANS.ipf
r1133 r1137 456 456 // note that trans detector counts are NOT normalized to 1E6 mon cts (not necessary) 457 457 // 458 // 28 Mar 2019 459 // converted CtTime to be a wave, loaded in with the raw data 460 // for old-style data, this is a constant value. for new q-value data, each point 461 // can be counted for a different time. 462 // 458 463 Function Convert2Countrate(type,doNorm) 459 464 String type … … 463 468 464 469 String noteStr = note($(USANSFolder+":"+Type+":DetCts")) 465 Variable ctTime 466 ctTime = NumberByKey("TIMEPT",noteStr,":",";") 470 471 Variable ctTimeVal 472 // Variable ctTime 473 // ctTime = NumberByKey("TIMEPT",noteStr,":",";") 474 467 475 // print ctTime 468 476 //normalize by counting time … … 471 479 Wave MonCts = $(USANSFolder+":"+Type+":MonCts") 472 480 Wave TransCts = $(USANSFolder+":"+Type+":TransCts") 481 Wave ctTime = $(USANSFolder+":"+Type+":ctTime") 473 482 474 483 detCts /= ctTime … … 486 495 487 496 //adjust the note (now on basis of 1 second) 488 ctTime = 1489 noteStr = ReplaceNumberByKey("TIMEPT",noteStr,ctTime ,":",";")497 ctTimeVal = 1 498 noteStr = ReplaceNumberByKey("TIMEPT",noteStr,ctTimeVal,":",";") 490 499 Note/K detCts 491 500 Note detCts,noteStr -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf
r1134 r1137 153 153 //////////////////// 154 154 155 prob_i = trans*thick*pixSizeX*pixSizeY/(sdd)^2*tmpInten //probability of a neutron in q-bin(i)155 MultiThread prob_i = trans*thick*pixSizeX*pixSizeY/(sdd)^2*tmpInten //probability of a neutron in q-bin(i) 156 156 157 157 tmpInten = (imon)*prob_i //tmpInten is not the model calculation anymore!! … … 159 159 160 160 /// **** can I safely assume a Gaussian error in the count rate?? 161 tmpSig = sqrt(tmpInten) // corrected based on John's memo, from 8/9/99162 163 tmpInten += gnoise(tmpSig)164 tmpInten = (tmpInten[p][q] < 0) ? 0 : tmpInten[p][q] // MAR 2013 -- is this the right thing to do161 MultiThread tmpSig = sqrt(tmpInten) // corrected based on John's memo, from 8/9/99 162 163 MultiThread tmpInten += gnoise(tmpSig) 164 MultiThread tmpInten = (tmpInten[p][q] < 0) ? 0 : tmpInten[p][q] // MAR 2013 -- is this the right thing to do 165 165 tmpInten = trunc(tmpInten) 166 166 … … 205 205 // loop over the array and calculate the values - this is done as a wave assignment 206 206 // TODO -- be sure that it's p,q -- or maybe p+1,q+1 as used in WriteQIS.ipf 207 qTot = VC_CalcQval(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)208 qx = VC_CalcQX(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)209 qy = VC_CalcQY(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)210 qz = VC_CalcQZ(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)207 MultiThread qTot = VC_CalcQval(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 208 MultiThread qx = VC_CalcQX(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 209 MultiThread qy = VC_CalcQY(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 210 MultiThread qz = VC_CalcQZ(p,q,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 211 211 212 212 return(0) … … 411 411 // 412 412 // 413 Function VC_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)413 Threadsafe Function VC_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 414 414 Variable xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY 415 415 … … 438 438 // now properly accounts for qz 439 439 // 440 Function VC_CalcQX(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)440 Threadsafe Function VC_CalcQX(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 441 441 Variable xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY 442 442 … … 468 468 // now properly accounts for qz 469 469 // 470 Function VC_CalcQY(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)470 Threadsafe Function VC_CalcQY(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 471 471 Variable xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY 472 472 … … 497 497 // not actually used, but here for completeness if anyone asks 498 498 // 499 Function VC_CalcQZ(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY)499 Threadsafe Function VC_CalcQZ(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 500 500 Variable xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY 501 501
Note: See TracChangeset
for help on using the changeset viewer.