- Timestamp:
- Aug 3, 2009 6:22:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf
r502 r544 2640 2640 return(0) 2641 2641 End 2642 2643 2644 ///// 2645 Proc ReadDetectorCount(firstFile,lastFile) 2646 Variable firstFile=1,lastFile=100 2647 2648 fReadDetectorCount(firstFile,lastFile) 2649 End 2650 2651 2652 // simple utility to read the detector count from the header, and the summed data value 2653 // and print out the values 2654 Function fReadDetectorCount(lo,hi) 2655 Variable lo,hi 2656 2657 String file 2658 Variable ii,summed 2659 2660 for(ii=lo;ii<=hi;ii+=1) 2661 file = FindFileFromRunNumber(ii) 2662 if(strlen(file) != 0) 2663 ReadHeaderAndData(file) 2664 Wave rw=root:Packages:NIST:RAW:RealsRead 2665 Wave data=root:Packages:NIST:RAW:data //data as read in is linear 2666 summed = sum(data,-inf,inf) 2667 printf "File %d: DetCt Header = %g\t Detector Sum = %g\t Ratio sum/hdr = %g\r",ii,rw[2],summed,summed/rw[2] 2668 else 2669 printf "run number %d not found\r",ii 2670 endif 2671 endfor 2672 2673 return(0) 2674 End
Note: See TracChangeset
for help on using the changeset viewer.