Changeset 1048
- Timestamp:
- Jun 23, 2017 2:17:07 PM (6 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MainPanel.ipf
r1045 r1048 250 250 End 251 251 252 Proc N G1TransConv_MainButtonProc(ctrlName) : ButtonControl253 String ctrlName 254 255 TransformToTransFile()252 Proc NonLinTubes_MainButtonProc(ctrlName) : ButtonControl 253 String ctrlName 254 255 V_TubeCoefPanel() 256 256 End 257 257 … … 462 462 // Button MainButton_4d,pos={15,180},size={110,20},proc=CatShort_MainButtonProc,title="CAT/Notebook" 463 463 // Button MainButton_4d,help={"This will generate a CATalog notebook of all files in a specified local folder"} 464 // Button MainButton_4e,pos={180,90},size={130,20},proc=NG1TransConv_MainButtonProc,title="NG1 Files to Trans"465 // Button MainButton_4e,help={"Converts NG1 transmission data files to be interpreted as such"}464 Button MainButton_4e,pos={180,90},size={130,20},proc=NonLinTubes_MainButtonProc,title="Fit NonLinear Tubes" 465 Button MainButton_4e,help={""} 466 466 Button MainButton_4f,pos={180,120},size={130,20},proc=PRODIV_MainButtonProc,title="Make DIV file" 467 467 Button MainButton_4f,help={"Merges two stored workfiles (CORrected) into a DIV file, and saves the result"} … … 475 475 // Button MainButton_4c,disable=1 476 476 // Button MainButton_4d,disable=1 477 //Button MainButton_4e,disable=1477 Button MainButton_4e,disable=1 478 478 Button MainButton_4f,disable=1 479 479 // Button MainButton_4g,disable=1 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_TubeAdjustments.ipf
r1047 r1048 8 8 // but the fundamental process is the same, and can be translated into proper functions as needed 9 9 // 10 // 11 12 13 // 14 // TODO 15 // -- need a way to generate the known, physical dimensions of the slots 16 // Make/O/D/N=5 peak_spacing_mm_ctr 17 // peak_spacing_mm_ctr = {-350,-190,0,190,350} (to be filled in with the correct measurements, 18 // possibly different for each panel) 19 // 20 // -- a 128 point wave "tube_pixel" (=p) is made in V_ArrayToTubes(), and is needed for the WM 21 // procedures to identify the peak positions. 22 // 23 // -- fit with either gauss or lor function to get non-integer pixel values for the peak locations 24 // 25 // -- do I fit each individually to "tweak" the located values, or fit all 5 at once with a 26 // custom fit function and guess some good starting values for peak height, location, etc. 27 // 28 // 29 // -- find a way to display all of the results - in a way that can quickly identify any fits 30 // that may be incorrect 31 // 32 // 10 33 11 34 … … 14 37 15 38 //(1) 16 //to get from individual tubes to an array 17 // Tubes_to_Array() 39 // 40 // to get from an array to individual tubes 41 // V_ArrayToTubes(detector) 42 // 43 // (not needed) to get from individual tubes to an array 44 // V_Tubes_to_Array() 18 45 19 46 //(2) 20 47 // then to locate all of the peak positions 21 // MakeTableForPeaks(numTube,numPeak)22 // Identify_AllPeaks()48 // V_MakeTableForPeaks(numTube,numPeak) 49 // V_Identify_AllPeaks() 23 50 // AutoFindPeaksCustom() // if Identify_AllPeaks doesn't work -try this, setting the "noise" to 1 and smoothing to 2 24 51 25 //(3) 52 // (3) Refine the fitted peak positions 53 // 54 55 //(4) 26 56 // fit to find all of the quadratic coefficients 27 57 // MakeTableForFitCoefs(numTube,numCoef) … … 29 59 30 60 31 //( 4)61 //(5) 32 62 // then pick a display method 33 63 // … … 54 84 55 85 56 57 58 59 86 // 60 87 // (0) -- what I start with: 61 88 // -- a table of the mm spacing of the slots (20 of them) … … 66 93 // 67 94 68 95 // TODO 96 // -- need a routine to set up the actual measurements of the slot positions 97 // 98 // 99 // TODO 100 // -- the slot positioning may be different for the L/R and T/B detectors 101 // 102 Proc V_SetupSlotDimensions() 103 Make/O/D/N=5 peak_spacing_mm_ctr 104 peak_spacing_mm_ctr = {-350,-190,0,190,350} 105 DoWindow/F Real_mm_Table 106 if(V_Flag == 0) 107 Edit/N=Real_mm_Table peak_spacing_mm_ctr 108 endif 109 End 110 111 112 113 // 69 114 // (1) -- get the individual tubes into an array 70 115 // … … 85 130 End 86 131 132 // or the other way around 87 133 Proc V_ArrayToTubes(wStr) 88 134 String wStr … … 94 140 dim0 = DimSize($wStr,0) 95 141 dim1 = DimSize($wStr,1) 142 96 143 97 144 Make/O/D/N=128 tube_pixel … … 136 183 // 137 184 Proc V_MakeTableForPeaks(numTube,numPeak) 138 Variable numTube,numPeak 139 140 Make/O/D/N=(numPeak,numTube) PeakTableX,peakTableY //*2 to store x-location and peak height (y) 141 Edit peakTableX 185 Variable numTube=48,numPeak=5 186 187 Make/O/D/N=(numPeak,numTube) PeakTableX,PeakTableY //*2 to store x-location and peak height (y) 188 189 DoWindow/F Peak_Pixel_Loc 190 if(V_flag == 0) 191 Edit/N=Peak_Pixel_Loc peakTableX 192 endif 193 DoAlert 0, "Load the Package: Analysis->MultiPeak Fitting->MultiPeak Fitting 2" 142 194 End 143 195 … … 176 228 Sort WA_PeakCentersX WA_PeakCentersY,WA_PeakCentersX 177 229 178 peakTableX[][ind] = WA_PeakCentersX[p] 179 peakTableY[][ind] = WA_PeakCentersY[p] 180 181 End 230 peakTableX[][ind] = WA_PeakCentersX[p] // the peak position 231 peakTableY[][ind] = WA_PeakCentersY[p] // the peak height 232 233 End 234 235 236 237 238 // ADD 239 // a step to refine the peak positioning - currently an integer value 240 // fit with a gauss or lorentzian 241 242 // CurveFit/M=2/W=0/TBOX=(0x310) lor, tube47[29,53]/X=tube_pixel[29,53]/D 243 244 //CurveFit/M=2/W=0 lor, tube47[29,53]/X=tube_pixel[29,53]/D 245 //fit_tube47= W_coef[0]+W_coef[1]/((x-W_coef[2])^2+W_coef[3]) 246 //W_coef={-20.37,876.94,40.078,0.5201} 247 //W_sigma={6.52,47.3,0.0241,0.0308} 248 249 Proc V_MakeTableForRefinedFit(numTube,numPeak) 250 Variable numTube=48,numPeak=5 251 252 Make/O/D/N=(numPeak,numTube) position_refined,position_refined_err // 253 254 DoWindow/F Refined_Positions 255 if(V_flag == 0) 256 Edit/N=Refined_Positions position_refined 257 endif 258 End 259 260 Proc V_Refine_All_PeakPos() 261 262 Variable ii,numTubes=48 263 264 ii=0 265 do 266 V_Refine_PeakPos(ii) 267 ii+=1 268 while(ii<numTubes) 269 270 End 271 272 273 //CurveFit/M=2/W=0 lor, tube47[29,53]/X=tube_pixel[29,53]/D 274 //fit_tube47= W_coef[0]+W_coef[1]/((x-W_coef[2])^2+W_coef[3]) 275 276 Proc V_Refine_PeakPos(ind) 277 Variable ind 278 279 // TODO 280 // -- hard-wired for 5 peaks 281 282 Variable ii,lo,hi 283 284 285 ii=0 286 do 287 288 if(ii==0) 289 // 1st peak 290 // define fitting range pixels (integer) 291 lo = 0 292 else 293 lo = trunc(0.5*(peakTableX[ii-1][ind] + peakTableX[ii][ind])) 294 endif 295 296 if(ii==4) 297 hi = numpnts(tube_pixel)-1 298 else 299 hi = trunc(0.5*(peakTableX[ii][ind] + peakTableX[ii+1][ind])) 300 endif 301 302 // do I need initial guesses? 303 CurveFit/M=0/W=2 lor, $("tube"+num2str(ind))[lo,hi]/X=tube_pixel[lo,hi]/D 304 305 position_refined[ii][ind] = W_coef[2] 306 position_refined_err[ii][ind] = W_sigma[2] 307 308 ii += 1 309 310 while(ii < 5) 311 312 End 313 314 315 316 182 317 183 318 // -- save a copy of the root:WA_PeakCentersY,root:WA_PeakCentersX values … … 219 354 220 355 Proc V_MakeTableForFitCoefs(numTube,numCoef) 221 Variable numTube,numCoef 222 223 Make/O/D/N=(numCoef,numTube) TubeCoefTable,TubeSigmaTable // 224 Edit TubeCoefTable 225 End 226 227 Proc V_PlotFit_AllPeaks() 356 Variable numTube=48,numCoef=3 357 358 Make/O/D/N=(numTube,numCoef) TubeCoefTable,TubeSigmaTable // 359 360 DoWindow/F Quad_Coefficients 361 if(V_flag == 0) 362 Edit/N=Quad_Coefficients TubeCoefTable 363 endif 364 End 365 366 Proc V_PlotFit_AllPeakPosition() 228 367 229 368 Variable ii,numTubes=48 … … 231 370 ii=0 232 371 do 233 V_PlotFit_Peak s(ii)372 V_PlotFit_PeakPosition(ii) 234 373 ii+=1 235 374 while(ii<numTubes) … … 237 376 End 238 377 239 Proc V_PlotFit_Peak s(ind)378 Proc V_PlotFit_PeakPosition(ind) 240 379 Variable ind 241 380 242 //hopefully 20 points - need better control of this243 381 Duplicate/O WA_PeakCentersX, tmpX 244 382 245 tmpX = peakTableX[p][ind] 246 Display peak_spacing_mm_ctr vs tmpX 247 248 CurveFit/M=2/W=0/TBOX=(0x310) poly 3, peak_spacing_mm_ctr/X=tmpX/D 249 250 TubeCoefTable[][ind] = W_coef[p] 251 TubeSigmaTable[][ind] = W_sigma[p] 383 // tmpX = peakTableX[p][ind] 384 tmpX = position_refined[p][ind] 385 // Display peak_spacing_mm_ctr vs tmpX 386 387 // CurveFit/M=2/W=0/TBOX=(0x310) poly 3, peak_spacing_mm_ctr/X=tmpX/D 388 CurveFit/M=0/W=2 poly 3, peak_spacing_mm_ctr/X=tmpX/D 389 390 TubeCoefTable[ind][] = W_coef[q] 391 TubeSigmaTable[ind][] = W_sigma[q] 252 392 253 393 End … … 304 444 do 305 445 Duplicate $("tube"+num2str(ii)) $("tube"+num2str(ii)+"_mm") 306 $("tube"+num2str(ii)+"_mm") = V_TubePix_to_mm(TubeCoefTable[ 0][ii-1],TubeCoefTable[1][ii-1],TubeCoefTable[2][ii-1],p)446 $("tube"+num2str(ii)+"_mm") = V_TubePix_to_mm(TubeCoefTable[ii-1][0],TubeCoefTable[ii-1][1],TubeCoefTable[ii-1][2],p) 307 447 ii+=1 308 448 while(ii<=numTubes) … … 331 471 InsertPoints 0,1, $("edge"+num2str(ii)+"_mm") //needs to be one point longer 332 472 // be sure to use the correct set of coefficients 333 $("edge"+num2str(ii)+"_mm")[0] = V_TubePix_to_mm(TubeCoefTable[0][0],TubeCoefTable[ 1][0],TubeCoefTable[2][0],-1)473 $("edge"+num2str(ii)+"_mm")[0] = V_TubePix_to_mm(TubeCoefTable[0][0],TubeCoefTable[0][1],TubeCoefTable[0][2],-1) 334 474 335 475 AppendImage $("tube"+num2str(ii)+"_mm_mat") vs {*,$("edge"+num2str(ii)+"_mm")} … … 565 705 End 566 706 707 708 709 //////////////////////////// 710 711 Proc V_TubeCoefPanel() : Panel 712 PauseUpdate; Silent 1 // building window... 713 NewPanel /W=(973,45,1156,535)/K=1 714 DoWindow/C V_TubeCoefPanel 715 // ShowTools/A 716 717 SetDrawLayer UserBack 718 SetDrawEnv fsize= 14,fstyle= 1 719 DrawText 5,58,"(1)" 720 SetDrawEnv fsize= 14,fstyle= 1 721 DrawText 5,108,"(2)" 722 SetDrawEnv fsize= 14,fstyle= 1 723 DrawText 5,158,"(3)" 724 SetDrawEnv fsize= 14,fstyle= 1 725 DrawText 5,208,"(4)" 726 SetDrawEnv fsize= 14,fstyle= 1 727 DrawText 5,258,"(5)" 728 SetDrawEnv fsize= 14,fstyle= 1 729 DrawText 5,308,"(6)" 730 SetDrawEnv fsize= 14,fstyle= 1 731 DrawText 5,358,"(7)" 732 SetDrawEnv fsize= 14,fstyle= 1 733 DrawText 5,408,"(8)" 734 SetDrawEnv fsize= 14,fstyle= 1 735 DrawText 5,458,"(9)" 736 737 Button button_0,pos={30.00,40.00},size={120.00,20.00},proc=V_Setup_MasksButton,title="Setup" 738 Button button_1,pos={30.00,90.00},size={120.00,20.00},proc=V_ArrayToTubesButton,title="Array to Tubes" 739 Button button_2,pos={30.00,140.00},size={120.00,20.00},proc=V_TableForPeaksButton,title="Table for Peaks" 740 Button button_3,pos={30.00,190.00},size={120.00,20.00},proc=V_IdentifyPeaksButton,title="Identify Peaks" 741 Button button_4,pos={30.00,240.00},size={120.00,20.00},proc=V_RefineTableButton,title="Refine Peak Table" 742 Button button_5,pos={30.00,290.00},size={120.00,20.00},proc=V_RefinePeaksButton,title="Refine Peaks" 743 744 Button button_6,pos={30.00,340.00},size={120.00,20.00},proc=V_QuadFitTableButton,title="Table for Quad" 745 Button button_7,pos={30.00,390.00},size={120.00,20.00},proc=V_QuadFitButton,title="Fit to Quad" 746 Button button_8,pos={30.00,440},size={120.00,20.00},proc=V_PeakPlotButton,title="Plot Peaks" 747 748 EndMacro 749 750 751 Function V_PeakPlotButton(ba) : ButtonControl 752 STRUCT WMButtonAction &ba 753 754 switch( ba.eventCode ) 755 case 2: // mouse up 756 // click code here 757 Execute "V_OpenPeakResultsGraph()" 758 break 759 case -1: // control being killed 760 break 761 endswitch 762 763 return 0 764 End 765 766 767 Function V_TableForPeaksButton(ba) : ButtonControl 768 STRUCT WMButtonAction &ba 769 770 switch( ba.eventCode ) 771 case 2: // mouse up 772 // click code here 773 Execute "V_MakeTableForPeaks()" 774 break 775 case -1: // control being killed 776 break 777 endswitch 778 779 return 0 780 End 781 782 783 Function V_IdentifyPeaksButton(ba) : ButtonControl 784 STRUCT WMButtonAction &ba 785 786 switch( ba.eventCode ) 787 case 2: // mouse up 788 // click code here 789 Execute "V_Identify_AllPeaks()" 790 break 791 case -1: // control being killed 792 break 793 endswitch 794 795 return 0 796 End 797 798 Function V_RefineTableButton(ba) : ButtonControl 799 STRUCT WMButtonAction &ba 800 801 switch( ba.eventCode ) 802 case 2: // mouse up 803 // click code here 804 Execute "V_MakeTableForRefinedFit()" 805 break 806 case -1: // control being killed 807 break 808 endswitch 809 810 return 0 811 End 812 813 Function V_RefinePeaksButton(ba) : ButtonControl 814 STRUCT WMButtonAction &ba 815 816 switch( ba.eventCode ) 817 case 2: // mouse up 818 // click code here 819 Execute "V_Refine_All_PeakPos()" 820 break 821 case -1: // control being killed 822 break 823 endswitch 824 825 return 0 826 End 827 828 Function V_QuadFitTableButton(ba) : ButtonControl 829 STRUCT WMButtonAction &ba 830 831 switch( ba.eventCode ) 832 case 2: // mouse up 833 // click code here 834 Execute "V_MakeTableForFitCoefs()" 835 break 836 case -1: // control being killed 837 break 838 endswitch 839 840 return 0 841 End 842 843 Function V_QuadFitButton(ba) : ButtonControl 844 STRUCT WMButtonAction &ba 845 846 switch( ba.eventCode ) 847 case 2: // mouse up 848 // click code here 849 Execute "V_PlotFit_AllPeakPosition()" 850 break 851 case -1: // control being killed 852 break 853 endswitch 854 855 return 0 856 End 857 858 859 860 Function V_Setup_MasksButton(ba) : ButtonControl 861 STRUCT WMButtonAction &ba 862 863 switch( ba.eventCode ) 864 case 2: // mouse up 865 // click code here 866 Execute "V_SetupSlotDimensions()" 867 break 868 case -1: // control being killed 869 break 870 endswitch 871 872 return 0 873 End 874 875 876 877 Function V_ArrayToTubesButton(ba) : ButtonControl 878 STRUCT WMButtonAction &ba 879 880 switch( ba.eventCode ) 881 case 2: // mouse up 882 // click code here 883 Execute "V_ArrayToTubes()" 884 break 885 case -1: // control being killed 886 break 887 endswitch 888 889 return 0 890 End 891 892 893 /////////////////////////// 894 895 896 Window Gizmo_refinedPositions() : GizmoPlot 897 PauseUpdate; Silent 1 // building window... 898 // Building Gizmo 7 window... 899 NewGizmo/W=(232,448,747,908) 900 ModifyGizmo startRecMacro=700 901 ModifyGizmo scalingOption=63 902 AppendToGizmo Surface=root:position_refined,name=surface0 903 ModifyGizmo ModifyObject=surface0,objectType=surface,property={ srcMode,0} 904 ModifyGizmo ModifyObject=surface0,objectType=surface,property={ surfaceCTab,Rainbow} 905 AppendToGizmo Axes=boxAxes,name=axes0 906 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={0,axisRange,-1,-1,-1,1,-1,-1} 907 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={1,axisRange,-1,-1,-1,-1,1,-1} 908 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={2,axisRange,-1,-1,-1,-1,-1,1} 909 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={3,axisRange,-1,1,-1,-1,1,1} 910 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={4,axisRange,1,1,-1,1,1,1} 911 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={5,axisRange,1,-1,-1,1,-1,1} 912 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={6,axisRange,-1,-1,1,-1,1,1} 913 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={7,axisRange,1,-1,1,1,1,1} 914 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={8,axisRange,1,-1,-1,1,1,-1} 915 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={9,axisRange,-1,1,-1,1,1,-1} 916 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={10,axisRange,-1,1,1,1,1,1} 917 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={11,axisRange,-1,-1,1,1,-1,1} 918 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={-1,axisScalingMode,1} 919 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={-1,axisColor,0,0,0,1} 920 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={0,ticks,2} 921 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={1,ticks,2} 922 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={2,ticks,2} 923 ModifyGizmo modifyObject=axes0,objectType=Axes,property={-1,Clipped,0} 924 ModifyGizmo setDisplayList=0, object=surface0 925 ModifyGizmo setDisplayList=1, object=axes0 926 ModifyGizmo autoscaling=1 927 ModifyGizmo currentGroupObject="" 928 ModifyGizmo showInfo 929 ModifyGizmo infoWindow={651,303,1468,602} 930 ModifyGizmo endRecMacro 931 ModifyGizmo SETQUATERNION={0.573113,-0.115160,-0.275160,0.763255} 932 EndMacro 933 934 Window Gizmo_DetPanel() : GizmoPlot 935 PauseUpdate; Silent 1 // building window... 936 // Building Gizmo 7 window... 937 NewGizmo/W=(96,290,611,750) 938 ModifyGizmo startRecMacro=700 939 ModifyGizmo scalingOption=63 940 AppendToGizmo Surface=root:slices_L,name=surface0 941 ModifyGizmo ModifyObject=surface0,objectType=surface,property={ srcMode,0} 942 ModifyGizmo ModifyObject=surface0,objectType=surface,property={ surfaceCTab,ColdWarm} 943 AppendToGizmo Axes=boxAxes,name=axes0 944 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={0,axisRange,-1,-1,-1,1,-1,-1} 945 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={1,axisRange,-1,-1,-1,-1,1,-1} 946 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={2,axisRange,-1,-1,-1,-1,-1,1} 947 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={3,axisRange,-1,1,-1,-1,1,1} 948 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={4,axisRange,1,1,-1,1,1,1} 949 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={5,axisRange,1,-1,-1,1,-1,1} 950 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={6,axisRange,-1,-1,1,-1,1,1} 951 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={7,axisRange,1,-1,1,1,1,1} 952 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={8,axisRange,1,-1,-1,1,1,-1} 953 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={9,axisRange,-1,1,-1,1,1,-1} 954 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={10,axisRange,-1,1,1,1,1,1} 955 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={11,axisRange,-1,-1,1,1,-1,1} 956 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={-1,axisScalingMode,1} 957 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={-1,axisColor,0,0,0,1} 958 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={0,ticks,3} 959 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={1,ticks,3} 960 ModifyGizmo ModifyObject=axes0,objectType=Axes,property={2,ticks,3} 961 ModifyGizmo modifyObject=axes0,objectType=Axes,property={-1,Clipped,0} 962 AppendToGizmo Surface=root:position_refined,name=surface1 963 ModifyGizmo ModifyObject=surface1,objectType=surface,property={ fillMode,4} 964 ModifyGizmo ModifyObject=surface1,objectType=surface,property={ srcMode,0} 965 ModifyGizmo ModifyObject=surface1,objectType=surface,property={ surfaceCTab,Rainbow} 966 ModifyGizmo setDisplayList=0, object=axes0 967 ModifyGizmo setDisplayList=1, object=surface0 968 ModifyGizmo autoscaling=1 969 ModifyGizmo currentGroupObject="" 970 ModifyGizmo showInfo 971 ModifyGizmo infoWindow={550,23,1367,322} 972 ModifyGizmo endRecMacro 973 ModifyGizmo SETQUATERNION={0.499484,-0.278571,-0.448869,0.686609} 974 EndMacro 975 976 977 //////////////////////////////////// 978 // 979 // An easy way to see the fit results to check if the peak locations all make sense. 980 // 981 Proc V_OpenPeakResultsGraph() 982 983 DoWindow/F V_PeakResultsGraph 984 if(V_flag == 0) 985 Make/O/D/N=5 tmpPeak,dummyLevel 986 Make/O/D/N=128 tmpTube 987 988 tmpPeak = position_refined[p][0] 989 dummyLevel = WaveMax(tube0) 990 tmpTube = tube0 991 992 V_PeakResultsGraph() 993 endif 994 995 End 996 997 Window V_PeakResultsGraph() : Graph 998 PauseUpdate; Silent 1 // building window... 999 Display /W=(750,45,1161,376)/K=1 tmpTube vs tube_pixel 1000 1001 ControlBar 50 1002 1003 1004 AppendToGraph dummyLevel vs tmpPeak 1005 ModifyGraph mode(dummyLevel)=3 1006 ModifyGraph marker(dummyLevel)=19 1007 ModifyGraph rgb(dummyLevel)=(1,16019,65535) 1008 1009 SetVariable setvar0,pos={10.00,10.00},size={120.00,14.00},proc=V_TubePeakSetVarProc,title="Tube" 1010 SetVariable setvar0,limits={0,47,1},value= _NUM:0 1011 1012 Label left "Counts" 1013 Label bottom "Pixel Number" 1014 EndMacro 1015 1016 1017 Function V_TubePeakSetVarProc(sva) : SetVariableControl 1018 STRUCT WMSetVariableAction &sva 1019 1020 switch( sva.eventCode ) 1021 case 1: // mouse up 1022 case 2: // Enter key 1023 case 3: // Live update 1024 Variable dval = sva.dval 1025 String sval = sva.sval 1026 1027 Wave tmpPeak = tmpPeak 1028 Wave dummyLevel = dummyLevel 1029 Wave tmpTube = tmpTube 1030 1031 Wave pos_ref = position_refined 1032 Wave tube = $("tube"+num2str(dval)) 1033 1034 tmpPeak = pos_ref[p][dval] 1035 dummyLevel = WaveMax(tube) 1036 tmpTube = tube 1037 1038 break 1039 case -1: // control being killed 1040 break 1041 endswitch 1042 1043 return 0 1044 End 1045 1046 //////////////////////////////////// 1047 1048 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_VSANS_Event_Testing.ipf
r1047 r1048 53 53 // 54 54 55 56 // 57 Structure eventWord58 uchar eventTime[6]59 uchar location60 uchar tube61 endStructure55 // 56 //// 57 //Structure eventWord 58 // uchar eventTime[6] 59 // uchar location 60 // uchar tube 61 //endStructure 62 62 63 63
Note: See TracChangeset
for help on using the changeset viewer.