Changeset 1129 for sans/Dev/trunk/NCNR_User_Procedures/Reduction
- Timestamp:
- Feb 26, 2019 3:36:45 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/VC_DetectorBinning_Q.ipf
r1128 r1129 96 96 // do the q-binning for each of the panels to get I(Q) 97 97 // BinAllFrontPanels() 98 98 99 String popStr 99 String collimationStr = "pinhole"100 ControlInfo/W=VCALC popup_b101 popStr = S_Value //102 V_QBinAllPanels_Circular("VCALC",V_BinTypeStr2Num(popStr),collimationStr)100 // String collimationStr = "pinhole" 101 // ControlInfo/W=VCALC popup_b 102 // popStr = S_Value // 103 // V_QBinAllPanels_Circular("VCALC",V_BinTypeStr2Num(popStr),collimationStr) 103 104 104 105 // plot the results 105 String type = "VCALC"106 String str,winStr="VCALC#Panels_IQ",workTypeStr107 workTypeStr = "root:Packages:NIST:VSANS:"+type108 109 ControlInfo/W=VCALC popup_b110 popStr = S_Value //111 112 sprintf str,"(\"%s\",%d,\"%s\")",workTypeStr,V_BinTypeStr2Num(popStr),winStr113 114 Execute ("V_Front_IQ_Graph"+str)106 // String type = "VCALC" 107 // String str,winStr="VCALC#Panels_IQ",workTypeStr 108 // workTypeStr = "root:Packages:NIST:VSANS:"+type 109 // 110 // ControlInfo/W=VCALC popup_b 111 // popStr = S_Value // 112 // 113 // sprintf str,"(\"%s\",%d,\"%s\")",workTypeStr,V_BinTypeStr2Num(popStr),winStr 114 // 115 // Execute ("V_Front_IQ_Graph"+str) 115 116 116 117 // Execute "Front_IQ_Graph()" … … 642 643 // do the q-binning for each of the panels to get I(Q) 643 644 // BinAllMiddlePanels() 644 String popStr 645 String collimationStr = "pinhole" 646 ControlInfo/W=VCALC popup_b 647 popStr = S_Value // 648 V_QBinAllPanels_Circular("VCALC",V_BinTypeStr2Num(popStr),collimationStr) 645 646 // String popStr 647 // String collimationStr = "pinhole" 648 // ControlInfo/W=VCALC popup_b 649 // popStr = S_Value // 650 // V_QBinAllPanels_Circular("VCALC",V_BinTypeStr2Num(popStr),collimationStr) 649 651 650 652 // plot the results 651 String type = "VCALC"652 String str,winStr="VCALC#Panels_IQ",workTypeStr653 workTypeStr = "root:Packages:NIST:VSANS:"+type654 655 ControlInfo/W=VCALC popup_b656 popStr = S_Value //657 658 sprintf str,"(\"%s\",%d,\"%s\")",workTypeStr,V_BinTypeStr2Num(popStr),winStr659 660 Execute ("V_Middle_IQ_Graph"+str)653 // String type = "VCALC" 654 // String str,winStr="VCALC#Panels_IQ",workTypeStr 655 // workTypeStr = "root:Packages:NIST:VSANS:"+type 656 657 // ControlInfo/W=VCALC popup_b 658 // popStr = S_Value // 659 660 // sprintf str,"(\"%s\",%d,\"%s\")",workTypeStr,V_BinTypeStr2Num(popStr),winStr 661 // 662 // Execute ("V_Middle_IQ_Graph"+str) 661 663 662 664 … … 1222 1224 1223 1225 // do the q-binning for each of the panels to get I(Q) 1224 BinAllBackPanels() 1226 1227 // BinAllBackPanels() 1225 1228 1226 1229 // plot the results 1227 String type = "VCALC"1228 String str,winStr="VCALC#Panels_IQ",workTypeStr,popStr1229 workTypeStr = "root:Packages:NIST:VSANS:"+type1230 1231 ControlInfo/W=VCALC popup_b1232 popStr = S_Value //1233 1234 sprintf str,"(\"%s\",%d,\"%s\")",workTypeStr,V_BinTypeStr2Num(popStr),winStr1235 1236 Execute ("V_Back_IQ_Graph"+str)1230 // String type = "VCALC" 1231 // String str,winStr="VCALC#Panels_IQ",workTypeStr,popStr 1232 // workTypeStr = "root:Packages:NIST:VSANS:"+type 1233 1234 // ControlInfo/W=VCALC popup_b 1235 // popStr = S_Value // 1236 1237 // sprintf str,"(\"%s\",%d,\"%s\")",workTypeStr,V_BinTypeStr2Num(popStr),winStr 1238 // 1239 // Execute ("V_Back_IQ_Graph"+str) 1237 1240 1238 1241 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_UtilityProcedures.ipf
r1128 r1129 89 89 ControlInfo/W=VCALC VCALCCtrl_0d 90 90 91 return( V_Value)91 return(str2num(S_Value)) 92 92 end 93 93 … … 293 293 return(val) 294 294 End 295 296 295 297 /////////////////// 296 298 // … … 317 319 // 318 320 // 319 Function VC_FrontMiddlePreset() 320 321 Function VC_Preset_FrontMiddle_Ng0() 322 323 // set preference to ignore back detector 324 NVAR gIgnoreB = root:Packages:NIST:VSANS:Globals:gIgnoreDetB 325 gIgnoreB = 1 326 321 327 // front carriage 322 SetVariable VCALCCtrl_2a,value=_NUM:- 20 //Left offset323 SetVariable VCALCCtrl_2aa,value=_NUM: 20 //Right offset328 SetVariable VCALCCtrl_2a,value=_NUM:-10 //Left offset 329 SetVariable VCALCCtrl_2aa,value=_NUM:10 //Right offset 324 330 SetVariable VCALCCtrl_2b,value=_NUM:4 //Top offset 325 331 SetVariable VCALCCtrl_2bb,value=_NUM:-4 //Bottom offset 326 332 327 SetVariable VCALCCtrl_2d,value=_NUM: 120 //SDD333 SetVariable VCALCCtrl_2d,value=_NUM:400 //SDD 328 334 329 335 // middle carriage … … 346 352 347 353 // wavelength 348 SetVariable VCALCCtrl_0b,value=_NUM: 8,disable=0 ,noedit=0 // allow user editing again354 SetVariable VCALCCtrl_0b,value=_NUM:6 349 355 350 356 //number of guides 351 Slider VCALCCtrl_0a,value= 0 352 353 357 // Slider VCALCCtrl_0a,value= 0 358 V_GuideSliderProc("VCALCCtrl_0a",0,1) //Set Ng=0, resets the aperture string to the new string 359 Slider VCALCCtrl_0a,value=0 360 361 362 // source aperture (+new string) 363 PopupMenu VCALCCtrl_0f,mode=3 //set the 3.0 cm aperture 364 354 365 // binning mode 355 366 PopupMenu popup_b,mode=1,popValue="F2-M2xTB-B" … … 358 369 return(0) 359 370 End 371 372 373 Function VC_Preset_FrontMiddle_Ng2() 374 375 // front carriage 376 SetVariable VCALCCtrl_2a,value=_NUM:-10 //Left offset 377 SetVariable VCALCCtrl_2aa,value=_NUM:10 //Right offset 378 SetVariable VCALCCtrl_2b,value=_NUM:4 //Top offset 379 SetVariable VCALCCtrl_2bb,value=_NUM:-4 //Bottom offset 380 381 SetVariable VCALCCtrl_2d,value=_NUM:350 //SDD 382 383 // middle carriage 384 SetVariable VCALCCtrl_3a,value=_NUM:-10 //Left offset 385 SetVariable VCALCCtrl_3aa,value=_NUM:-10 //Right offset 386 SetVariable VCALCCtrl_3b,value=_NUM:4 //Top offset (doesn't matter) 387 SetVariable VCALCCtrl_3bb,value=_NUM:-4 //Bottom offset (doesn't matter) 388 389 SetVariable VCALCCtrl_3d,value=_NUM:1600 //SDD 390 391 392 // monochromator 393 PopupMenu VCALCCtrl_0c,mode=1,popvalue="Velocity Selector" 394 395 // wavelength spread 396 SVAR DLStr = root:Packages:NIST:VSANS:VCALC:gDeltaLambda 397 DLStr = "0.12;" 398 // PopupMenu VCALCCtrl_0d,mode=1,popvalue="0.12",value= root:Packages:NIST:VSANS:VCALC:gDeltaLambda 399 PopupMenu VCALCCtrl_0d,mode=1,popvalue="0.12" 400 401 // wavelength 402 SetVariable VCALCCtrl_0b,value=_NUM:6 403 404 //number of guides 405 // Slider VCALCCtrl_0a,value= 0 406 V_GuideSliderProc("VCALCCtrl_0a",2,1) //Set Ng=2, resets the aperture string to the new string 407 Slider VCALCCtrl_0a,value=2 408 409 // source aperture (+new string) 410 PopupMenu VCALCCtrl_0f,mode=1 //6.0 cm aperture 411 412 413 // binning mode 414 PopupMenu popup_b,mode=1,popValue="F2-M2xTB-B" 415 416 417 return(0) 418 End 419 420 Function VC_Preset_FrontMiddle_Ng7() 421 422 // front carriage 423 SetVariable VCALCCtrl_2a,value=_NUM:-10 //Left offset 424 SetVariable VCALCCtrl_2aa,value=_NUM:10 //Right offset 425 SetVariable VCALCCtrl_2b,value=_NUM:4 //Top offset 426 SetVariable VCALCCtrl_2bb,value=_NUM:-4 //Bottom offset 427 428 SetVariable VCALCCtrl_2d,value=_NUM:230 //SDD 429 430 // middle carriage 431 SetVariable VCALCCtrl_3a,value=_NUM:-10 //Left offset 432 SetVariable VCALCCtrl_3aa,value=_NUM:-10 //Right offset 433 SetVariable VCALCCtrl_3b,value=_NUM:4 //Top offset (doesn't matter) 434 SetVariable VCALCCtrl_3bb,value=_NUM:-4 //Bottom offset (doesn't matter) 435 436 SetVariable VCALCCtrl_3d,value=_NUM:1100 //SDD 437 438 439 // monochromator 440 PopupMenu VCALCCtrl_0c,mode=1,popvalue="Velocity Selector" 441 442 // wavelength spread 443 SVAR DLStr = root:Packages:NIST:VSANS:VCALC:gDeltaLambda 444 DLStr = "0.12;" 445 // PopupMenu VCALCCtrl_0d,mode=1,popvalue="0.12",value= root:Packages:NIST:VSANS:VCALC:gDeltaLambda 446 PopupMenu VCALCCtrl_0d,mode=1,popvalue="0.12" 447 448 // wavelength 449 SetVariable VCALCCtrl_0b,value=_NUM:6 450 451 //number of guides 452 // Slider VCALCCtrl_0a,value= 0 453 V_GuideSliderProc("VCALCCtrl_0a",7,1) //Set Ng=7, resets the aperture string to the new string 454 Slider VCALCCtrl_0a,value=7 455 456 // source aperture (+new string) 457 PopupMenu VCALCCtrl_0f,mode=1 //6.0 cm aperture 458 459 460 // binning mode 461 PopupMenu popup_b,mode=1,popValue="F2-M2xTB-B" 462 463 464 return(0) 465 End 466 467 Function VC_Preset_FrontMiddle_Ng9() 468 469 // front carriage 470 SetVariable VCALCCtrl_2a,value=_NUM:-10 //Left offset 471 SetVariable VCALCCtrl_2aa,value=_NUM:10 //Right offset 472 SetVariable VCALCCtrl_2b,value=_NUM:4 //Top offset 473 SetVariable VCALCCtrl_2bb,value=_NUM:-4 //Bottom offset 474 475 SetVariable VCALCCtrl_2d,value=_NUM:100 //SDD 476 477 // middle carriage 478 SetVariable VCALCCtrl_3a,value=_NUM:-10 //Left offset 479 SetVariable VCALCCtrl_3aa,value=_NUM:-10 //Right offset 480 SetVariable VCALCCtrl_3b,value=_NUM:4 //Top offset (doesn't matter) 481 SetVariable VCALCCtrl_3bb,value=_NUM:-4 //Bottom offset (doesn't matter) 482 483 SetVariable VCALCCtrl_3d,value=_NUM:450 //SDD 484 485 486 487 // monochromator 488 PopupMenu VCALCCtrl_0c,mode=1,popvalue="Velocity Selector" 489 490 // wavelength spread 491 SVAR DLStr = root:Packages:NIST:VSANS:VCALC:gDeltaLambda 492 DLStr = "0.12;" 493 // PopupMenu VCALCCtrl_0d,mode=1,popvalue="0.12",value= root:Packages:NIST:VSANS:VCALC:gDeltaLambda 494 PopupMenu VCALCCtrl_0d,mode=1,popvalue="0.12" 495 496 // wavelength 497 SetVariable VCALCCtrl_0b,value=_NUM:6 498 499 //number of guides 500 // Slider VCALCCtrl_0a,value= 0 501 V_GuideSliderProc("VCALCCtrl_0a",9,1) //Set Ng=9, resets the aperture string to the new string 502 Slider VCALCCtrl_0a,value=9 503 504 // source aperture (+new string) 505 PopupMenu VCALCCtrl_0f,mode=1 //6.0 cm aperture 506 507 508 // binning mode 509 PopupMenu popup_b,mode=1,popValue="F2-M2xTB-B" 510 511 512 return(0) 513 End 514 515 360 516 361 517 … … 364 520 // - disregard the back detector (set as front/middle) 365 521 // 366 Function VC_ WhiteBeamPreset()367 368 VC_ FrontMiddlePreset() // moves Middle into contact (but w/ wrong lambda)522 Function VC_Preset_WhiteBeam() 523 524 VC_Preset_FrontMiddle_Ng0() // moves Middle into contact (but w/ wrong lambda) 369 525 // monochromator 370 526 PopupMenu VCALCCtrl_0c,mode=1,popvalue="White Beam" … … 387 543 // - uses the back detector (set as front/middle) 388 544 // 389 Function VC_ GraphiteMonoPreset()545 Function VC_Preset_GraphiteMono() 390 546 391 547 // front carriage … … 594 750 595 751 // sample aperture diam [cm] 596 ControlInfo VCALCCtrl_1c 597 a2 = V_Value 752 a2 = VC_sampleApertureDiam() 598 753 599 754 // alpha = (a1+a2)/(2*l1) //angular divergence of beam -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_VCALCPanel_MockUp.ipf
r1128 r1129 70 70 71 71 PopupMenu popup_a,pos={50,40},size={142,20},title="Presets" 72 PopupMenu popup_a,mode=1,popvalue=" Low Q",value= root:Packages:NIST:VSANS:VCALC:gPresetPopStr72 PopupMenu popup_a,mode=1,popvalue="F+M Ng0 Low Q",value= root:Packages:NIST:VSANS:VCALC:gPresetPopStr 73 73 PopupMenu popup_a,proc=VC_PresetConfigPopup 74 74 … … 235 235 236 236 // 237 // justrecalculates the detector panels, doesn't adjust the views237 // recalculates the detector panels, doesn't adjust the views 238 238 // 239 239 Function Recalculate_AllDetectors() 240 240 241 // calculates Q for each panel 242 // and fills 2D panels with model data 241 243 fPlotBackPanels() 242 244 fPlotMiddlePanels() 243 245 fPlotFrontPanels() 244 246 247 String popStr 248 String collimationStr = "pinhole" 249 ControlInfo/W=VCALC popup_b 250 popStr = S_Value // 251 V_QBinAllPanels_Circular("VCALC",V_BinTypeStr2Num(popStr),collimationStr) 252 253 254 // plot the results (1D) 255 String type = "VCALC" 256 String str,winStr="VCALC#Panels_IQ",workTypeStr 257 workTypeStr = "root:Packages:NIST:VSANS:"+type 258 259 sprintf str,"(\"%s\",%d,\"%s\")",workTypeStr,V_BinTypeStr2Num(popStr),winStr 260 Execute ("V_Back_IQ_Graph"+str) 261 262 Execute ("V_Middle_IQ_Graph"+str) 263 264 Execute ("V_Front_IQ_Graph"+str) 265 266 267 268 269 245 270 V_beamIntensity() 246 271 … … 259 284 V_QMin_withBeamStop("MR") //TODO -- hard-wired here as the middle carriage and MR panel 260 285 261 262 //263 // Print "Still need to truncate the plotted data for Low Q that is behind the beam stop"264 286 // multiply the averaged data by the shadow factor to simulate a beamstop 265 287 V_IQ_BeamstopShadow() … … 508 530 End 509 531 510 532 // 533 // 534 // "F+M Ng0 Low Q;F+M Ng2 Mid Q;F+M Ng7 Mid Q;F+M Ng9 High Q;Converging Pinholes;Narrow Slit;White Beam;Graphite;Polarizer;" 535 // 511 536 Function VC_PresetConfigPopup(pa) : PopupMenuControl 512 537 STRUCT WMPopupAction &pa … … 520 545 521 546 strswitch(popStr) 522 case "Low Q": 547 case "F+M Ng0 Low Q": 548 VC_Preset_FrontMiddle_Ng0() 549 break 550 case "F+M Ng2 Mid Q": 551 VC_Preset_FrontMiddle_Ng2() 552 break 553 case "F+M Ng7 Mid Q": 554 VC_Preset_FrontMiddle_Ng7() 555 break 556 case "F+M Ng9 High Q": 557 VC_Preset_FrontMiddle_Ng9() 558 break 523 559 524 break525 case "High Q":526 527 break528 560 case "White Beam": 529 VC_WhiteBeamPreset() 530 binStr = "F4-M4-B" 561 VC_Preset_WhiteBeam() 531 562 break 532 563 case "Graphite": 533 VC_GraphiteMonoPreset() 534 binStr = "F4-M4-B" 564 VC_Preset_GraphiteMono() 535 565 break 536 566 case "Narrow Slit": 537 567 538 break539 case "Front+Middle Only":540 VC_FrontMiddlePreset()541 binStr = "F2-M2xTB-B"542 568 break 543 569 case "Converging Pinholes": … … 557 583 558 584 // a recalculation is needed after the change 585 // this re-bins the data too 559 586 Recalculate_AllDetectors() 560 587 561 588 // re-bin the data? 562 VC_RebinIQ_PopProc("",0,binStr)589 // VC_RebinIQ_PopProc("",0,binStr) 563 590 564 591 break … … 649 676 // // don't need to recalculate the views, but need to recalculate the detectors 650 677 651 Recalculate_AllDetectors()678 // Recalculate_AllDetectors() 652 679 653 680 break … … 675 702 // // don't need to recalculate the views, but need to recalculate the detectors 676 703 677 Recalculate_AllDetectors()704 // Recalculate_AllDetectors() 678 705 679 706 break … … 1216 1243 // to fill in: 1217 1244 // values for always-visible items 1218 String/G gPresetPopStr = " Low Q;High Q;Front+Middle Only;Converging Pinholes;Narrow Slit;White Beam;Graphite;Polarizer;"1245 String/G gPresetPopStr = "F+M Ng0 Low Q;F+M Ng2 Mid Q;F+M Ng7 Mid Q;F+M Ng9 High Q;Converging Pinholes;Narrow Slit;White Beam;Graphite;Polarizer;" 1219 1246 String/G gBinTypeStr = ksBinTypeStr 1220 1247 Variable/G gBeamIntensity= 0 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DataPlotting.ipf
r1108 r1129 896 896 if(V_flag==0) 897 897 AppendtoGraph/W=$winNameStr iBin_qxqy_B vs qBin_qxqy_B 898 898 899 ErrorBars/T=0/W=$winNameStr iBin_qxqy_B Y,wave=(:eBin_qxqy_B,:eBin_qxqy_B) 899 900 ModifyGraph/W=$winNameStr mode(iBin_qxqy_B)=4
Note: See TracChangeset
for help on using the changeset viewer.