- Timestamp:
- May 24, 2019 1:29:26 PM (4 years ago)
- 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 164 164 String reducedFolderType="COR",carriageStr="F" 165 165 166 Vf_NormalizeDIV_proc(reducedFolderType,carriageStr) 167 end 168 169 Function Vf_NormalizeDIV_proc(reducedFolderType,carriageStr) 170 String reducedFolderType,carriageStr 171 166 172 if (cmpstr(carriageStr,"B")==0) 167 173 V_NormalizeDIV_onePanel(reducedFolderType,"B") … … 178 184 endif 179 185 180 end 181 186 return(0) 187 End 182 188 183 189 // Normalizes a single panel … … 225 231 w_err_copy *= V_npnts 226 232 227 // TODO:228 // -- do I want toreplace the NaN values with 1 for the DIV (the user will mask the data as233 // DONE: 234 // x- I replace the NaN values with 1 for the DIV (the user will mask the data as 229 235 // needed, and the NaN values may be an issue later... 230 236 w_copy = (numtype(w_copy) == 2) ? 1 : w_copy //turns 2==NaN into 1 … … 245 251 246 252 247 // 248 // Normalizes each panel independently249 // Normalizes in-place, replacing whatever was there250 // 251 // type is the work folder where the (? corrected) data is currently252 // 253 // NOTE (Currently unused. use V_NormalizeDIV_onePanel() instead)254 // 255 // -- data should be copied to some alternate work folder before this step256 // -- 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 the259 // standard reduction has been used, but now the normalization step is a multiplication260 // by a constant (w/no error). Be sure this error transformation is correct. (YES - this is correct, and is261 // what is done in SANS)262 // 263 Function V_NormalizeDIV(type)264 String type265 266 Variable ii,totCts,pixelX,pixelY267 String detStr268 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 data277 278 w /= totCts279 w *= pixelX*pixelY280 281 w_err /= totCts282 w_err *= pixelX*pixelY283 284 endfor285 286 return(0)287 End253 //// 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 288 294 289 295 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf
r1148 r1152 949 949 950 950 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 953 954 data[669,679][] = 1 954 955 break -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Sector_Average.ipf
r1148 r1152 28 28 pixSizeX = V_getDet_x_pixel_size(folderStr,detStr) 29 29 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) 31 31 32 32 return phi -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Write_VSANS_QIS.ipf
r1151 r1152 396 396 Variable numTextLines,ii,jj,kk 397 397 Variable pixSizeX,pixSizeY 398 399 numTextLines = 23 398 Variable duration 399 400 numTextLines = 30 400 401 Make/O/T/N=(numTextLines) labelWave 401 402 … … 448 449 pixSizeX = V_getDet_x_pixel_size(type,detStr) 449 450 pixSizeY = V_getDet_y_pixel_size(type,detStr) 451 452 duration = V_getCount_time(type) 450 453 451 454 ///////// … … 471 474 labelWave[17] = "NumYPixels="+num2str(pixY) 472 475 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 ***" 474 485 // labelWave[20] = "Data columns are Qx - Qy - Qz - I(Qx,Qy) - Err I(Qx,Qy)" 475 486 // labelWave[20] = "Data columns are Qx - Qy - I(Qx,Qy) - Qz - SigmaQ_parall - SigmaQ_perp - fSubS(beam stop shadow)" 476 labelWave[2 0] = "Data columns are Qx - Qy - I(Qx,Qy) - err(I) - Qz - SigmaQ_parall - SigmaQ_perp - fSubS(beam stop shadow)"477 labelWave[2 1] = "The error wave may not be properly propagated (1/2019)"478 labelWave[2 2] = "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() 479 490 //strings can be too long to print-- must trim to 255 chars 480 491 for(jj=0;jj<numTextLines;jj+=1)
Note: See TracChangeset
for help on using the changeset viewer.