Changeset 776
- Timestamp:
- Dec 17, 2010 5:20:39 PM (11 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ANSTO_DataReadWrite.ipf
r726 r776 202 202 String/G root:Packages:NIST:RAW:fileList = textw[0] 203 203 204 Duplicate/O data $"root:Packages:NIST:RAW:linear_data" //data read in is on linear scale, copy it now 205 204 206 Return 0 205 207 … … 298 300 String/G $(curPath + ":fileList") = textw[0] 299 301 302 Duplicate/O data linear_data //data read in is on linear scale, copy it now 303 300 304 //return the data folder to root 301 305 SetDataFolder root: -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/DisplayUtils.ipf
r570 r776 271 271 //check the waves for existence before operating on them 272 272 String msg = "" 273 If(WaveExists($dest+": data") == 0)274 msg = " data not found in "+folder+" folder. Action aborted."273 If(WaveExists($dest+":linear_data") == 0) 274 msg = "linear_data not found in "+folder+" folder. Action aborted." 275 275 DoAlert 0, msg 276 276 Return (1) //error … … 278 278 279 279 WAVE data=$(dest + ":data") 280 280 WAVE linear_data=$(dest + ":linear_data") 281 281 // works on a copy of the linear_data, so that the original data is always preserved 282 282 283 Duplicate/O $(dest + ":data") $(dest + ":linear_data")284 data = log( data)283 // Duplicate/O $(dest + ":data") $(dest + ":linear_data") 284 data = log(linear_data) 285 285 286 286 //Call the procedure that would normally be called if the threshold functions were activated -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/HFIR_DataReadWrite.ipf
r706 r776 205 205 String/G fileList = textw[0] 206 206 //return the data folder to root 207 208 WAVE data=$"root:Packages:NIST:RAW:data" 209 Duplicate/O data $"root:Packages:NIST:RAW:linear_data" // data is "fresh" and linear scale, so copy it now 210 211 207 212 SetDataFolder root: 208 213 … … 301 306 String/G $(curPath + ":fileList") = textw[0] 302 307 308 WAVE data=$"root:Packages:NIST:RAW:data" 309 Duplicate/O data $"root:Packages:NIST:RAW:linear_data" // data is "fresh" and linear scale, so copy it now 310 303 311 //return the data folder to root 304 312 SetDataFolder root: -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ILL_DataReadWrite.ipf
r769 r776 214 214 Setdatafolder curpath 215 215 216 Duplicate/O data $"root:Packages:NIST:RAW:linear_data" // data is "fresh" and linear scale, so copy it now 216 217 217 218 //keep a string with the filename in the RAW folder … … 316 317 317 318 String loadedStr = StringFromList(0,S_waveNames,";") //then name of the wave loaded 318 319 // if data loaded in is already named "data", don't bother with this step 320 if(exists("data") == 0) 321 duplicate/O $loadedStr,$(curPath+ ":data") 322 endif 323 // if data loaded in is already named "linear_data", don't bother with this step 324 if(exists("linear_data") == 0) 325 duplicate/O $loadedStr,$(curPath+ ":linear_data") 326 endif 327 319 320 // data loaded should be named "linear_data" (this is set in the DIV writer) 321 322 // so this will generate the log-scaled data wave 323 // ConvertFolderToLogScale("DIV") 324 Duplicate/O linear_data,data 325 data = log(linear_data) 326 328 327 //keep a string with the filename in the DIV folder 329 328 String/G $(curPath + ":fileList") = textw[0] … … 1792 1791 1793 1792 // should have the linear display..... 1794 ConvertFolderToLogScale(type) 1795 1796 Save/C root:packages:nist:STO:linear_data as "plex.DIV" 1797 1793 ConvertFolderToLogScale(type) 1794 1798 1795 // Your file writing function here. Don't try to duplicate the VAX binary format... 1799 1796 1797 SetDataFolder $("root:Packages:NIST:"+type) 1798 Save/C linear_data as "plex.DIV" 1799 1800 SetDataFolder root: 1800 1801 return(0) 1801 1802 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Marquee.ipf
r764 r776 438 438 End 439 439 440 Function SANS_Histogram_Pair() : GraphMarquee 441 GetMarquee left,bottom 442 if(V_flag == 0) 443 Abort "There is no Marquee" 444 endif 445 446 Cursor/W=SANS_Data/F/I A data 64,64 447 Cursor/M/S=2/H=1/L=0/C=(3,52428,1) A 448 449 // if cursor A on graph 450 // Do histogram pair 451 Variable aExists= strlen(CsrInfo(A)) > 0 // A is a name, not a string 452 if(aExists) 453 DoHistogramPair(hcsr(A),vcsr(A)) 454 else 455 DoHistogramPair(64,64) 456 endif 457 return(0) 458 459 // 460 End 440 461 // generates a histogram of the data as defined by the marquee. The longer dimension of the marquee 441 462 // becomes the x-axis of the histogram (this may need to be changed for some odd case). Pixel range specified … … 451 472 Abort "There is no Marquee" 452 473 endif 453 // if cursor A on graph454 // Do histogram pair455 Variable aExists= strlen(CsrInfo(A)) > 0 // A is a name, not a string456 if(aExists)457 DoHistogramPair(hcsr(A),vcsr(A))458 return(0)459 endif474 // // if cursor A on graph 475 // // Do histogram pair 476 // Variable aExists= strlen(CsrInfo(A)) > 0 // A is a name, not a string 477 // if(aExists) 478 // DoHistogramPair(hcsr(A),vcsr(A)) 479 // return(0) 480 // endif 460 481 // 461 482 Variable count,x1,x2,y1,y2,xwidth,ywidth,vsX=1,xx,yy … … 558 579 End 559 580 560 // if the "A" cursor is on the graph, do +-5 pixels in each direction561 // otherwise, you won't get here581 // 582 // 562 583 Function DoHistogramPair(xin,yin) 563 584 Variable xin,yin … … 571 592 pt2 = 128 572 593 573 Make/O/D/N=(pt2-pt1 ) PositionX,AvgCountsX574 Make/O/D/N=(pt2-pt1 ) PositionY,AvgCountsY594 Make/O/D/N=(pt2-pt1+1) PositionX,AvgCountsX 595 Make/O/D/N=(pt2-pt1+1) PositionY,AvgCountsY 575 596 AvgCountsX=0 576 597 AvgCountsY=0 … … 584 605 585 606 //do the vertical, then the horizontal 586 xwidth = 5 //+ - 587 ywidth = 5 607 ControlInfo/W=HistoPair setvar0 608 // Print "width = ",V_Value 609 xwidth = V_Value //+ - 610 ywidth = V_Value 588 611 x1 = xin - xwidth 589 612 x2 = xin + xwidth … … 592 615 593 616 KeepSelectionInBounds(x1,x2,y1,y2) 594 Print "x1,x2,y1,y2 (det) =",x1+1,x2+1,y1+1,y2+1617 // Print "x1,x2,y1,y2 (det) =",x1+1,x2+1,y1+1,y2+1 595 618 596 619 //Compute the histogram (manually) … … 609 632 610 633 KeepSelectionInBounds(x1,x2,y1,y2) 611 Print "x1,x2,y1,y2 (det) =",x1+1,x2+1,y2+1,y2+1634 // Print "x1,x2,y1,y2 (det) =",x1+1,x2+1,y2+1,y2+1 612 635 for(xx=x1;xx<=x2;xx+=1) //outer loop is the "x-axis" 613 636 for(yy=y1;yy<=y2;yy+=1) … … 630 653 Function Draw_HistoPair() 631 654 PauseUpdate; Silent 1 // building window... 632 Display /W=( 253,683,723,950)/K=1 AvgCountsX vs PositionX as "Histogram Pair"655 Display /W=(432.75,431.75,903,698.75)/K=1 AvgCountsX vs PositionX as "Histogram Pair" 633 656 AppendToGraph/L=leftY/B=bottomY AvgCountsY vs PositionY 634 657 DoWindow/C HistoPair 658 635 659 ModifyGraph rgb(AvgCountsX)=(21845,21845,21845) 636 660 ModifyGraph hbFill(AvgCountsX)=2 … … 655 679 TextBox/C/N=text0_2/X=84.0/Y=67.0 "LEFT" 656 680 TextBox/C/N=text0_3/X=84.0/Y=5.0 "BOTTOM" 681 682 ControlBar 40 683 // CheckBox check0,pos={300,11},size={72,14},proc=SH_FreeCursorCheck,title="Free Cursor" 684 // CheckBox check0,value= 0 685 Button button0 title="Update",size={70,20},pos={200,9},proc=SH_RecalcButton 686 SetVariable setvar0,pos={20,11},size={120,16},title="Width (pixels)" 687 SetVariable setvar0,limits={0,64,1},value= _NUM:5 688 657 689 EndMacro 658 690 … … 667 699 668 700 End 701 702 703 Function SH_FreeCursorCheck(cba) : CheckBoxControl 704 STRUCT WMCheckboxAction &cba 705 706 switch( cba.eventCode ) 707 case 2: // mouse up 708 Variable checked = cba.checked 709 710 //don't move the cursor 711 //Cursor/W=SANS_Data/F/M/S=2/H=1/L=0/C=(3,52428,1) A data 712 713 Cursor/W=SANS_Data/F/I A data 64,64 714 Cursor/M/S=2/H=1/L=0/C=(3,52428,1) A 715 716 break 717 endswitch 718 719 return 0 720 End 721 722 Function SH_RecalcButton(ba) : ButtonControl 723 STRUCT WMButtonAction &ba 724 725 switch( ba.eventCode ) 726 case 2: // mouse up 727 // click code here 728 // Print "at = ",hcsr(A,"SANS_Data"),vcsr(A,"SANS_Data") 729 DoHistogramPair(hcsr(A,"SANS_Data"),vcsr(A,"SANS_Data")) 730 break 731 endswitch 732 733 return 0 734 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf
r757 r776 367 367 SkipAndDecompressVAX(w,data) 368 368 Redimension/N=(128,128) data //NIST raw data is 128x128 - do not generalize 369 370 Duplicate/O data linear_data // at this point, the data is still the raw data, and is linear_data 371 // 369 372 370 373 //keep a string with the filename in the RAW folder … … 822 825 823 826 Redimension/n=(128,128) data 827 828 Duplicate/O data linear_data //data read in is on linear scale, copy it now 824 829 825 830 //clean up - get rid of w = $"tempGBWave0"
Note: See TracChangeset
for help on using the changeset viewer.