Jul 3, 2018 2:30:41 PM (4 years ago)

Many changes:

Made the VCALC panel aware of all of the binning options
Corrected the behavior of the VCALC preset conditions
Adjusted how the Slit data is binned so that there are not duplicated q-values in the output

Made Absolute scaling aware of the back detector. Now the ABS String in the protocol has a second
set of scaling constants tagged with "_B" for the back detector. There is an added button
on the protocol panel to set the second set of constants. For the back detector, the read noise
is subtracted by reading it from the empty beam file (shifting over to the right by one box width)
All of the associated abs procedures are now aware of this.
More error checking needs to be added.

Back detector image is now shifted upon loading of the data. the default mask takes this into account
and masks out the padded (zero) regions.

in the protocol, DIV and MSK do not use grep any longer. it was just way too slow. Now it depends on

the file name having DIV or MASK respectively.

Raw data files can now be added together, in the usual way from the protocol panel.

1 edited


  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Marquee_Operations.ipf

    r1097 r1109  
     224//sums the data counts in the box specified by (x1,y1) to (x2,y2) 
     225//assuming that x1<x2, and y1<y2  
     226//the x,y values must also be in array coordinates[0] NOT scaled detector coords. 
     228// accepts arbitrary detector coordinates. calling function is responsible for  
     229// keeping selection in bounds 
     231// basically the same as V_SumCountsInBox, except the PBR value has been removed so that the 
     232// function can be used from the command line 
     234Function V_SumCountsInBox_Cmd(x1,x2,y1,y2,type,detStr) 
     235        Variable x1,x2,y1,y2 
     236        String type,detStr 
     238        Variable counts = 0,ii,jj,err2_sum,ct_err 
     240// get the waves of the data and the data_err 
     241        Wave w = V_getDetectorDataW(type,detStr) 
     242        Wave data_err = V_getDetectorDataErrW(type,detStr) 
     245        err2_sum = 0            // running total of the squared error 
     246        ii=x1 
     247        jj=y1 
     248        do 
     249                do 
     250                        counts += w[ii][jj] 
     251                        err2_sum += data_err[ii][jj]*data_err[ii][jj] 
     252                        jj+=1 
     253                while(jj<=y2) 
     254                jj=y1 
     255                ii+=1 
     256        while(ii<=x2) 
     258        err2_sum = sqrt(err2_sum) 
     259        ct_err = err2_sum 
     261        Print "sum of counts = ",counts  
     262        Print "error = ",ct_err 
     263        Print "error/counts = ",ct_err/counts 
     265        Return (counts) 
     268Proc pV_SumCountsInBox_Cmd(x1,x2,y1,y2,type,detStr) : GraphMarquee 
     269        Variable x1=280,x2=430,y1=350,y2=1020 
     270        String type="RAW",detStr="B" 
     272        V_SumCountsInBox_Cmd(x1,x2,y1,y2,type,detStr) 
    224275Function V_FindCentroid() :  GraphMarquee 
Note: See TracChangeset for help on using the changeset viewer.