Ignore:
Timestamp:
Jan 5, 2018 10:32:55 AM (5 years ago)
Author:
srkline
Message:

more utilities and bug fixes to handle:
(1) generation of DIV files
(2) generation and loading of slit-smeared VSANS data sets

Loading of VSANS data sets and generating the resolution smearing matrix required adding a conditional compile statement to the PlotUtilsMacro? file, to distinguish VSANS data - crudely done now by checking to see that VSANS is defined (which will NOT be the case for a "normal" Analysis experiment. This will need to be revisited in the future.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Slit.ipf

    r1077 r1078  
    175175//      eBin_qxqy = tmp[0][p] 
    176176 
    177         Variable ii,jj,ntube,npix,sum_inten, sum_n, sum_inten2,avesq,aveisq,var,mask_val 
     177        Variable ii,jj,ntube,nYpix,sum_inten, sum_n, sum_inten2,avesq,aveisq,var,mask_val 
    178178        ntube = DimSize(inten,0) 
    179         npix = DimSize(inten,1) 
     179        nYpix = DimSize(inten,1) 
    180180         
    181181        for(ii=0;ii<ntube;ii+=1) 
     
    184184                sum_inten2 = 0 
    185185                 
    186                 for(jj=0;jj<npix;jj+=1) 
     186                for(jj=0;jj<nYpix;jj+=1) 
    187187                                val = inten[ii][jj] 
    188188                                if(isVCALC || maskMissing)              // mask_val == 0 == keep, mask_val == 1 = YES, mask out the point 
     
    199199                iBin_qxqy[ii] = sum_inten/sum_n         //the average value 
    200200                 
    201                 avesq = sum_inten 
     201                avesq = (sum_inten/sum_n)^2 
    202202                aveisq = sum_inten2/sum_n 
    203203                var = aveisq-avesq 
     
    211211 
    212212//TODO:  use only the Qx component in the y-center of the detector, not Qtotal 
    213         qBin_qxqy =  abs(qx[p][npix/2])          
    214  
    215 // if the detectors are "L", then the values are all negative...         
    216         qBin_qxqy = abs(qBin_qxqy) 
     213// if the detectors are "L", then the values are all negative, so take the absolute value here 
     214        qBin_qxqy =  abs(qx[p][nYpix/2])                 
    217215 
    218216// for the L panels, sort the q-values (and data) after the abs() step, otherwise the data is reversed 
    219 // won't hurt to sort the R data 
     217// won't hurt to sort the R panel data 
    220218        Sort qBin_qxqy, qBin_qxqy,iBin_qxqy,eBin_qxqy 
    221          
    222         // not needed to corrrect data, but put in the file??? 
    223         delQy = abs(qy[0][npix-1] - qy[0][0])   // TODO: do I use dQ for the height of the panel? 
     219 
     220 
     221        // TODO: do I use dQ for the height of the panel? 
     222        // TODO : do I use 1/2 of dQ due to the symmetry of my smearing calculation?     
     223        delQy = abs(qy[0][nYpix-1] - qy[0][0]) 
     224 
    224225//      iBin_qxqy *= delQy 
    225226//      eBin_qxqy *= delQy 
     
    247248//      DeletePoints 0, val, iBin_qxqy,qBin_qxqy,eBin_qxqy 
    248249 
    249  
    250 // TODO: 
    251 // -- calculate the slit resolution here. don't really have any idea how to represent this in VSANS 
    252 //    since it's not an infinite slit, and not anything that I expect could be represented as a Gaussian 
    253250 
    254251        // TODO: 
     
    266263        Wave fsubs = $(folderPath+":"+"fSubS_qxqy_"+detStr) 
    267264 
    268 // TODO 
    269 // -- these are DUMMY VALUES!!! 
    270         sigmaq = -delQy 
    271         qbar = -delQy 
    272         fsubs = -delQy 
     265// TODO: 
     266// -- calculate the slit resolution here. don't really have any idea how to represent this in VSANS 
     267//    since it's not an infinite slit, and not anything that I expect could be represented as a Gaussian 
     268// -- there is also wavelength smearing present 
     269 
     270// ASSUMPTION: As a first approximation, ignore the wavelength smearing component        
     271        // TODO : do I use 1/2 of dQy due to the symmetry of my smearing calculation?    
     272        sigmaq = -delQy/2 
     273        qbar = -delQy/2 
     274        fsubs = -delQy/2 
    273275 
    274276 
Note: See TracChangeset for help on using the changeset viewer.