Changeset 1121 for sans/Dev/trunk/NCNR_User_Procedures/Reduction
- Timestamp:
- Feb 5, 2019 3:13:21 PM (4 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VSANS_Includes.ipf
r1104 r1121 130 130 131 131 #include "V_Utilities_Comparisons" 132 #include "V_Sector_Average" 132 133 133 134 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_IQ_Utilities.ipf
r1111 r1121 496 496 Wave qb = tmp_qb 497 497 Wave fs = tmp_fs 498 499 // zero point waves can be generated from sector averages, exit now 500 if(numpnts(qw) == 0) 501 SetDataFolder root: 502 return(1) 503 endif 498 504 499 505 Variable q1,q2,tol,ii … … 748 754 SetDataFolder $("root:Packages:NIST:VSANS:"+folderStr) 749 755 750 Printf "%d points removed from beginning, %d points from the end of %s \r",nbeg,nend,detStr751 756 752 757 // TODO … … 768 773 Wave/Z qBar = $("qBar_qxqy_"+detStr) 769 774 Wave/Z fSubS = $("fSubS_qxqy_"+detStr) 770 775 776 // check for the existence of every wave + non-zero length 777 // zero length/null waves can be generated with sector averages 778 // exit if something is wrong 779 if(waveExists(qw) == 0 || numpnts(qw) == 0) 780 SetDataFolder root: 781 return(1) 782 endif 783 if(waveExists(iw) == 0 || numpnts(iw) == 0) 784 SetDataFolder root: 785 return(1) 786 endif 787 if(waveExists(ew) == 0 || numpnts(ew) == 0) 788 SetDataFolder root: 789 return(1) 790 endif 791 if(waveExists(sigQ) == 0 || numpnts(sigQ) == 0) 792 SetDataFolder root: 793 return(1) 794 endif 795 if(waveExists(qBar) == 0 || numpnts(qBar) == 0) 796 SetDataFolder root: 797 return(1) 798 endif 799 if(waveExists(fSubS) == 0 || numpnts(fSubS) == 0) 800 SetDataFolder root: 801 return(1) 802 endif 803 804 805 // waves all exist 771 806 DeletePoints 0,nBeg, qw,iw,ew,sigQ,qBar,fSubS 772 807 … … 775 810 DeletePoints npt-nEnd,nEnd, qw,iw,ew,sigQ,qBar,fSubS 776 811 812 Printf "%d points removed from beginning, %d points from the end of %s \r",nbeg,nend,detStr 813 SetDataFolder root: 777 814 return(0) 778 815 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf
r1117 r1121 741 741 AppendImage/W=MaskEditPanel currentTube 742 742 // ModifyImage/W=MaskEditPanel#DetData overlay ctab= {0.9,1,BlueRedGreen,0} ,minRGB=NaN,maxRGB=0 743 ModifyImage/W=MaskEditPanel overlay ctab= {0.9,0.95,BlueRedGreen,0} ,minRGB=NaN,maxRGB=(0,65000,0, 40000)743 ModifyImage/W=MaskEditPanel overlay ctab= {0.9,0.95,BlueRedGreen,0} ,minRGB=NaN,maxRGB=(0,65000,0,35000) 744 744 ModifyImage/W=MaskEditPanel currentTube ctab= {0.9,1,CyanMagenta,0} ,minRGB=NaN,maxRGB=0 745 745 // ModifyImage/W=MaskEditPanel#DetData overlay ctab= {0,*,BlueRedGreen,0} -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf
r1119 r1121 1318 1318 SVAR gAvgInfoStr = root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr 1319 1319 1320 String av_typ,autoSave,AutoName,binType 1321 // Variable phi=0,dphi=10,width=10,Qctr = 0.01,qDelta=10 1322 Variable Qctr,qDelta 1320 String av_typ,autoSave,AutoName,binType,side 1321 Variable phi,dphi,width=10,Qctr = 0.01,qDelta=10 1323 1322 String detGroup 1324 1323 … … 1334 1333 qDelta = NumberByKey("QDELTA", gAvgInfoStr ,"=",";") 1335 1334 detGroup = StringByKey("DETGROUP", gAvgInfoStr ,"=",";") 1335 phi = NumberByKey("PHI", gAvgInfoStr ,"=",";") 1336 dphi = NumberByKey("DPHI", gAvgInfoStr ,"=",";") 1337 1336 1338 // Execute "V_GetAvgInfo_Full()" 1337 1339 // Execute "V_GetAvgInfo()" … … 1340 1342 1341 1343 // Prompt av_typ, "Type of Average",popup,"Circular;Sector;Rectangular;Annular;2D_ASCII;QxQy_ASCII;PNG_Graphic;Sector_PlusMinus;" 1342 Prompt av_typ, "Type of Average",popup,"Circular;Narrow_Slit;Annular; QxQy_ASCII;"1344 Prompt av_typ, "Type of Average",popup,"Circular;Narrow_Slit;Annular;Sector;QxQy_ASCII;" 1343 1345 1344 1346 // comment out above line in DEMO_MODIFIED version, and uncomment the line below (to disable PNG save) … … 1347 1349 Prompt autoName,"Auto-Name files?",popup,"Auto;Manual" 1348 1350 // Prompt autoPlot,"Plot the averaged Data?",popup,"Yes;No" 1349 //Prompt side,"Include detector halves?",popup,"both;right;left"1350 //Prompt phi,"Orientation Angle (-90,90) degrees (Rectangular or Sector)"1351 //Prompt dphi, "Azimuthal range (0,45) degrees (Sector only)"1351 Prompt side,"Include detector halves?",popup,"both;right;left" 1352 Prompt phi,"Orientation Angle (-90,90) degrees (Rectangular or Sector)" 1353 Prompt dphi, "Azimuthal range (0,45) degrees (Sector only)" 1352 1354 // Prompt width, "Width of Rectangular average (1,128)" 1353 1355 Prompt binType,"Binning Type?",popup,ksBinTypeStr … … 1358 1360 1359 1361 1360 DoPrompt "Enter Averaging Parameters",av_typ,autoSave,autoName,binType,qCtr,qDelta,detGroup 1362 DoPrompt "Enter Averaging Parameters",av_typ,autoSave,autoName,binType,qCtr,qDelta,detGroup,side,phi,dphi 1361 1363 if (V_Flag) 1362 1364 return(0) // User canceled … … 1381 1383 gAvgInfoStr += "BINTYPE=" + binType + ";" 1382 1384 1383 //if(cmpstr(av_typ,"Sector")==0 || cmpstr(av_typ,"Sector_PlusMinus")==0)1384 //gAvgInfoStr += "SIDE=" + side + ";"1385 //gAvgInfoStr += "PHI=" + num2str(phi) + ";"1386 //gAvgInfoStr += "DPHI=" + num2str(dphi) + ";"1387 //Endif1385 if(cmpstr(av_typ,"Sector")==0 || cmpstr(av_typ,"Sector_PlusMinus")==0) 1386 gAvgInfoStr += "SIDE=" + side + ";" 1387 gAvgInfoStr += "PHI=" + num2str(phi) + ";" 1388 gAvgInfoStr += "DPHI=" + num2str(dphi) + ";" 1389 Endif 1388 1390 // 1389 1391 // if(cmpstr(av_typ,"Rectangular")==0) … … 3162 3164 3163 3165 case "Sector": 3164 // CircularAverageTo1D(activeType) 3166 String side = StringByKey("SIDE",avgStr,"=",";") 3167 Variable phi_rad = (Pi/180)*NumberByKey("PHI",avgStr,"=",";") //in radians 3168 Variable dphi_rad = (Pi/180)*NumberByKey("DPHI",avgStr,"=",";") 3169 V_QBinAllPanels_Sector(activeType,binType,collimationStr,side,phi_rad,dphi_rad) 3165 3170 break 3166 3171 case "Sector_PlusMinus": … … 3218 3223 3219 3224 case "Circular": 3225 case "Sector": 3220 3226 V_PlotData_Panel() //this brings the plot window to the front, or draws it (ONLY) 3221 3227 V_Update1D_Graph(activeType,binType) //update the graph, data was already binned 3222 break3223 case "Sector":3224 // CircularAverageTo1D(activeType)3225 3228 break 3226 3229 case "Sector_PlusMinus": -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Write_VSANS_QIS.ipf
r1120 r1121 394 394 String a1Str 395 395 Variable pixX,pixY 396 Variable numTextLines=19,ii,jj,kk 397 396 Variable numTextLines,ii,jj,kk 397 Variable pixSizeX,pixSizeY 398 399 numTextLines = 23 398 400 Make/O/T/N=(numTextLines) labelWave 399 401 … … 443 445 // or -- V_getBeamStopC3_size(type) 444 446 bstop = V_getBeamStopC2_size(type) 447 448 pixSizeX = V_getDet_x_pixel_size(type,detStr) 449 pixSizeY = V_getDet_y_pixel_size(type,detStr) 445 450 446 451 ///////// … … 461 466 labelWave[12] = "Average Choices: "+proto[5] 462 467 labelWave[13] = "Collimation type: "+proto[9] 463 labelWave[14] = "" 464 labelWave[15] = "*** Data written from "+type+" folder and may not be a fully corrected data file ***" 465 // labelWave[16] = "Data columns are Qx - Qy - Qz - I(Qx,Qy) - Err I(Qx,Qy)" 466 // labelWave[16] = "Data columns are Qx - Qy - I(Qx,Qy) - Qz - SigmaQ_parall - SigmaQ_perp - fSubS(beam stop shadow)" 467 labelWave[16] = "Data columns are Qx - Qy - I(Qx,Qy) - err(I) - Qz - SigmaQ_parall - SigmaQ_perp - fSubS(beam stop shadow)" 468 labelWave[17] = "The error wave may not be properly propagated (1/2019)" 469 labelWave[18] = "ASCII data created " +date()+" "+time() 468 labelWave[14] = "Panel = "+detStr 469 labelWave[15] = "NumXPixels="+num2str(pixX) 470 labelWave[16] = "XPixelSize_mm="+num2str(pixSizeX) 471 labelWave[17] = "NumYPixels="+num2str(pixY) 472 labelWave[18] = "YPixelSize_mm="+num2str(pixSizeY) 473 labelWave[19] = "*** Data written from "+type+" folder and may not be a fully corrected data file ***" 474 // labelWave[20] = "Data columns are Qx - Qy - Qz - I(Qx,Qy) - Err I(Qx,Qy)" 475 // 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() 470 479 //strings can be too long to print-- must trim to 255 chars 471 480 for(jj=0;jj<numTextLines;jj+=1) … … 518 527 // qval = CalcQval(p+1,q+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) 519 528 Duplicate/O qTot,phi,r_dist 520 Variable pixSizeX,pixSizeY,xctr,yctr 521 pixSizeX = V_getDet_x_pixel_size(type,detStr) 522 pixSizeY = V_getDet_y_pixel_size(type,detStr) 529 Variable xctr,yctr 530 523 531 524 532 xctr = V_getDet_beam_center_x_pix(type,detStr) … … 603 611 End 604 612 605 // this assumes that: 606 // --QxQy data was written out in the format specified by the Igor macros, that is the x varies most rapidly 607 // 608 // TODO -- this needs to be made generic for reading in different panels with different XY dimensions 609 // -- add the XY dimensions to the QxQyASCII file header somewhere so that it can be read in and used here 610 // 611 // the SANS analysis 2D loader assumes that the matrix is square, mangling the VSANS data. 612 // the column data (for fitting) is still fine, but the matrix representation is incorrect. 613 // 614 Function V_ConvertQxQy2Mat(Qx,Qy,inten,matStr) 615 Wave Qx,Qy,inten 616 String matStr 617 618 String folderStr=GetWavesDataFolder(Qx,1) 619 620 Variable numX,numY 621 numX=48 622 numY=128 623 Make/O/D/N=(numX,numY) $(folderStr + matStr) 624 Wave mat=$(folderStr + matStr) 625 626 WaveStats/Q Qx 627 SetScale/I x, V_min, V_max, "", mat 628 WaveStats/Q Qy 629 SetScale/I y, V_min, V_max, "", mat 630 631 Variable xrows=numX 632 633 mat = inten[q*xrows+p] 634 635 return(0) 636 End 637 638 613
Note: See TracChangeset
for help on using the changeset viewer.