Changeset 795
- Timestamp:
- Apr 4, 2011 12:18:33 PM (11 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ANSTO_DataReadWrite.ipf
r776 r795 202 202 String/G root:Packages:NIST:RAW:fileList = textw[0] 203 203 204 Duplicate/O data $"root:Packages:NIST:RAW:linear_data" //data read in is on linear scale, copy it now 205 204 Duplicate/O data linear_data //data read in is on linear scale, copy it now 205 206 // proper error for counting statistics, good for low count values too 207 // rather than just sqrt(n) 208 // see N. Gehrels, Astrophys. J., 303 (1986) 336-346, equation (7) 209 // for S = 1 in eq (7), this corresponds to one sigma error bars 210 Duplicate/O linear_data linear_data_error 211 linear_data_error = 1 + sqrt(linear_data + 0.75) 212 // 213 206 214 Return 0 207 215 … … 409 417 data=temp0 410 418 Redimension/N=(pixelsX,pixelsY) data //,linear_data 419 420 Duplicate/O data linear_data_error 421 linear_data_error = 1 + sqrt(data + 0.75) 422 423 //just in case there are odd inputs to this, like negative intensities 424 WaveStats/Q linear_data_error 425 linear_data_error = numtype(linear_data_error[p]) == 0 ? linear_data_error[p] : V_avg 426 linear_data_error = linear_data_error[p] != 0 ? linear_data_error[p] : V_avg 411 427 412 428 //linear_data = data … … 517 533 // (3) close the file 518 534 519 535 // new, April 2011 for error propagation. fill these in with the facility- 536 // specific versions, if desired. 537 Function WriteTransmissionErrorToHeader(fname,transErr) 538 String fname 539 Variable transErr 540 541 542 return(0) 543 End 544 545 Function WriteBoxCountsErrorToHeader(fname,rel_err) 546 String fname 547 Variable rel_err 548 549 return(0) 550 End 551 552 Function getSampleTransError(fname) 553 String fname 554 555 return(0) 556 end 557 558 Function getBoxCountsError(fname) 559 String fname 560 561 return(0) 562 end 563 564 565 // end April 2011 additions 520 566 521 567 //whole transmission is NCNR-specific right now -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ANSTO_Utils.ipf
r715 r795 166 166 // detStr is passed as TextRead[9] and is an identifier for the detector 167 167 // 168 Function DetectorDeadtime(fileStr,detStr) 169 String fileStr,detStr 168 // [dateAndTimeStr] is optional, and could be used as a switch for 169 // different historical detector configurations 170 Function DetectorDeadtime(fileStr,detStr,[dateAndTimeStr]) 171 String fileStr,detStr,dateAndTimeStr 170 172 171 173 Variable deadtime … … 886 888 // called by Correct.ipf, ProtocolAsPanel.ipf, Transmission.ipf 887 889 // 888 Function AttenuationFactor(fileStr,lam,attenNo) 889 890 // 890 // atten_err is one std. deviation, passed back by reference 891 Function AttenuationFactor(fileStr,lam,attenNo,atten_err) 891 892 String fileStr // 892 Variable lam,attenNo 893 Variable lam,attenNo, &atten_err 893 894 894 895 Variable attenFactor=1 … … 896 897 // your code here 897 898 attenFactor = LookupAtten(lam,attenNo) 899 900 // Change April 2011 - now returns error in atten trans 901 atten_err = 0 898 902 899 903 return(attenFactor) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/FACILITY_DataReadWrite.ipf
r573 r795 187 187 // fill the data array with the detector values 188 188 getDetectorData(fname,data) 189 190 Duplicate/O data linear_data // at this point, the data is still the raw data, and is linear_data 191 192 // proper error for counting statistics, good for low count values too 193 // rather than just sqrt(n) 194 // see N. Gehrels, Astrophys. J., 303 (1986) 336-346, equation (7) 195 // for S = 1 in eq (7), this corresponds to one sigma error bars 196 Duplicate/O linear_data linear_data_error 197 linear_data_error = 1 + sqrt(linear_data + 0.75) 198 // 189 199 190 200 //keep a string with the filename in the RAW folder … … 350 360 data=temp0 351 361 Redimension/N=(pixelsX,pixelsY) data //,linear_data 362 363 Duplicate/O data linear_data_error 364 linear_data_error = 1 + sqrt(data + 0.75) 365 366 //just in case there are odd inputs to this, like negative intensities 367 WaveStats/Q linear_data_error 368 linear_data_error = numtype(linear_data_error[p]) == 0 ? linear_data_error[p] : V_avg 369 linear_data_error = linear_data_error[p] != 0 ? linear_data_error[p] : V_avg 352 370 353 371 //linear_data = data … … 458 476 // (3) close the file 459 477 478 // new, April 2011 for error propagation. fill these in with the facility- 479 // specific versions, if desired. 480 Function WriteTransmissionErrorToHeader(fname,transErr) 481 String fname 482 Variable transErr 483 484 485 return(0) 486 End 487 488 Function WriteBoxCountsErrorToHeader(fname,rel_err) 489 String fname 490 Variable rel_err 491 492 return(0) 493 End 494 495 Function getSampleTransError(fname) 496 String fname 497 498 return(0) 499 end 500 501 Function getBoxCountsError(fname) 502 String fname 503 504 return(0) 505 end 506 507 508 // end April 2011 additions 509 460 510 //sample transmission (0<T<=1) 461 511 Function WriteTransmissionToHeader(fname,trans) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/FACILITY_Utils.ipf
r683 r795 611 611 // 612 612 // called by Correct.ipf, ProtocolAsPanel.ipf, Transmission.ipf 613 // 614 Function AttenuationFactor(fileStr,lam,attenNo )613 // atten_err is one std. deviation, passed back by reference 614 Function AttenuationFactor(fileStr,lam,attenNo,atten_err) 615 615 String fileStr 616 Variable lam,attenNo 616 Variable lam,attenNo, &atten_err 617 617 618 618 Variable attenFactor=1 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/HFIR_DataReadWrite.ipf
r776 r795 207 207 208 208 WAVE data=$"root:Packages:NIST:RAW:data" 209 Duplicate/O data $"root:Packages:NIST:RAW:linear_data" // data is "fresh" and linear scale, so copy it now 210 209 Duplicate/O data linear_data // data is "fresh" and linear scale, so copy it now 210 211 // proper error for counting statistics, good for low count values too 212 // rather than just sqrt(n) 213 // see N. Gehrels, Astrophys. J., 303 (1986) 336-346, equation (7) 214 // for S = 1 in eq (7), this corresponds to one sigma error bars 215 Duplicate/O linear_data linear_data_error 216 linear_data_error = 1 + sqrt(linear_data + 0.75) 217 // 211 218 212 219 SetDataFolder root: … … 369 376 data=temp0 370 377 Redimension/N=(pixelsX,pixelsY) data //,linear_data 371 378 379 Duplicate/O data linear_data_error 380 linear_data_error = 1 + sqrt(data + 0.75) 381 382 //just in case there are odd inputs to this, like negative intensities 383 WaveStats/Q linear_data_error 384 linear_data_error = numtype(linear_data_error[p]) == 0 ? linear_data_error[p] : V_avg 385 linear_data_error = linear_data_error[p] != 0 ? linear_data_error[p] : V_avg 386 372 387 //linear_data = data 373 388 … … 465 480 // read specific bits of information from the header 466 481 // each of these operations MUST take care of open/close on their own 482 483 // new, April 2011 for error propagation. fill these in with the facility- 484 // specific versions, if desired. 485 Function WriteTransmissionErrorToHeader(fname,transErr) 486 String fname 487 Variable transErr 488 489 490 return(0) 491 End 492 493 Function WriteBoxCountsErrorToHeader(fname,rel_err) 494 String fname 495 Variable rel_err 496 497 return(0) 498 End 499 500 Function getSampleTransError(fname) 501 String fname 502 503 return(0) 504 end 505 506 Function getBoxCountsError(fname) 507 String fname 508 509 return(0) 510 end 511 512 513 // end April 2011 additions 514 467 515 468 516 Function/S getStringFromHeader(fname,wantedterm) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/HFIR_Utils.ipf
r750 r795 164 164 // detStr is passed as TextRead[9] and is an identifier for the detector 165 165 // 166 Function DetectorDeadtime(fileStr,detStr) 167 String fileStr,detStr 166 // [dateAndTimeStr] is optional, and could be used as a switch for 167 // different historical detector configurations 168 Function DetectorDeadtime(fileStr,detStr,[dateAndTimeStr]) 169 String fileStr,detStr,dateAndTimeStr 168 170 169 171 Variable deadtime … … 977 979 // called by Correct.ipf, ProtocolAsPanel.ipf, Transmission.ipf 978 980 // 979 Function AttenuationFactor(fileStr,lam,attenuation) 981 // atten_err is one std. deviation, passed back by reference 982 Function AttenuationFactor(fileStr,lam,attenuation, atten_err) 980 983 String fileStr 981 Variable lam,attenuation // 0 =< attenuation <= 100 (%) : where no attenuator stands for 0.984 Variable lam,attenuation, &atten_err // 0 =< attenuation <= 100 (%) : where no attenuator stands for 0. 982 985 983 986 Variable attenFactor=1 … … 986 989 attenFactor = 1- attenuation*0.01 //???Attenuate transmission 987 990 991 // Change April 2011 - now returns error in atten trans 992 atten_err = 0 993 988 994 return(attenFactor) 989 995 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ILL_DataReadWrite.ipf
r779 r795 214 214 Setdatafolder curpath 215 215 216 Duplicate/O data $"root:Packages:NIST:RAW:linear_data" // data is "fresh" and linear scale, so copy it now 216 Duplicate/O data linear_data // data is "fresh" and linear scale, so copy it now 217 218 // proper error for counting statistics, good for low count values too 219 // rather than just sqrt(n) 220 // see N. Gehrels, Astrophys. J., 303 (1986) 336-346, equation (7) 221 // for S = 1 in eq (7), this corresponds to one sigma error bars 222 Duplicate/O linear_data linear_data_error 223 linear_data_error = 1 + sqrt(linear_data + 0.75) 224 // 217 225 218 226 //keep a string with the filename in the RAW folder … … 394 402 data=temp0 395 403 Redimension/N=(pixelsX,pixelsY) data //,linear_data 404 405 Duplicate/O data linear_data_error 406 linear_data_error = 1 + sqrt(data + 0.75) 407 408 //just in case there are odd inputs to this, like negative intensities 409 WaveStats/Q linear_data_error 410 linear_data_error = numtype(linear_data_error[p]) == 0 ? linear_data_error[p] : V_avg 411 linear_data_error = linear_data_error[p] != 0 ? linear_data_error[p] : V_avg 396 412 397 413 //linear_data = data … … 501 517 // (2) write the specified value to the header at the correct location in the file 502 518 // (3) close the file 519 520 521 // new, April 2011 for error propagation. fill these in with the facility- 522 // specific versions, if desired. 523 Function WriteTransmissionErrorToHeader(fname,transErr) 524 String fname 525 Variable transErr 526 527 528 return(0) 529 End 530 531 Function WriteBoxCountsErrorToHeader(fname,rel_err) 532 String fname 533 Variable rel_err 534 535 return(0) 536 End 537 538 Function getSampleTransError(fname) 539 String fname 540 541 return(0) 542 end 543 544 Function getBoxCountsError(fname) 545 String fname 546 547 return(0) 548 end 549 550 551 // end April 2011 additions 552 503 553 504 554 //sample transmission (0<T<=1) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ILL_Utils.ipf
r764 r795 175 175 // detStr is passed as TextRead[9] and is an identifier for the detector 176 176 // 177 Function DetectorDeadtime(fileStr,detStr) 178 String fileStr,detStr 177 // [dateAndTimeStr] is optional, and could be used as a switch for 178 // different historical detector configurations 179 Function DetectorDeadtime(fileStr,detStr,[dateAndTimeStr]) 180 String fileStr,detStr,dateAndTimeStr 179 181 180 182 Variable deadtime 181 183 182 // your code here183 deadtime = (2e-6)184 // your code here 185 deadtime = (2e-6) 184 186 185 187 return(deadtime) … … 922 924 // called by Correct.ipf, ProtocolAsPanel.ipf, Transmission.ipf 923 925 // 924 Function AttenuationFactor(fileStr,lam,attenNo) 926 // atten_err is one std. deviation, passed back by reference 927 Function AttenuationFactor(fileStr,lam,attenNo,atten_err) 925 928 String fileStr 926 Variable lam,attenNo 929 Variable lam,attenNo,&atten_err 927 930 928 931 Variable attenFactor … … 930 933 931 934 attenFactor = Attenuators_ILL[attenNo] 932 935 936 // Change April 2011 - now returns error in atten trans 937 atten_err = 0 938 933 939 // print attenfactor 934 940
Note: See TracChangeset
for help on using the changeset viewer.