Changeset 1152


Ignore:
Timestamp:
May 24, 2019 1:29:26 PM (4 years ago)
Author:
srkline
Message:

more fixes to DIV file generation using the high-resolution detector

added extra header lines to the the QxQy? ASCII output format. there are now 30 header lines, and 7 or so are unused to allow for future additions.

the default mask for the high res detector has been enlarged to account for the large beamstop that is used during collection of the sensitivity file.

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

Legend:

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

    r1151 r1152  
    164164        String reducedFolderType="COR",carriageStr="F" 
    165165         
     166        Vf_NormalizeDIV_proc(reducedFolderType,carriageStr) 
     167end 
     168 
     169Function Vf_NormalizeDIV_proc(reducedFolderType,carriageStr) 
     170        String reducedFolderType,carriageStr 
     171 
    166172        if (cmpstr(carriageStr,"B")==0) 
    167173                V_NormalizeDIV_onePanel(reducedFolderType,"B") 
     
    178184        endif 
    179185         
    180 end 
    181  
     186        return(0) 
     187End 
    182188 
    183189// Normalizes a single panel 
     
    225231        w_err_copy *= V_npnts 
    226232 
    227 // TODO: 
    228 // -- do I want to replace the NaN values with 1 for the DIV (the user will mask the data as 
     233// DONE: 
     234// x- I replace the NaN values with 1 for the DIV (the user will mask the data as 
    229235//    needed, and the NaN values may be an issue later... 
    230236        w_copy = (numtype(w_copy) == 2) ? 1 : w_copy                    //turns 2==NaN into 1 
     
    245251 
    246252 
    247 // 
    248 // Normalizes each panel independently 
    249 // Normalizes in-place, replacing whatever was there 
    250 // 
    251 // type is the work folder where the (? corrected) data is currently 
    252 // 
    253 // NOTE (Currently unused. use V_NormalizeDIV_onePanel() instead) 
    254 // 
    255 // -- data should be copied to some alternate work folder before this step 
    256 // -- for T/B detectors, this may not work as intended if the whole detector is not illuminated. 
    257 //    How to handle? A mask? 
    258 // x- is this the correct calculation of the error? (YES) It should be correct up to this point since the 
    259 //    standard reduction has been used, but now the normalization step is a multiplication 
    260 //    by a constant (w/no error). Be sure this error transformation is correct. (YES - this is correct, and is 
    261 //    what is done in SANS) 
    262 // 
    263 Function V_NormalizeDIV(type) 
    264         String type 
    265  
    266         Variable ii,totCts,pixelX,pixelY 
    267         String detStr 
    268  
    269         for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
    270                 detStr = StringFromList(ii, ksDetectorListAll, ";") 
    271                 Wave w = V_getDetectorDataW(type,detStr) 
    272                 Wave w_err = V_getDetectorDataErrW(type,detStr) 
    273                 pixelX = V_getDet_pixel_num_x(type,detStr) 
    274                 pixelY = V_getDet_pixel_num_y(type,detStr) 
    275  
    276                 totCts = sum(w,Inf,-Inf)                //sum all of the data 
    277                  
    278                 w /= totCts 
    279                 w *= pixelX*pixelY 
    280  
    281                 w_err /= totCts 
    282                 w_err *= pixelX*pixelY 
    283                  
    284         endfor 
    285          
    286         return(0) 
    287 End 
     253//// 
     254//// Normalizes each panel independently 
     255//// Normalizes in-place, replacing whatever was there 
     256//// 
     257//// type is the work folder where the (? corrected) data is currently 
     258//// 
     259//// NOTE (Currently unused. use V_NormalizeDIV_onePanel() instead) 
     260//// 
     261//// -- data should be copied to some alternate work folder before this step 
     262//// -- for T/B detectors, this may not work as intended if the whole detector is not illuminated. 
     263////    How to handle? A mask? 
     264//// x- is this the correct calculation of the error? (YES) It should be correct up to this point since the 
     265////    standard reduction has been used, but now the normalization step is a multiplication 
     266////    by a constant (w/no error). Be sure this error transformation is correct. (YES - this is correct, and is 
     267////    what is done in SANS) 
     268//// 
     269//Function V_NormalizeDIV(type) 
     270//      String type 
     271// 
     272//      Variable ii,totCts,pixelX,pixelY 
     273//      String detStr 
     274// 
     275//      for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
     276//              detStr = StringFromList(ii, ksDetectorListAll, ";") 
     277//              Wave w = V_getDetectorDataW(type,detStr) 
     278//              Wave w_err = V_getDetectorDataErrW(type,detStr) 
     279//              pixelX = V_getDet_pixel_num_x(type,detStr) 
     280//              pixelY = V_getDet_pixel_num_y(type,detStr) 
     281// 
     282//              totCts = sum(w,Inf,-Inf)                //sum all of the data 
     283//               
     284//              w /= totCts 
     285//              w *= pixelX*pixelY 
     286// 
     287//              w_err /= totCts 
     288//              w_err *= pixelX*pixelY 
     289//               
     290//      endfor 
     291//       
     292//      return(0) 
     293//End 
    288294 
    289295 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf

    r1148 r1152  
    949949 
    950950                                data[][0,38] = 1 
    951                                 data[][1548,1655] = 1 
    952                                 data[0,10][] = 1 
     951                                data[][1535,1655] = 1 
     952//                              data[0,10][] = 1 
     953                                data[0,190][] = 1               //with the beam stop stuck on the detector 
    953954                                data[669,679][] = 1 
    954955                                break 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Sector_Average.ipf

    r1148 r1152  
    2828        pixSizeX = V_getDet_x_pixel_size(folderStr,detStr) 
    2929        pixSizeY = V_getDet_y_pixel_size(folderStr,detStr) 
    30         phi = V_FindPhi( pixSizeX*((p+1)-xctr) , pixSizeY*((q+1)-yctr))         //(dx,dy) 
     30        MultiThread phi = V_FindPhi( pixSizeX*((p+1)-xctr) , pixSizeY*((q+1)-yctr))             //(dx,dy) 
    3131         
    3232        return phi       
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Write_VSANS_QIS.ipf

    r1151 r1152  
    396396        Variable numTextLines,ii,jj,kk 
    397397        Variable pixSizeX,pixSizeY 
    398  
    399         numTextLines = 23 
     398        Variable duration 
     399 
     400        numTextLines = 30 
    400401        Make/O/T/N=(numTextLines) labelWave 
    401402 
     
    448449                pixSizeX = V_getDet_x_pixel_size(type,detStr) 
    449450                pixSizeY = V_getDet_y_pixel_size(type,detStr) 
     451                 
     452                duration = V_getCount_time(type) 
    450453                 
    451454        ///////// 
     
    471474                labelWave[17] = "NumYPixels="+num2str(pixY) 
    472475                labelWave[18] = "YPixelSize_mm="+num2str(pixSizeY) 
    473                 labelWave[19] = "*** Data written from "+type+" folder and may not be a fully corrected data file ***" 
     476                labelWave[19] = "Duration (s)="+num2str(duration) 
     477                labelWave[20] = "reserved for future file definition changes" 
     478                labelWave[21] = "reserved for future file definition changes" 
     479                labelWave[22] = "reserved for future file definition changes" 
     480                labelWave[23] = "reserved for future file definition changes" 
     481                labelWave[24] = "reserved for future file definition changes" 
     482                labelWave[25] = "reserved for future file definition changes" 
     483 
     484                labelWave[26] = "*** Data written from "+type+" folder and may not be a fully corrected data file ***" 
    474485//              labelWave[20] = "Data columns are Qx - Qy - Qz - I(Qx,Qy) - Err I(Qx,Qy)" 
    475486        //      labelWave[20] = "Data columns are Qx - Qy - I(Qx,Qy) - Qz - SigmaQ_parall - SigmaQ_perp - fSubS(beam stop shadow)" 
    476                 labelWave[20] = "Data columns are Qx - Qy - I(Qx,Qy) - err(I) - Qz - SigmaQ_parall - SigmaQ_perp - fSubS(beam stop shadow)" 
    477                 labelWave[21] = "The error wave may not be properly propagated (1/2019)" 
    478                 labelWave[22] = "ASCII data created " +date()+" "+time() 
     487                labelWave[27] = "Data columns are Qx - Qy - I(Qx,Qy) - err(I) - Qz - SigmaQ_parall - SigmaQ_perp - fSubS(beam stop shadow)" 
     488                labelWave[28] = "The error wave may not be properly propagated (1/2019)" 
     489                labelWave[29] = "ASCII data created " +date()+" "+time() 
    479490                //strings can be too long to print-- must trim to 255 chars 
    480491                for(jj=0;jj<numTextLines;jj+=1) 
Note: See TracChangeset for help on using the changeset viewer.