- Timestamp:
- Jun 21, 2018 9:42:24 AM (5 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Q.ipf
r1098 r1108 620 620 SetDataFolder root: 621 621 622 // set any "shadowed" area of the T/B detectors to NaN to get a reali tic622 // set any "shadowed" area of the T/B detectors to NaN to get a realistic 623 623 // view of how much of the detectors are actually collecting data 624 624 // -- I can get the separation L/R from the panel - only this "open" width is visible. … … 1268 1268 qz_B = 0 1269 1269 1270 // TODO - these are to be set from globals, not hard-wired. N and pixelSize will be known (or pre-measured)1270 // (DONE) - these are set from globals, not hard-wired. N and pixelSize will be known (or pre-measured) 1271 1271 // pixel sizes are in cm 1272 // beam center for the back detector is in PIXELS. always. 1272 1273 pixSizeX = VCALC_getPixSizeX("B") 1273 1274 pixSizeY = VCALC_getPixSizeY("B") 1274 1275 1275 if(kBCTR_CM) 1276 xCtr = trunc( DimSize(det_B,0)/2 ) *pixSizeX * 10 1277 yCtr = trunc( DimSize(det_B,1)/2 ) *pixSizeY * 10 //values in mm -- beam is nominally at 0,0 in space 1278 else 1279 xCtr = trunc( DimSize(det_B,0)/2 ) // 1280 yCtr = trunc( DimSize(det_B,1)/2 ) // 1281 endif 1282 1283 //put these beam center values into the local folder 1284 V_putDet_beam_center_x("VCALC","B",xCtr) 1285 V_putDet_beam_center_y("VCALC","B",yCtr) 1276 xCtr = V_getDet_beam_center_x("VCALC","B") 1277 yCtr = V_getDet_beam_center_y("VCALC","B") 1278 1279 // if(kBCTR_CM) 1280 // xCtr = trunc( DimSize(det_B,0)/2 ) *pixSizeX * 10 1281 // yCtr = trunc( DimSize(det_B,1)/2 ) *pixSizeY * 10 //values in mm -- beam is nominally at 0,0 in space 1282 // else 1283 // xCtr = trunc( DimSize(det_B,0)/2 ) // 1284 // yCtr = trunc( DimSize(det_B,1)/2 ) // 1285 // endif 1286 // 1287 // //put these beam center values into the local folder 1288 // V_putDet_beam_center_x("VCALC","B",xCtr) 1289 // V_putDet_beam_center_y("VCALC","B",yCtr) 1286 1290 1287 1291 // VC_Detector_2Q(det_B,qTot_B,qx_B,qy_B,qz_B,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf
r1105 r1108 265 265 // and for the back detector "B" 266 266 Make/O/D/N=3 tmpCalibX,tmpCalibY 267 tmpCalibX[0] = VCALC_getPixSizeX(detStr) *10 // pixel size in mmVCALC_getPixSizeX(detStr) is [cm]267 tmpCalibX[0] = VCALC_getPixSizeX(detStr) // pixel size in [cm] VCALC_getPixSizeX(detStr) is [cm] 268 268 tmpCalibX[1] = 1 269 269 tmpcalibX[2] = 10000 270 tmpCalibY[0] = VCALC_getPixSizeY(detStr) *10 // pixel size in mmVCALC_getPixSizeX(detStr) is [cm]270 tmpCalibY[0] = VCALC_getPixSizeY(detStr) // pixel size in [cm] VCALC_getPixSizeX(detStr) is [cm] 271 271 tmpCalibY[1] = 1 272 272 tmpcalibY[2] = 10000 … … 277 277 if(cmpstr(detStr,"B") == 0) 278 278 V_NonLinearCorrection_B("VCALC",data,tmpCalibX,tmpCalibY,detStr,destPath) 279 // beam center is in pixels, so use the old routine 280 V_ConvertBeamCtr_to_mmB("VCALC","B",destPath) 279 281 else 280 282 V_NonLinearCorrection("VCALC",data,tmpCalib,tube_width,detStr,destPath) … … 285 287 NVAR gUseNonLinearDet = root:Packages:NIST:VSANS:VCALC:gUseNonLinearDet 286 288 287 if(kBCTR_CM )289 if(kBCTR_CM && cmpstr(detStr,"B") != 0) 288 290 if(gUseNonLinearDet && WaveExists(data_realDistX) && WaveExists(data_realDistY)) 289 291 // beam ctr is in cm already -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_UtilityProcedures.ipf
r1081 r1108 395 395 396 396 397 /////////// procedure to concatenate I(q) files into a single file 398 // 399 // currently, no rescaling is done, no trimming is done, just crude concatentate and sort 400 // 397 398 ////////////////////////////////// 399 // 400 // Actions for the VCALC controls 401 // 402 ////////////////////////////////// 403 404 // read the number of guides from the slider 405 // return the Source to Sample Distance in [cm] 406 Function VC_calcSSD() 407 408 Variable ng,ssd 409 ControlInfo VCALCCtrl_0a 410 ng = V_Value 411 412 ssd = 2388 - ng*200 413 print "SSD (cm) = ",ssd 414 return(ssd) 415 End 416 417 418 // read the number of guides from the slider 419 // return the Source aperture diameter [cm] 420 // TODO - needs a case statement since a1 can depend on Ng 421 Function VC_sourceApertureDiam() 422 423 Variable ng,a1 424 ControlInfo VCALCCtrl_0a 425 ng = V_Value 426 427 a1 = 6 // 60 mm diameter 428 429 Print "Source Ap diam (cm) = ",a1 430 return(a1) 431 End 432 433 434 435 /////////////////// 436 // 437 // Presets 438 // 439 /////////////////// 440 441 442 // for Front+Middle Only 443 // x F SDD=120 444 // x (L=-20, R=20) (T=4, B=-4) 445 // 446 // x M SDD = 1900 447 // x (L=0, R=0) 448 // 449 // x Velocity selector 450 // x Ng = 0 451 // x Lam = 8 452 // x delLam = 0.12 453 // source ap = ? (circular) 454 // 455 // ignore back detector 456 // x set plot type to F2-M2xTB-B 457 // 458 // 459 Function VC_FrontMiddlePreset() 460 461 // front carriage 462 SetVariable VCALCCtrl_2a,value=_NUM:-20 //Left offset 463 SetVariable VCALCCtrl_2aa,value=_NUM:20 //Right offset 464 SetVariable VCALCCtrl_2b,value=_NUM:4 //Top offset 465 SetVariable VCALCCtrl_2bb,value=_NUM:-4 //Bottom offset 466 467 SetVariable VCALCCtrl_2d,value=_NUM:120 //SDD 468 469 // middle carriage 470 SetVariable VCALCCtrl_3a,value=_NUM:0 //Left offset 471 SetVariable VCALCCtrl_3aa,value=_NUM:0 //Right offset 472 SetVariable VCALCCtrl_3b,value=_NUM:4 //Top offset (doesn't matter) 473 SetVariable VCALCCtrl_3bb,value=_NUM:-4 //Bottom offset (doesn't matter) 474 475 SetVariable VCALCCtrl_3d,value=_NUM:1900 //SDD 476 477 478 // monochromator 479 PopupMenu VCALCCtrl_0c,mode=1,popvalue="Velocity Selector" 480 481 // wavelength spread 482 SVAR DLStr = root:Packages:NIST:VSANS:VCALC:gDeltaLambda 483 DLStr = "0.12;" 484 PopupMenu VCALCCtrl_0d,mode=1,popvalue="0.12",value= root:Packages:NIST:VSANS:VCALC:gDeltaLambda 485 486 // wavelength 487 SetVariable VCALCCtrl_0b,value=_NUM:8,disable=0 ,noedit=0 // allow user editing again 488 489 //number of guides 490 Slider VCALCCtrl_0a,value= 0 491 492 493 // binning mode 494 PopupMenu popup_b,mode=1,popValue="F2-M2xTB-B" 495 496 497 return(0) 498 End 499 500 // 501 //direction = one of "vertical;horizontal;maximum;" 502 // all of this is bypassed if the lenses are in 503 // 504 // carrNum = 1,2,3 for F,M,B 505 // 506 // returns a value in [cm] 507 Function VC_beamDiameter(direction,carrNum) 508 String direction 509 Variable carrNum 510 511 // NVAR lens = root:Packages:NIST:SAS:gUsingLenses 512 // if(lens) 513 // return sourceApertureDiam() 514 // endif 515 516 Variable l1,l2,l2Diff 517 Variable d1,d2,bh,bv,bm,umbra,a1,a2 518 Variable lambda,lambda_width,bs_factor 519 520 // NVAR L2diff = root:Packages:NIST:SAS:L2diff 521 522 // TODO: proper value for l2Diff, bs_factor 523 l2Diff = 0 524 bs_factor = 1.05 525 526 l1 = VC_calcSSD() 527 lambda = VCALC_getWavelength() 528 ControlInfo VCALCCtrl_0d 529 lambda_width = str2num(S_Value) 530 531 532 l2 = VC_getSDD(carrNum) + L2diff 533 534 // TODO verify that these values are in cm 535 a1 = VC_sourceApertureDiam() 536 537 // sample aperture diam [cm] 538 ControlInfo VCALCCtrl_1c 539 a2 = V_Value 540 541 d1 = a1*l2/l1 542 d2 = a2*(l1+l2)/l1 543 bh = d1+d2 //beam size in horizontal direction 544 umbra = abs(d1-d2) 545 //vertical spreading due to gravity 546 bv = bh + 1.25e-8*(l1+l2)*l2*lambda*lambda*lambda_width 547 bm = (bs_factor*bh > bv) ? bs_factor*bh : bv //use the larger of horiz*safety or vertical 548 549 strswitch(direction) // string switch 550 case "vertical": // execute if case matches expression 551 return(bv) 552 break // exit from switch 553 case "horizontal": // execute if case matches expression 554 return(bh) 555 break 556 case "maximum": // execute if case matches expression 557 return(bm) 558 break 559 default: // optional default expression executed 560 return(bm) // when no case matches 561 endswitch 562 563 return(0) 564 565 End 566 567 // 1=front 568 // 2=middle 569 // 3=back 570 // return value is in cm 571 Function VC_getSDD(carrNum) 572 Variable carrNum 573 574 if(carrNum == 1) 575 ControlInfo VCALCCtrl_2d 576 endif 577 if(carrNum == 2) 578 ControlInfo VCALCCtrl_3d 579 endif 580 if(carrNum == 3) 581 ControlInfo VCALCCtrl_4b 582 endif 583 584 return(V_Value) 585 end 586 587 588 // these are numbers from NG3, when it was a SANS instrument 589 // 590 // updated with new flux numbers from John Barker 591 // NG3 - Feb 2009 592 // NG7 - July 2009 593 // 594 // guide loss has been changed to 0.95 rather than the old value of 0.95 595 // 596 // other values are changed in the initialization routines 597 // 598 Function beamIntensity() 599 600 Variable alpha,f,t,t4,t5,t6,as,solid_angle,l1,d2_phi 601 Variable a1,a2,retVal 602 Variable l_gap,guide_width,ng 603 Variable lambda_t,b,c 604 Variable lambda,t1,t2,t3,phi_0 605 Variable lambda_width 606 Variable guide_loss 607 608 NVAR gBeamInten = root:Packages:NIST:VSANS:VCALC:gBeamIntensity 609 610 401 611 // TODO 402 // -- all of this needs to be done. There's nothing here... 403 // 404 405 406 407 612 // these are numbers from NG3, when it was a SANS instrument 613 614 lambda_t = 5.50 615 616 t1 = 0.63 617 t2 = 1.0 618 t3 = 0.75 619 l_gap = 100.0 620 guide_width = 6.0 621 622 //new values, from 11/2009 --- BeamFluxReport_2009.ifn 623 phi_0 = 2.42e13 624 b = 0.0 625 c = -0.0243 626 guide_loss = 0.924 627 628 629 630 ControlInfo VCALCCtrl_0a 631 ng = V_Value 632 633 lambda = VCALC_getWavelength() 634 ControlInfo VCALCCtrl_0d 635 lambda_width = str2num(S_Value) 636 637 638 l1 = VC_calcSSD() 639 640 // TODO verify that these values are in cm 641 a1 = VC_sourceApertureDiam() 642 643 // sample aperture diam [cm] 644 ControlInfo VCALCCtrl_1c 645 a2 = V_Value 646 647 648 alpha = (a1+a2)/(2*l1) //angular divergence of beam 649 f = l_gap*alpha/(2*guide_width) 650 t4 = (1-f)*(1-f) 651 t5 = exp(ng*ln(guide_loss)) // trans losses of guides in pre-sample flight 652 t6 = 1 - lambda*(b-(ng/8)*(b-c)) //experimental correction factor 653 t = t1*t2*t3*t4*t5*t6 654 655 as = pi/4*a2*a2 //area of sample in the beam 656 d2_phi = phi_0/(2*pi) 657 d2_phi *= exp(4*ln(lambda_t/lambda)) 658 d2_phi *= exp(-1*(lambda_t*lambda_t/lambda/lambda)) 659 660 solid_angle = pi/4* (a1/l1)*(a1/l1) 661 662 retVal = as * d2_phi * lambda_width * solid_angle * t 663 664 // set the global for display 665 gBeamInten = retVal 666 return (retVal) 667 end 668 669 // 670 Function VC_figureOfMerit() 671 672 Variable bi = beamIntensity() 673 Variable lambda = VCALC_getWavelength() 674 675 return (lambda*lambda*bi) 676 End 677 678 // return a beamstop diameter (cm) larger than maximum beam dimension 679 Function VC_beamstopDiam(carrNum) 680 Variable carrNum 681 682 Variable bm=0 683 Variable bs=0.0 684 Variable yesLens=0 685 686 if(yesLens) 687 //bm = sourceApertureDiam() //ideal result, not needed 688 bs = 1 //force the diameter to 1" 689 else 690 bm = VC_beamDiameter("maximum",carrNum) 691 do 692 bs += 1 693 while ( (bs*2.54 < bm) || (bs > 30.0)) //30 = ridiculous limit to avoid inf loop 694 endif 695 696 return (bs*2.54) //return diameter in cm, not inches for txt 697 End 698 699 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_VCALCPanel_MockUp.ipf
r1100 r1108 71 71 PopupMenu popup_a,pos={50,40},size={142,20},title="Presets" 72 72 PopupMenu popup_a,mode=1,popvalue="Low Q",value= root:Packages:NIST:VSANS:VCALC:gPresetPopStr 73 74 PopupMenu popup_b,pos={690,310},size={142,20},title="Binning type",proc=VC_RebinIQ_PopProc 73 PopupMenu popup_a,proc=VC_PresetConfigPopup 74 75 PopupMenu popup_b,pos={670,311},size={142,20},title="Binning type",proc=VC_RebinIQ_PopProc 75 76 PopupMenu popup_b,mode=1,value= root:Packages:NIST:VSANS:VCALC:gBinTypeStr 76 77 SetVariable setVar_b,pos={476,313},size={120,15},title="axis Q",proc=Front2DQ_Range_SetVarProc 78 SetVariable setVar_b,limits={0.02,1,0.02},value=_NUM:0.3 79 CheckBox check_0a title="Log?",size={60,20},pos={619,313},proc=Front2DQ_Log_CheckProc 80 77 81 SetVariable setVar_a,pos={476,26},size={120,15},title="axis degrees",proc=FrontView_Range_SetVarProc 78 82 SetVariable setVar_a,limits={0.3,30,0.2},value=_NUM:20 83 84 ValDisplay valDisp_a,pos={50,100},size={150,15},title="Beam Intensity",value=root:Packages:NIST:VSANS:VCALC:gBeamIntensity 85 86 79 87 80 88 // for panels (in degrees) … … 97 105 ModifyGraph rgb=(0,0,0) 98 106 ModifyGraph tick=2,mirror=1 99 Label left "Vertical position ( mm)"100 Label bottom "SDD ( m)"107 Label left "Vertical position (cm)" 108 Label bottom "SDD (cm)" 101 109 SetActiveSubwindow ## 102 110 … … 108 116 ModifyGraph rgb=(0,0,0) 109 117 ModifyGraph tick=2,mirror=1 110 Label left "Horizontal position ( mm)"111 Label bottom "SDD ( m)"118 Label left "Horizontal position (cm)" 119 Label bottom "SDD (cm)" 112 120 SetActiveSubwindow ## 113 121 … … 124 132 SetActiveSubwindow ## 125 133 126 SetVariable setVar_b,pos={476,314},size={120,15},title="axis Q",proc=Front2DQ_Range_SetVarProc 127 SetVariable setVar_b,limits={0.02,1,0.02},value=_NUM:0.3 128 CheckBox check_0a title="Log?",size={60,20},pos={619,313},proc=Front2DQ_Log_CheckProc 134 129 135 130 136 // for averaged I(Q) … … 148 154 PopupMenu VCALCCtrl_0c,pos={26,257},size={150,20},title="monochromator" 149 155 PopupMenu VCALCCtrl_0c,mode=1,popvalue="Velocity Selector",value= root:Packages:NIST:VSANS:VCALC:gMonochromatorType 156 PopupMenu VCALCCtrl_0c,proc=VC_MonochromSelectPopup 150 157 PopupMenu VCALCCtrl_0d,pos={26,321},size={115,20},title="delta lambda" 151 158 PopupMenu VCALCCtrl_0d,mode=1,popvalue="0.10",value= root:Packages:NIST:VSANS:VCALC:gDeltaLambda 159 PopupMenu VCALCCtrl_0d,proc=VC_DeltaLamSelectPopup 152 160 PopupMenu VCALCCtrl_0e,pos={291,262},size={132,20},title="source shape" 153 161 PopupMenu VCALCCtrl_0e,mode=1,popvalue="circular",value= root:Packages:NIST:VSANS:VCALC:gSourceShape 162 PopupMenu VCALCCtrl_0e,proc=VC_SourceApShapeSelectPopup 154 163 PopupMenu VCALCCtrl_0f,pos={283,293},size={141,20},title="source aperture" 155 164 PopupMenu VCALCCtrl_0f,mode=1,popvalue="1.0 cm",value= root:Packages:NIST:VSANS:VCALC:gSourceDiam 156 165 PopupMenu VCALCCtrl_0f,proc=VC_SourceAperDiamSelectPopup 166 157 167 158 168 // tab(1) - Sample conditions, initially not visible … … 220 230 fPlotFrontPanels() 221 231 232 Print "Beam Intensity = ",beamIntensity() 233 222 234 return(0) 223 235 End … … 303 315 End 304 316 317 318 319 320 321 322 323 324 Function VC_SourceAperDiamSelectPopup(pa) : PopupMenuControl 325 STRUCT WMPopupAction &pa 326 327 switch( pa.eventCode ) 328 case 2: // mouse up 329 Variable popNum = pa.popNum 330 String popStr = pa.popStr 331 332 Print "Not filled in yet" 333 334 // a recalculation is needed after the change 335 //Recalculate_AllDetectors() 336 337 break 338 case -1: // control being killed 339 break 340 endswitch 341 342 return 0 343 End 344 345 Function VC_SourceApShapeSelectPopup(pa) : PopupMenuControl 346 STRUCT WMPopupAction &pa 347 348 switch( pa.eventCode ) 349 case 2: // mouse up 350 Variable popNum = pa.popNum 351 String popStr = pa.popStr 352 353 Print "Not filled in yet" 354 355 // a recalculation is needed after the change 356 //Recalculate_AllDetectors() 357 358 break 359 case -1: // control being killed 360 break 361 endswitch 362 363 return 0 364 End 365 366 Function VC_DeltaLamSelectPopup(pa) : PopupMenuControl 367 STRUCT WMPopupAction &pa 368 369 switch( pa.eventCode ) 370 case 2: // mouse up 371 Variable popNum = pa.popNum 372 String popStr = pa.popStr 373 374 // a recalculation is needed after the change 375 Recalculate_AllDetectors() 376 377 break 378 case -1: // control being killed 379 break 380 endswitch 381 382 return 0 383 End 384 385 // change the choices for deltaLam based on the 386 // type of monochromator selected 387 // 388 // some cases force a change of the wavelength 389 // 390 // then recalculate 391 Function VC_MonochromSelectPopup(pa) : PopupMenuControl 392 STRUCT WMPopupAction &pa 393 394 switch( pa.eventCode ) 395 case 2: // mouse up 396 Variable popNum = pa.popNum 397 String popStr = pa.popStr 398 399 SVAR DLStr = root:Packages:NIST:VSANS:VCALC:gDeltaLambda 400 401 strswitch(popStr) 402 case "Velocity Selector": 403 DLStr = "0.12;" 404 PopupMenu VCALCCtrl_0d,mode=1,popvalue="0.12",value= root:Packages:NIST:VSANS:VCALC:gDeltaLambda 405 406 SetVariable VCALCCtrl_0b,disable=0,noedit=0 // allow user editing again 407 408 break 409 case "Graphite": 410 DLStr = "0.01;" 411 PopupMenu VCALCCtrl_0d,mode=1,popvalue="0.01",value= root:Packages:NIST:VSANS:VCALC:gDeltaLambda 412 413 SetVariable VCALCCtrl_0b,value=_NUM:4.75,disable=2 // wavelength 414 break 415 case "White Beam": 416 DLStr = "0.40;" 417 PopupMenu VCALCCtrl_0d,mode=1,popvalue="0.40",value= root:Packages:NIST:VSANS:VCALC:gDeltaLambda 418 419 SetVariable VCALCCtrl_0b,value=_NUM:5.3,disable=2 //wavelength 420 break 421 default: 422 Print "Error--No match in VC_MonochromSelectPopup" 423 return(0) 424 endswitch 425 426 427 // a recalculation is needed after the change 428 Recalculate_AllDetectors() 429 430 break 431 case -1: // control being killed 432 break 433 endswitch 434 435 return 0 436 End 437 438 439 Function VC_PresetConfigPopup(pa) : PopupMenuControl 440 STRUCT WMPopupAction &pa 441 442 switch( pa.eventCode ) 443 case 2: // mouse up 444 Variable popNum = pa.popNum 445 String popStr = pa.popStr 446 447 448 strswitch(popStr) 449 case "Low Q": 450 451 break 452 case "High Q": 453 454 break 455 case "White Beam": 456 457 break 458 case "Narrow Slit": 459 460 break 461 case "Front+Middle Only": 462 VC_FrontMiddlePreset() 463 464 break 465 case "Converging Pinholes": 466 467 break 468 case "Polarizer": 469 470 break 471 472 default: 473 Print "Error--No match in VC_PresetConfigPopup" 474 return(0) 475 endswitch 476 477 // update the views 478 VC_UpdateViews() 479 480 // a recalculation is needed after the change 481 Recalculate_AllDetectors() 482 483 484 break 485 case -1: // control being killed 486 break 487 endswitch 488 489 return 0 490 End 491 492 493 494 495 305 496 // 306 497 // recalculate the detectors with a preset model function … … 652 843 End 653 844 654 655 656 657 // this all needs to be fixed and updated - it is all pertinent to SANS (SASCALC) 658 // and not yet specific to VSANS 845 // call to update the views (not the q-calculation, that is a separate call) 846 Function VC_UpdateViews() 847 848 UpdateSideView() 849 UpdateTopView() 850 FrontView_1x() 851 852 return(0) 853 End 854 855 // this all needs to be fixed and updated - not yet specific to VSANS 659 856 // 660 857 // -- all of the simulation stuff will need to be re-thought … … 806 1003 Variable/G gBack_h = 50.4 807 1004 808 Make/O/D/N=1 :entry:instrument:detector_B:x_pixel_size = 0.034 // 340 micron resolution (units of cmhere)1005 Make/O/D/N=1 :entry:instrument:detector_B:x_pixel_size = 0.034 // 340 micron resolution (units of [cm] here) 809 1006 Make/O/D/N=1 :entry:instrument:detector_B:y_pixel_size = 0.034 810 1007 … … 815 1012 816 1013 // pixel beam center - HDF style 817 Make/O/D/N=1 :entry:instrument:detector_B:beam_center_x = 340.1 // == x beam center, in pixels 1014 Make/O/D/N=1 :entry:instrument:detector_B:beam_center_x = 340.1 // == x beam center, in pixels +0.1 so I know it's from here 818 1015 Make/O/D/N=1 :entry:instrument:detector_B:beam_center_y = 828.1 // == y beam center, in pixels 819 1016 … … 881 1078 // to fill in: 882 1079 // values for always-visible items 883 String/G gPresetPopStr = "Low Q;High Q; Converging Pinholes;Narrow Slit Aperture;White Beam;Polarizer;"1080 String/G gPresetPopStr = "Low Q;High Q;Front+Middle Only;Converging Pinholes;Narrow Slit;White Beam;Polarizer;" 884 1081 String/G gBinTypeStr = ksBinTypeStr 885 1082 Variable/G gBeamIntensity= 0 886 1083 887 1084 … … 893 1090 String/G gSourceDiam = "1.0 cm;2.0 cm;5.0 cm;" 894 1091 String/G gSourceDiam_0g = "0.75 cm;1.5 cm;3.0 cm;" // values from John Mar 2018 895 String/G gDeltaLambda = "0. 10;0.20;0.30;"1092 String/G gDeltaLambda = "0.01;0.10;0.20;0.30;0.40;" 896 1093 897 1094 // tab 1 - sample conditions -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DataPlotting.ipf
r1097 r1108 38 38 // and to the function Draw_Plot1D() for the drawing of the plot 39 39 // 40 // If -9999 is passed in as the "binType", then read the proper value from the popup on the graph.41 // otherwise, assume that a proper value has been passed in, say from the reduction protocol42 40 // 43 41 Function V_PlotData_Panel() -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Menu.ipf
r1095 r1108 19 19 "VSANS Preferences",Show_VSANSPreferences_Panel() 20 20 "-" 21 Submenu "In Progress Panels" 22 "Beam Center Panel",V_FindBeamCenter() 21 Submenu "Data Panels" 23 22 "Patch Beam Center XY",V_PatchDet_xyCenters_Panel() 24 23 "Patch Detector Deadtime",V_PatchDetectorDeadtimePanel() … … 27 26 "Annular Binning",Annular_Binning() 28 27 "Write Annular Data",V_Write1DAnnular() 28 "Trim I(q) points",V_CombineDataGraph() 29 29 "-" 30 30 "Derive Beam Centers",V_DeriveBeamCenters() 31 "-" 32 "Back Detector Saturation",Vm_NumberSaturated() 31 33 End 32 33 34 SubMenu "Nexus File Corrections" 35 "Patch GroupID using CatTable",V_Patch_GroupID_catTable() 36 "Patch Purpose using CatTable",V_Patch_Purpose_catTable() 37 "Patch Intent using CatTable",V_Patch_Intent_catTable() 38 "-" 34 39 "Flip Lateral Offset",V_PatchDet_Offset() 35 40 "Mark Lateral Flip Done",V_MarkLeftRightFlip_Done() 36 41 "Mark Lateral Flip NOT Done",V_MarkLeftRightFlip_Not_Done() 37 "-"38 "Patch GroupID using CatTable",V_Patch_GroupID_catTable()39 "Patch Purpose using CatTable",V_Patch_Purpose_catTable()40 "Patch Intent using CatTable",V_Patch_Intent_catTable()41 42 "Patch Detector Panel Gap",V_PatchDet_Gap() 42 43 "Read Detetcor Panel Gap",V_ReadDet_Gap() … … 48 49 "Copy_VCALC_to_VSANSFile",Copy_VCALC_to_VSANSFile() 49 50 "-" 50 "Setup_VSANS_DIV_Struct"51 "Save_VSANS_DIV_Nexus"52 "Setup_VSANS_MASK_Struct"53 "Save_VSANS_MASK_Nexus"54 "-"55 51 "Read_Nexus with attributes",Read_Nexus_Xref() //this will read with attributes 56 52 "Write_Nexus with attributes",Write_Nexus_Xref() //this will write out with attributes if read in by Read_Nexus_Xref 57 53 "-" 58 "Dump_V_getFP" 59 "Dump_V_getFP_Det" 60 "Dump_V_getSTR" 61 "Dump_V_getSTR_Det" 54 "Beam Center Panel",V_FindBeamCenter() 55 "Save I(Q) as ITX",Vm_Write1DData_ITX() 56 // 57 // "Setup_VSANS_DIV_Struct" 58 // "Save_VSANS_DIV_Nexus" 59 // "Setup_VSANS_MASK_Struct" 60 // "Save_VSANS_MASK_Nexus" 61 // "-" 62 // "Dump_V_getFP" 63 // "Dump_V_getFP_Det" 64 // "Dump_V_getSTR" 65 // "Dump_V_getSTR_Det" 62 66 // "Fill_Nexus_V_Template" 63 67 // "Save_Nexus_V_Template" … … 69 73 // "IgorOnly_Save_SANS_Struct" 70 74 End 71 Submenu "Work File Operations"72 "Convert to WORK",V_Convert_to_Workfile()73 "Load Fake DIV Data"74 "DIV a work file",V_DIV_a_Workfile()75 "Load Fake MASK Data"76 "Correct Data",V_CorrectData()77 End75 // Submenu "Work File Operations" 76 // "Convert to WORK",V_Convert_to_Workfile() 77 // "Load Fake DIV Data" 78 // "DIV a work file",V_DIV_a_Workfile() 79 // "Load Fake MASK Data" 80 // "Correct Data",V_CorrectData() 81 // End 78 82 End 79 83 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_RAW_Data_Panel.ipf
r1103 r1108 177 177 Button button_toWork,pos={770,146},size={90,20},proc=V_ToWorkFileButtonProc,title="to WORK" 178 178 Button button_annular,pos={770,114},size={90,20},proc=V_annularAvgButtonProc,title="Annular Avg" 179 Button button_SpreadPanels,pos={880,114},size={100,20},proc=V_SpreadPanelButtonProc,title="Spread Panels" 180 Button button_RestorePanels,pos={880,146},size={100,20},proc=V_RestorePanelButtonProc,title="Restore Panels" 181 179 182 180 183 TitleBox title_file,pos={606,178},fsize=12,size={76,20},variable= root:Packages:NIST:VSANS:Globals:gLastLoadedFile … … 184 187 // Button button_tagFile,pos={720,412},size={70,20},proc=V_TagFileButtonProc,title="Tag File" 185 188 // Button button_tagFile,disable=2 186 Button button_saveIQ,pos={603,412},size={120,20},proc=V_SaveIQ_ButtonProc,title="Save I(Q) as ITX" 187 Button button_BeamCtr,pos={603,566},size={110,20},proc=V_BeamCtrButtonProc,title="Beam Center",disable=2 188 Button button_SpreadPanels,pos={603,488},size={100,20},proc=V_SpreadPanelButtonProc,title="Spread Panels" 189 Button button_RestorePanels,pos={603,526},size={100,20},proc=V_RestorePanelButtonProc,title="Restore Panels" 190 191 Button pick_trim,pos={603,450},size={120,20},proc=V_TrimDataProtoButton,title="Trim I(Q) Data" 192 Button pick_trim,help={"This button will prompt the user for trimming parameters"} 189 // Button button_saveIQ,pos={603,412},size={120,20},proc=V_SaveIQ_ButtonProc,title="Save I(Q) as ITX" 190 // Button button_BeamCtr,pos={603,566},size={110,20},proc=V_BeamCtrButtonProc,title="Beam Center",disable=2 191 // Button pick_trim,pos={603,450},size={120,20},proc=V_TrimDataProtoButton,title="Trim I(Q) Data" 192 // Button pick_trim,help={"This button will prompt the user for trimming parameters"} 193 193 194 194 … … 1081 1081 // and the data being saved is not "stale" 1082 1082 1083 V_PlotData_Panel() // -9999 requests a read from the popup on the panel1083 V_PlotData_Panel() // 1084 1084 Variable binType = V_GetBinningPopMode() 1085 V_BinningModePopup("",binType,"") // does default circular binning and updates the graph 1085 ControlInfo/W=V_1D_Data popup0 1086 V_BinningModePopup("",binType,S_Value) // does default circular binning and updates the graph 1086 1087 1087 1088 SVAR type = root:Packages:NIST:VSANS:Globals:gCurDispType //what folder -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf
r1107 r1108 1523 1523 1524 1524 1525 // 1526 ////// utilities for the back detector to diagnose saturation issues 1527 // 1528 1529 Proc Vm_NumberSaturated(folderStr) 1530 String folderStr="RAW" 1531 V_NumberSaturated(folderStr) 1532 End 1533 1534 Function V_NumberSaturated(folderStr) 1535 String folderStr 1536 1537 Variable num,saturationValue 1538 Duplicate/O $("root:Packages:NIST:VSANS:"+folderStr+":entry:instrument:detector_B:data") tmpData 1539 1540 saturationValue = 16383 1541 1542 tmpData = (tmpData == saturationValue) ? NaN : tmpData 1543 WaveStats/Q tmpData 1544 num = V_numNaNs 1545 1546 Printf "Number of saturated pixels = %d (%g %)\r",num,num/(680*1656)*100 1547 KillWaves/Z tmpData 1548 1549 V_ColorizeSaturated() 1550 return(num) 1551 end 1552 1553 // turns the saturated values to lime green 1554 Function V_ColorizeSaturated() 1555 ModifyImage data ctab= {0,16382,ColdWarm,0},minRGB=0,maxRGB=(32792,65535,1) 1556 End 1557 1558 1559 1560 /// 1561 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Write_VSANS_QIS.ipf
r1098 r1108 330 330 End 331 331 332 // awkward, but can't call STRUCT from Proc 333 Proc Vm_Write1DData_ITX() 334 Vf_FakeSaveIQITXClick() 335 End 336 337 Function Vf_FakeSaveIQITXClick() 338 STRUCT WMButtonAction ba 339 ba.eventCode=2 340 V_SaveIQ_ButtonProc(ba) 341 end
Note: See TracChangeset
for help on using the changeset viewer.