Ignore:
Timestamp:
Aug 3, 2009 6:22:39 PM (14 years ago)
Author:
srkline
Message:

Lots of changes to add the first version of a USANS simulator, like SASCALC

(!) first issue is with the entanglement of dependencies - need to load SANS macros first!

otherwise, worth a first test for interface and accuracy. behavior is similar to the 1D SASCALC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf

    r502 r544  
    26402640        return(0) 
    26412641End 
     2642 
     2643 
     2644///// 
     2645Proc ReadDetectorCount(firstFile,lastFile) 
     2646        Variable firstFile=1,lastFile=100 
     2647         
     2648        fReadDetectorCount(firstFile,lastFile) 
     2649End 
     2650 
     2651 
     2652// simple utility to read the detector count from the header, and the summed data value 
     2653// and print out the values 
     2654Function 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) 
     2674End 
Note: See TracChangeset for help on using the changeset viewer.