Changeset 835 for sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_PolarizationPanels.ipf
- Timestamp:
- Feb 6, 2012 12:19:28 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_PolarizationPanels.ipf
r832 r835 3 3 4 4 // TODO: 5 // - on the decay panel. need to be able to manually enter a date that is to or an offset5 // x- on the decay panel. need to be able to manually enter a date that is to or an offset 6 6 // number of hours. currently it takes the first file as t=0, which is often not correct 7 7 // … … 16 16 // -1- Fundamental Cell Parameters -- these are constants, generally not editable. (this file) 17 17 // -2- Decay Parameters -- these are fitted values based on transmission mearurements (this file) 18 // -3- Flipper Panel is in its own procedure ( FlipperPanel.ipf)19 // -4- PolCor_Panel is in Pol arizationCorrection.ipf20 18 // -3- Flipper Panel is in its own procedure (Pol_FlipperPanel.ipf) 19 // -4- PolCor_Panel is in Pol_PolarizationCorrection.ipf 20 // 21 21 // 22 22 // Driven by 4 panels to get the necessary information from the users … … 71 71 // - Polarization correction is done with one click (one per tab). "_pc" tags are added to the resulting names, 72 72 // and copies of all of the associated waves are again copied (wasteful), but makes switching display very easy 73 // - Once all of the polariz tion correction is done, then the UU_pc (etc.) data can be reduced as usual (xx_pc = 4 passes)73 // - Once all of the polarization correction is done, then the UU_pc (etc.) data can be reduced as usual (xx_pc = 4 passes) 74 74 // - protocol is built as ususal, from this panel only (since the SAM, EMP, and BGD need to be switched, rather than loaded 75 75 // - protocols can be saved/recalled. … … 84 84 85 85 86 // for the menu 87 Menu "Macros" 88 "1 Fundamental Cell Parameters",ShowCellParamPanel() 89 "2 Cell Decay",ShowCellDecayPanel() 90 "3 Flipper States",ShowFlipperPanel() 91 "4 Polarization Correction",ShowPolCorSetup() 92 End 93 86 94 87 95 // … … 96 104 // Te=num 97 105 // err_Te=num 98 // mu=n num106 // mu=num 99 107 // err_mu=num 100 108 // … … 103 111 // all of the strings start w/ "gCell_" 104 112 // 105 MacroShowCellParamPanel()113 Proc ShowCellParamPanel() 106 114 107 115 // init folders … … 359 367 // all of the strings start w/ "gDecay_" 360 368 // 361 MacroShowCellDecayPanel()369 Proc ShowCellDecayPanel() 362 370 363 371 // init folders … … 426 434 Button button_6,pos={620,620},size={100,20},proc=WindowSnapshotButton,title="Snapshot" 427 435 Button button_7,pos={620,580},size={130,20},proc=ManualEnterDecayButton,title="Manual Entry" 428 436 CheckBox check0,mode=0,pos={600,550},title="Overrride T0?",value=0 429 437 430 438 … … 561 569 SetDataFolder root: 562 570 571 // 572 // now show the fit results, if any, from the wave note 573 // 574 SVAR gMuPo = root:Packages:NIST:Polarization:Cells:gMuPo 575 SVAR gPo = root:Packages:NIST:Polarization:Cells:gPo 576 SVAR gGamma = root:Packages:NIST:Polarization:Cells:gGamma 577 SVAR gT0 = root:Packages:NIST:Polarization:Cells:gT0 578 String nStr=note(decay) 579 580 581 // for the panel display 582 sprintf gMuPo, "%g +/- %g",NumberByKey("muP", nStr, "=",","),NumberByKey("err_muP", nStr, "=",",") 583 sprintf gPo, "%g +/- %g",NumberByKey("P0", nStr, "=",","),NumberByKey("err_P0", nStr, "=",",") 584 sprintf gGamma, "%g +/- %g",NumberByKey("gamma", nStr, "=",","),NumberByKey("err_gamma", nStr, "=",",") 585 gT0 = StringByKey("T0", nStr, "=",",") 586 587 588 // clear the graph - force the user to update it manually 589 // clear old data, and plot the new 590 // 591 SetDataFolder root:Packages:NIST:Polarization:Cells: 592 593 CheckDisplayed/W=DecayPanel#G0 tmp_muP,tmp_muP2,fit_tmp_muP 594 // if both present, bit 0 + bit 1 = 3 595 if(V_flag & 2^0) //check bit 0 596 RemoveFromGraph/W=DecayPanel#G0 tmp_muP 597 endif 598 if(V_flag & 2^1) 599 RemoveFromGraph/W=DecayPanel#G0 tmp_muP2 600 endif 601 if(V_flag & 2^2) 602 RemoveFromGraph/W=DecayPanel#G0 fit_tmp_muP 603 endif 604 605 // kill the text box (name is hard-wired) 606 TextBox/W=DecayPanel#G0/K/N=CF_tmp_muP 607 608 setDataFolder root: 609 563 610 break 564 611 case -1: // control being killed … … 588 635 589 636 // generate the dummy wave note now, change as needed 590 Note decay, "muP= 2,err_muP=0,P0=0.6,err_P0=0,T0=asdf,gamma=200,err_gamma=0,"637 Note decay, "muP=0,err_muP=0,P0=0,err_P0=0,T0=undefined,gamma=0,err_gamma=0," 591 638 592 639 // to hold the results of the calculation … … 657 704 // selRow = V_startRow 658 705 659 Variable sum_muP, err_avg_muP, sum_Po, err_avg_Po, avg_muP, avg_Po 706 Variable sum_muP, err_avg_muP, sum_Po, err_avg_Po, avg_muP, avg_Po, overrideT0 660 707 sum_muP = 0 661 708 sum_Po = 0 … … 663 710 err_avg_Po = 0 664 711 712 ControlInfo/W=DecayPanel check0 713 overrideT0 = V_Value 714 665 715 for(selRow=0;selRow<numRows;selRow+=1) 666 716 Print "calculate the row ",selRow 667 717 668 if(selRow == 0 )718 if(selRow == 0 && !overrideT0) 669 719 //find T0 670 720 fname = FindFileFromRunNumber(w[0][%Trans_He_In]) … … 677 727 Note w, noteStr 678 728 Print t0str 679 w[selRow][%elapsed_hr] = 0 //by definition 729 else 730 // manually entered on the panel to override the 731 SVAR gT0 = root:Packages:NIST:Polarization:Cells:gT0 732 t0Str = gT0 733 noteStr = note(w) 734 noteStr = ReplaceStringByKey("T0", noteStr, gT0 ,"=", ",", 0) 735 Note/K w 736 Note w, noteStr 737 Print t0str 680 738 endif 681 739
Note: See TracChangeset
for help on using the changeset viewer.