Ignore:
Timestamp:
Jul 17, 2018 1:58:12 PM (4 years ago)
Author:
srkline
Message:

two significant changes:

1- in the averaging, before the data is finally written out, duplicate q-values (within 0.1%) are averaged so that duplicate q-values do not appear in the data file. This has a very bad effect on the calculation of the smearing matrix (dq=0).

2-for the data from the back (high res) detector, two steps have been added to the processing at the point where the data is converted to WORK. First, a constant read noise value of 200 cts/pixel is subtracted (found from average of multiple runs with beam off) Second, a 3x3 median filter is applied to the whole image to eliminate the stray bright pixels. Some are saturatd, some are simply outliers. Very effective.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
Files:
6 edited

Legend:

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

    r1093 r1111  
    165165 
    166166Proc V_NormalizeDIV_proc(reducedFolderType,carriageStr) 
    167         String reducedFolderType="SAM",carriageStr="F" 
     167        String reducedFolderType="COR",carriageStr="F" 
    168168        if(cmpstr(carriageStr,"F")==0) 
    169169                V_NormalizeDIV_onePanel(reducedFolderType,"FL") 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DetectorCorrections.ipf

    r1110 r1111  
    14001400        adjW=0 
    14011401         
    1402         Variable topX,bottomX 
    1403         Variable topY,bottomY 
    1404          
    1405         topX = 7 
    1406         topY = 105 
    1407          
    1408         bottomX = 7 
    1409         bottomY = 35 
     1402//      Variable topX,bottomX 
     1403//      Variable topY,bottomY 
     1404         
     1405//      topX = 7 
     1406//      topY = 105 
     1407         
     1408//      bottomX = 7 
     1409//      bottomY = 35 
    14101410         
    14111411        // middle 
     
    14131413 
    14141414        //top 
    1415         adjW[0+topX,679][552+552,1655-topY] = w[p-topX][q+topY] 
     1415        adjW[0+kShift_topX,679][552+552,1655-kShift_topY] = w[p-kShift_topX][q+kShift_topY] 
    14161416         
    14171417        //bottom 
    1418         adjW[0+bottomX,679][0+bottomY,551] = w[p-bottomX][q-bottomY] 
     1418        adjW[0+kShift_bottomX,679][0+kShift_bottomY,551] = w[p-kShift_bottomX][q-kShift_bottomY] 
    14191419         
    14201420        return(0) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_IQ_Utilities.ipf

    r1098 r1111  
    235235        endswitch 
    236236         
     237         
    237238 
    238239        return(0) 
     
    483484End 
    484485 
     486 
     487Function V_RemoveDuplicateQvals(pathStr,folderStr) 
     488        String pathStr,folderStr 
     489         
     490        SetDataFolder $(pathStr+folderStr) 
     491 
     492        Wave qw = tmp_q 
     493        Wave iw = tmp_i 
     494        Wave sw = tmp_s 
     495        Wave sq = tmp_sq 
     496        Wave qb = tmp_qb 
     497        Wave fs = tmp_fs 
     498         
     499        Variable q1,q2,tol,ii 
     500        tol = 0.001             // 0.1 % 
     501        q1 = qw[0] 
     502        ii=0 
     503        do 
     504                q2 = qw[ii+1] 
     505                if(V_CloseEnough(q1,q2,q1*tol)) 
     506                        // check to be sure that both values are actually real numbers before trying to average 
     507                        if(numtype(iw[ii])==0 && numtype(iw[ii+1])==0)          //==0 => real number 
     508                                iw[ii] = (iw[ii] + iw[ii+1])/2          //both OK 
     509                        endif 
     510                        if(numtype(iw[ii])==0 && numtype(iw[ii+1])!=0)          //==0 => real number 
     511                                iw[ii] = iw[ii]         //one OK 
     512                        endif 
     513                        if(numtype(iw[ii])!=0 && numtype(iw[ii+1])==0)          //==0 => real number 
     514                                iw[ii] = iw[ii+1]               //other OK 
     515                        endif 
     516                        if(numtype(iw[ii])!=0 && numtype(iw[ii+1])!=0)          //==0 => real number 
     517                                iw[ii] = (iw[ii])               // both NaN, get rid of it later 
     518                        endif 
     519                 
     520                        if(numtype(sw[ii])==0 && numtype(sw[ii+1])==0)          //==0 => real number 
     521                                sw[ii] = sqrt(sw[ii]^2 + sw[ii+1]^2)            //both OK 
     522                        endif 
     523                        if(numtype(sw[ii])==0 && numtype(sw[ii+1])!=0)          //==0 => real number 
     524                                sw[ii] = sw[ii]         //one OK 
     525                        endif 
     526                        if(numtype(sw[ii])!=0 && numtype(sw[ii+1])==0)          //==0 => real number 
     527                                sw[ii] = sw[ii+1]               //other OK 
     528                        endif 
     529                        if(numtype(sw[ii])!=0 && numtype(sw[ii+1])!=0)          //==0 => real number 
     530                                sw[ii] = (sw[ii])               // both NaN, get rid of it later 
     531                        endif 
     532                         
     533                        DeletePoints ii+1, 1, qw,iw,sw,sq,qb,fs 
     534                else 
     535                        ii+=1 
     536                        q1 = q2 
     537                endif 
     538        while(ii<numpnts(qw)-2) 
     539         
     540         
     541 
     542        SetDataFolder root: 
     543        return(0) 
     544End 
    485545 
    486546// 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Initialize.ipf

    r1109 r1111  
    7575Strconstant ksBinTrimBegDefault = "B=5;FT=3;FB=3;FL=3;FR=3;MT=3;MB=3;ML=3;MR=3;FTB=2;FLR=2;MTB=2;MLR=2;FLRTB=1;MLRTB=1;" 
    7676Strconstant ksBinTrimEndDefault = "B=10;FT=5;FB=5;FL=5;FR=5;MT=5;MB=5;ML=5;MR=5;FTB=4;FLR=4;MTB=4;MLR=4;FLRTB=3;MLRTB=3;" 
     77 
     78// the average read noise level of the back detector 
     79// taken from multiple runs with the beam off, 6-28-18 
     80// runs sans12324 - sans12353 
     81// 
     82// used in V_Raw_to_Work() 
     83// average of whole panel (tested several data files) = 208 +/- 14 
     84// 
     85// 200 appears to be a better value - (empirical, based on teflon/converging pinhole data) 
     86Constant kReadNoiseLevel = 200 
     87//Constant kReadNoiseLevel = 208 
     88Constant kReadNoiseLevel_Err = 14 
     89 
     90 
     91 
     92// Pixel shifts for the back detector to bring the three CCDs into registry 
     93// data from pinholes used to match up CCDs 
     94// 27 JUN 2018 
     95// runs 12221,12225,27,33,34,35,38,42 
     96// middle CCD is not moved 
     97// See V_ShiftBackDetImage() for implementation 
     98Constant        kShift_TopX = 7 
     99Constant                kShift_TopY = 105 
     100Constant                kShift_BottomX = 5 
     101Constant                kShift_BottomY = 35 
     102 
     103 
    77104 
    78105 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf

    r1109 r1111  
    32083208                                        V_ConcatenateForSave("root:Packages:NIST:VSANS:",activeType,"",binType)         // this removes q=0 point, concatenates, sorts 
    32093209                                 
     3210                                        V_RemoveDuplicateQvals("root:Packages:NIST:VSANS:",activeType)          // works with the "tmp_x" waves from concatenateForSave 
    32103211//                                      prot[9] = collimationStr 
    32113212                                         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WorkFolderUtils.ipf

    r1109 r1111  
    464464//(the function Add_Raw_to_work(type) adds multiple runs together - and is LOW priority) 
    465465// 
     466// JUL 2018 
     467// now removes a constant kReadNoiseLevel from the back detector (this is a constant value, not time 
     468//  or count dependent). It does not appear to be dependent on gain, and is hoepfully stable over time. 
     469// 
    466470//the current display type is updated to newType (global) 
    467471// 
     
    502506// each correction must loop over each detector. tedious. 
    503507 
     508        //except for removing the read noise of the back detector 
     509        NVAR gIgnoreDetB = root:Packages:NIST:VSANS:Globals:gIgnoreDetB 
     510 
     511        if(gIgnoreDetB == 0) 
     512                Wave w = V_getDetectorDataW(fname,"B") 
     513                w -= kReadNoiseLevel            // a constant value 
     514                 
     515                MatrixFilter /N=3 median w 
     516                Print "*** median noise filter applied to the back detector***" 
     517        endif 
     518         
     519         
    504520        // (0) Redimension the data waves in the destination folder 
    505521        //     so that they are DP, not integer 
     
    819835        // put this in some separate work folder that can be cleaned out at the end (ADJ) 
    820836        String tmpType="ADJ" 
    821         V_Raw_to_Work(tmpType) 
     837         
     838        //this step removes the read noise from the back so that neither added file will have this constant 
     839        V_Raw_to_Work(tmpType)           
    822840                         
    823841        //now make references to data in newType folder 
Note: See TracChangeset for help on using the changeset viewer.