- Timestamp:
- Aug 14, 2018 12:19:01 PM (4 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Attenuation.ipf
r1104 r1113 150 150 // fill in a "dummy" wavelength for White Beam and graphite 151 151 // *= 1e3 for White Beam 152 // *= 1e6 for graphite 152 // *= 1e6 for graphite (***NO***) Per John, we can use the VS calibration for HOPG 153 153 // use these dummy values just for the lookup table 154 154 // … … 184 184 break 185 185 case "crystal": 186 lambda *= 1e6 186 187 // lambda *= 1e6 // as of July 2018, use the velocity selector tables for the graphite 188 187 189 break 188 190 default: // optional default expression executed … … 211 213 // fill in a "dummy" wavelength for White Beam and graphite 212 214 // *= 1e3 for White Beam 213 // *= 1e6 for graphite 215 // *= 1e6 for graphite (***NO***) Per John, we can use the VS calibration for HOPG 214 216 // use these dummy values just for the lookup table 215 217 // … … 242 244 break 243 245 case "crystal": 244 lambda *= 1e6 246 247 // lambda *= 1e6 // as of July 2018, use the velocity selector tables for the graphite 248 245 249 break 246 250 default: // optional default expression executed -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_FileCatalog.ipf
r1106 r1113 98 98 Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Purpose" 99 99 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 100 100 101 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 102 Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" 103 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" 104 105 106 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 107 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 108 101 109 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD_F" 102 110 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:TotCnts_F" … … 111 119 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntRate_B" 112 120 113 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda"114 Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides"115 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime"116 117 118 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission"119 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness"120 121 121 // Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 122 122 // Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Marquee_Operations.ipf
r1110 r1113 199 199 Wave data_err = V_getDetectorDataErrW(type,detStr) 200 200 201 201 202 202 err2_sum = 0 // running total of the squared error 203 203 ii=x1 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf
r1112 r1113 1301 1301 End 1302 1302 1303 1304 1305 // TODO 1306 // -- this is a trimmed down version of the "full" set of averaging options 1307 // add to this as needed as I figure out what functionality is appropriate 1308 // 1309 // 1303 1310 //button action procedure to get the type of average requested by the user 1304 1311 //presented as a missing parameter dialog, which is really user-UN-friendly … … 1309 1316 String ctrlName 1310 1317 1311 // Execute "V_GetAvgInfo_Full()" 1312 Execute "V_GetAvgInfo()" 1313 1314 //set the global string 1315 SVAR tempStr = root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr 1316 String/G root:Packages:NIST:VSANS:Globals:Protocols:gAVE = tempStr 1317 1318 End 1319 1320 // TODO 1321 // -- this is a trimmed down version of the "full" set of averaging options 1322 // add to this as needed as I figure out what functionality is appropriate 1323 // 1324 //procedure called by protocol panel to ask user for average type choices 1325 // somewhat confusing and complex, but may be as good as it gets. 1326 // 1327 //Proc V_GetAvgInfo(av_typ,autoSave,autoName,autoPlot,side,phi,dphi,width,QCtr,QDelta) 1328 Proc V_GetAvgInfo(av_typ,autoSave,autoName,binType,qCtr,qDelta,detGroup) 1318 SVAR gAvgInfoStr = root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr 1319 1329 1320 String av_typ,autoSave,AutoName,binType 1330 1321 // Variable phi=0,dphi=10,width=10,Qctr = 0.01,qDelta=10 1331 Variable Qctr=0.1,qDelta=0.01 1332 String detGroup="F" 1322 Variable Qctr,qDelta 1323 String detGroup 1324 1325 if(strlen(gAvgInfoStr) > 0) 1326 // fill the dialog with the current choice, not resetting to default 1327 // can't do this, or it will simply bypass the missing parameter dialog! 1328 // V_GetAvgInfo(av_typ,autoSave,autoName,binType,qCtr,qDelta,detGroup) 1329 av_typ = StringByKey("AVTYPE", gAvgInfoStr ,"=",";") 1330 autoSave = StringByKey("SAVE", gAvgInfoStr ,"=",";") 1331 autoName = StringByKey("NAME", gAvgInfoStr ,"=",";") 1332 binType = StringByKey("BINTYPE", gAvgInfoStr ,"=",";") 1333 qCtr = NumberByKey("QCENTER", gAvgInfoStr ,"=",";") 1334 qDelta = NumberByKey("QDELTA", gAvgInfoStr ,"=",";") 1335 detGroup = StringByKey("DETGROUP", gAvgInfoStr ,"=",";") 1336 // Execute "V_GetAvgInfo_Full()" 1337 // Execute "V_GetAvgInfo()" 1338 endif 1339 1333 1340 1334 1341 // Prompt av_typ, "Type of Average",popup,"Circular;Sector;Rectangular;Annular;2D_ASCII;QxQy_ASCII;PNG_Graphic;Sector_PlusMinus;" … … 1349 1356 Prompt Qdelta,"(+/-) q-width of annulus" 1350 1357 Prompt detGroup,"Group for annulus" 1358 1359 1360 DoPrompt "Enter Averaging Parameters",av_typ,autoSave,autoName,binType,qCtr,qDelta,detGroup 1361 if (V_Flag) 1362 return(0) // User canceled 1363 endif 1351 1364 1352 1365 //assign results of dialog to key=value string, semicolon separated 1353 1366 //do only what is necessary, based on av_typ 1354 String/G root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr="" 1367 // 1368 // reset the string 1369 gAvgInfoStr="" 1355 1370 1356 1371 // TODO: … … 1360 1375 1361 1376 // all averages need these values 1362 root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "AVTYPE=" + av_typ + ";"1363 root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "SAVE=" + autoSave + ";"1364 root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "NAME=" + autoName + ";"1365 root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "PLOT=" + autoPlot + ";"1366 root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "BINTYPE=" + binType + ";"1377 gAvgInfoStr += "AVTYPE=" + av_typ + ";" 1378 gAvgInfoStr += "SAVE=" + autoSave + ";" 1379 gAvgInfoStr += "NAME=" + autoName + ";" 1380 gAvgInfoStr += "PLOT=" + autoPlot + ";" 1381 gAvgInfoStr += "BINTYPE=" + binType + ";" 1367 1382 1368 1383 // if(cmpstr(av_typ,"Sector")==0 || cmpstr(av_typ,"Sector_PlusMinus")==0) 1369 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "SIDE=" + side + ";"1370 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "PHI=" + num2str(phi) + ";"1371 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "DPHI=" + num2str(dphi) + ";"1384 // gAvgInfoStr += "SIDE=" + side + ";" 1385 // gAvgInfoStr += "PHI=" + num2str(phi) + ";" 1386 // gAvgInfoStr += "DPHI=" + num2str(dphi) + ";" 1372 1387 // Endif 1373 1388 // 1374 1389 // if(cmpstr(av_typ,"Rectangular")==0) 1375 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "SIDE=" + side + ";"1376 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "PHI=" + num2str(phi) + ";"1377 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "WIDTH=" + num2str(width) + ";"1390 // gAvgInfoStr += "SIDE=" + side + ";" 1391 // gAvgInfoStr += "PHI=" + num2str(phi) + ";" 1392 // gAvgInfoStr += "WIDTH=" + num2str(width) + ";" 1378 1393 // Endif 1379 1394 // 1380 1395 if(cmpstr(av_typ,"Annular")==0) 1381 root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "QCENTER=" + num2str(QCtr) + ";"1382 root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "QDELTA=" + num2str(QDelta) + ";"1383 root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "DETGROUP=" + detGroup + ";"1396 gAvgInfoStr += "QCENTER=" + num2str(QCtr) + ";" 1397 gAvgInfoStr += "QDELTA=" + num2str(QDelta) + ";" 1398 gAvgInfoStr += "DETGROUP=" + detGroup + ";" 1384 1399 Endif 1385 End 1400 1401 //set the global string after user choices 1402 String/G root:Packages:NIST:VSANS:Globals:Protocols:gAVE = gAvgInfoStr 1403 1404 return(0) 1405 End 1406 1407 1408 // 1409 // --- To avoid resetting the dialog with default values, the work is done in 1410 // V_SetAverageParamsButtonProc -- 1411 // 1412 // 1413 //procedure called by protocol panel to ask user for average type choices 1414 // somewhat confusing and complex, but may be as good as it gets. 1415 // 1416 //Proc V_GetAvgInfo(av_typ,autoSave,autoName,autoPlot,side,phi,dphi,width,QCtr,QDelta) 1417 //Proc V_GetAvgInfo(av_typ,autoSave,autoName,binType,qCtr,qDelta,detGroup) 1418 // String av_typ,autoSave,AutoName,binType 1419 //// Variable phi=0,dphi=10,width=10,Qctr = 0.01,qDelta=10 1420 // Variable Qctr=0.1,qDelta=0.01 1421 // String detGroup="F" 1422 // 1423 //// Prompt av_typ, "Type of Average",popup,"Circular;Sector;Rectangular;Annular;2D_ASCII;QxQy_ASCII;PNG_Graphic;Sector_PlusMinus;" 1424 // Prompt av_typ, "Type of Average",popup,"Circular;Narrow_Slit;Annular;" 1425 // 1426 //// comment out above line in DEMO_MODIFIED version, and uncomment the line below (to disable PNG save) 1427 //// Prompt av_typ, "Type of Average",popup,"Circular;Sector;Rectangular;Annular;2D_ASCII;QxQy_ASCII" 1428 // Prompt autoSave,"Save files to disk?",popup,"Yes - Concatenate;Yes - Individual;No" 1429 // Prompt autoName,"Auto-Name files?",popup,"Auto;Manual" 1430 //// Prompt autoPlot,"Plot the averaged Data?",popup,"Yes;No" 1431 //// Prompt side,"Include detector halves?",popup,"both;right;left" 1432 //// Prompt phi,"Orientation Angle (-90,90) degrees (Rectangular or Sector)" 1433 //// Prompt dphi, "Azimuthal range (0,45) degrees (Sector only)" 1434 //// Prompt width, "Width of Rectangular average (1,128)" 1435 // Prompt binType,"Binning Type?",popup,ksBinTypeStr 1436 // 1437 // Prompt Qctr, "q-value of center of annulus" 1438 // Prompt Qdelta,"(+/-) q-width of annulus" 1439 // Prompt detGroup,"Group for annulus" 1440 // 1441 // //assign results of dialog to key=value string, semicolon separated 1442 // //do only what is necessary, based on av_typ 1443 // String/G root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr="" 1444 // 1445 // // TODO: 1446 // // hard wired value 1447 // String autoPlot = "Yes" 1448 // 1449 // 1450 // // all averages need these values 1451 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "AVTYPE=" + av_typ + ";" 1452 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "SAVE=" + autoSave + ";" 1453 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "NAME=" + autoName + ";" 1454 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "PLOT=" + autoPlot + ";" 1455 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "BINTYPE=" + binType + ";" 1456 // 1457 //// if(cmpstr(av_typ,"Sector")==0 || cmpstr(av_typ,"Sector_PlusMinus")==0) 1458 //// root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "SIDE=" + side + ";" 1459 //// root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "PHI=" + num2str(phi) + ";" 1460 //// root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "DPHI=" + num2str(dphi) + ";" 1461 //// Endif 1462 //// 1463 //// if(cmpstr(av_typ,"Rectangular")==0) 1464 //// root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "SIDE=" + side + ";" 1465 //// root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "PHI=" + num2str(phi) + ";" 1466 //// root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "WIDTH=" + num2str(width) + ";" 1467 //// Endif 1468 //// 1469 // if(cmpstr(av_typ,"Annular")==0) 1470 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "QCENTER=" + num2str(QCtr) + ";" 1471 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "QDELTA=" + num2str(QDelta) + ";" 1472 // root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr += "DETGROUP=" + detGroup + ";" 1473 // Endif 1474 //End 1386 1475 1387 1476 … … 2005 2094 String samFileLoaded = file_name //keep a copy of the sample file loaded 2006 2095 2096 SVAR samFiles = root:Packages:NIST:VSANS:Globals:Protocols:gSAM 2097 samFiles = samStr 2098 2007 2099 //always update 2008 2100 V_UpdateDisplayInformation(ActiveType) … … 2436 2528 2437 2529 2438 // x- need to get the panel string for the sum. 2439 // x- the detector string is currently hard-wired 2440 // detStr = "MR" 2441 2530 if(cmpstr(detStr,"B") == 0 ) 2531 Print "Median Filtering RAW data" 2532 Wave w = V_getDetectorDataW("RAW",detStr) 2533 MatrixFilter /N=3 median w 2534 endif 2442 2535 2443 2536 emptyCts = V_SumCountsInBox(xyBoxW[0],xyBoxW[1],xyBoxW[2],xyBoxW[3],empty_ct_err,"RAW",detPanel_toSum) … … 2448 2541 // if it's the back panel, find the read noise to subtract 2449 2542 // shift the marquee to the right to (hopefully) a blank spot 2450 Variable noiseCts,noiseCtsErr,delta 2543 Variable noiseCts,noiseCtsErr,delta,nPixInBox 2451 2544 if(isBack) 2452 delta = xyBoxW[1] - xyBoxW[0] 2453 noiseCts = V_SumCountsInBox(xyBoxW[1],xyBoxW[1]+delta,xyBoxW[2],xyBoxW[3],noiseCtsErr,"RAW",detPanel_toSum) 2454 2455 print "average read noise per pixel = ",noiseCts/(xyBoxW[1]-xyBoxW[0])/(xyBoxW[3]-xyBoxW[2]) 2456 Print "read noise counts = ",noiseCts 2457 Print "read noise err/counts = ",noiseCtsErr/noiseCts 2458 2459 emptyCts -= noiseCts 2460 empty_ct_err = sqrt(empty_ct_err^2 + noiseCtsErr^2) 2461 2545 2546 2547 // delta = xyBoxW[1] - xyBoxW[0] 2548 // noiseCts = V_SumCountsInBox(xyBoxW[1],xyBoxW[1]+delta,xyBoxW[2],xyBoxW[3],noiseCtsErr,"RAW",detPanel_toSum) 2549 // 2550 // print "average read noise per pixel = ",noiseCts/(xyBoxW[1]-xyBoxW[0])/(xyBoxW[3]-xyBoxW[2]) 2551 // Print "read noise counts = ",noiseCts 2552 // Print "read noise err/counts = ",noiseCtsErr/noiseCts 2553 // 2554 // emptyCts -= noiseCts 2555 // empty_ct_err = sqrt(empty_ct_err^2 + noiseCtsErr^2) 2556 2557 2558 // Instead, use the defined constant values 2559 // kReadNoiseLevel 2560 // kReadNoiseLevel_Err 2561 // 2562 nPixInBox = (xyBoxW[1] - xyBoxW[0])*(xyBoxW[3]-xyBoxW[2]) 2563 emptyCts -= kReadNoiseLevel*nPixInBox 2564 empty_ct_err = sqrt(empty_ct_err^2 + (kReadNoiseLevel_Err*nPixInBox)^2) 2565 2462 2566 Print "adjusted empty counts = ",emptyCts 2463 2567 Print "adjusted err/counts = ",empty_ct_err/emptyCts -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WorkFolderUtils.ipf
r1111 r1113 513 513 w -= kReadNoiseLevel // a constant value 514 514 515 MatrixFilter /N=3 median w516 Print "*** median noise filter applied to the back detector ***"515 MatrixFilter /N=3 /P=3 median w // /P=n flag sets the number of passes (default is 1 pass) 516 Print "*** median noise filter applied to the back detector (3 passes) ***" 517 517 endif 518 518
Note: See TracChangeset
for help on using the changeset viewer.