From 26180566e5fc4184214fb3c8ca208f1ad93459ef Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Tue, 3 May 2011 10:36:20 +0000 Subject: [PATCH] If Bg and Data bins are empty use musrt0 for defaults. --- src/external/MuSRFitGUI/MSR.pm | 34 +++++++++++++++++-------- src/external/MuSRFitGUI/MuSRFit.ui | 40 +++++++++++++++--------------- 2 files changed, 43 insertions(+), 31 deletions(-) diff --git a/src/external/MuSRFitGUI/MSR.pm b/src/external/MuSRFitGUI/MSR.pm index a8e87379..5737022b 100755 --- a/src/external/MuSRFitGUI/MSR.pm +++ b/src/external/MuSRFitGUI/MSR.pm @@ -295,28 +295,40 @@ FUNCTIONS foreach ("t0","Bg1","Bg2","Data1","Data2") { $Name = "$_$NHist"; # If empty fill with defaults - if ($All{$Name} eq $EMPTY) { - $All{$Name}=MSR::T0BgData($_,$Hist,$BeamLine); - } +# if ($All{$Name} eq $EMPTY) { +# $All{$Name}=MSR::T0BgData($_,$Hist,$BeamLine); +# } + } +# If empty skip lines + if ($All{"Bg1$NHist"} ne $EMPTY && $All{"Bg2$NHist"} ne $EMPTY) { + $Bg_Line = $Bg_Line." ".$All{"Bg1$NHist"}." ".$All{"Bg2$NHist"}; + } + if ($All{"Data1$NHist"} ne $EMPTY && $All{"Data2$NHist"} ne $EMPTY) { + $Data_Line =$Data_Line." ".$All{"Data1$NHist"}." ".$All{"Data2$NHist"}; } - $Bg_Line = $Bg_Line." ".$All{"Bg1$NHist"}." ".$All{"Bg2$NHist"}; - $Data_Line =$Data_Line." ".$All{"Data1$NHist"}." ".$All{"Data2$NHist"}; if ($All{"t0$NHist"} ne $EMPTY) { $T0_Line=$T0_Line." ".$All{"Data1$NHist"}; } $NHist++; } +# Put T0_Line Bg_Line and Data_Line together if not empty + my $T0DataBg=$EMPTY; + if ($T0_Line ne "t0") { + $T0DataBg = $T0DataBg."\n".$T0_Line; + } + if ($Bg_Line ne "background") { + $T0DataBg = $T0DataBg."\n".$Bg_Line; + } + if ($Data_Line ne "data") { + $T0DataBg = $T0DataBg."\n".$Data_Line; + } + $FRANGE_Line = "fit TINI TFIN"; $PAC_Line = "packing BINNING"; - - if ($T0_Line ne "t0") { - $Data_Line= $Data_Line."\n".$T0_Line; - } - $Single_RUN = -"$RUN_Line\n$Type_Line\n$Alpha_Line$Hist_Lines\n$Bg_Line\n$Data_Line\n$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n"; +"$RUN_Line\n$Type_Line\n$Alpha_Line$Hist_Lines\n$T0DataBg\n$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n"; # Now add the appropriate values of fit range and packing my $Range_Min = 8; diff --git a/src/external/MuSRFitGUI/MuSRFit.ui b/src/external/MuSRFitGUI/MuSRFit.ui index 687395b0..3f342874 100755 --- a/src/external/MuSRFitGUI/MuSRFit.ui +++ b/src/external/MuSRFitGUI/MuSRFit.ui @@ -23,7 +23,7 @@ 21 - 271 + 264 @@ -3428,6 +3428,25 @@ t0/Bg + + + t0Update + + + false + + + + 450 + 220 + 94 + 27 + + + + Update + + layout25 @@ -3775,25 +3794,6 @@ - - - t0Update - - - false - - - - 450 - 220 - 94 - 27 - - - - Update - -