Pass on run number tagging from devel branch to current
This commit is contained in:
parent
2e41140242
commit
1650271548
64
src/external/MuSRFitGUI/MSR.pm
vendored
64
src/external/MuSRFitGUI/MSR.pm
vendored
@ -358,7 +358,7 @@ FUNCTIONS
|
|||||||
|
|
||||||
# Start constructing all blocks
|
# Start constructing all blocks
|
||||||
my $TitleLine = $All{"TITLE"}."\n# Run Numbers: ".$All{"RunNumbers"};
|
my $TitleLine = $All{"TITLE"}."\n# Run Numbers: ".$All{"RunNumbers"};
|
||||||
$TitleLine =~ s/,/:/g;
|
# $TitleLine =~ s/,/:/g;
|
||||||
|
|
||||||
# Get parameter block from MSR::PrepParamTable(\%All);
|
# Get parameter block from MSR::PrepParamTable(\%All);
|
||||||
my $FitParaBlk = "
|
my $FitParaBlk = "
|
||||||
@ -850,6 +850,41 @@ STATISTIC --- 0000-00-00 00:00:00
|
|||||||
return($Full_T_Block,\@Paramcomp);
|
return($Full_T_Block,\@Paramcomp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# CreateMSRGLB
|
||||||
|
#
|
||||||
|
# Uses CreateMSR to produce a template and then msr2data to globalize it
|
||||||
|
#
|
||||||
|
# Input in %All
|
||||||
|
#
|
||||||
|
# Output
|
||||||
|
# $Full_T_Block - Full theory block
|
||||||
|
# @Paramcomp - Space separated list of parameters for each component
|
||||||
|
# FILENAME.msr - MSR file saved
|
||||||
|
#
|
||||||
|
##########################################################################
|
||||||
|
sub CreateMSRGLB {
|
||||||
|
my %All = %{$_[0]};
|
||||||
|
|
||||||
|
my @RUNS = ();
|
||||||
|
if ($All{"RUNSType"}) {
|
||||||
|
# Make sure this globalization is disabled if RunFiles are used
|
||||||
|
@RUNS = split( /,/, $All{"RunFiles"} );
|
||||||
|
} else {
|
||||||
|
@RUNS = split( /,/, $All{"RunNumbers"} );
|
||||||
|
}
|
||||||
|
|
||||||
|
# Make example from first run
|
||||||
|
$All{"RunNumbers"}=$RUNS[0];
|
||||||
|
my ($Full_T_Block,$Paramcomp_ref)= MSR::CreateMSR(\%All);
|
||||||
|
|
||||||
|
# TODO: create global file from example file
|
||||||
|
|
||||||
|
|
||||||
|
# Return as usual
|
||||||
|
my @Paramcomp = @$Paramcomp_ref;
|
||||||
|
return($Full_T_Block,\@Paramcomp);
|
||||||
|
}
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# Createheory
|
# Createheory
|
||||||
@ -1277,7 +1312,8 @@ sub PrepParamTable {
|
|||||||
$Shared = $All{"Sh_$Param"};
|
$Shared = $All{"Sh_$Param"};
|
||||||
if ( $Shared!=1 || $iRun == 1 ) {
|
if ( $Shared!=1 || $iRun == 1 ) {
|
||||||
# It there are multiple runs index the parameters accordingly
|
# It there are multiple runs index the parameters accordingly
|
||||||
$Param=$Param."_".$iRun;
|
my $RUNtmp=sprintf("%04d",$RUN);
|
||||||
|
if ($Shared!=1) {$Param=$Param."_".$RUNtmp;}
|
||||||
# Check if this parameter has been initialized befor. If not take from defaults
|
# Check if this parameter has been initialized befor. If not take from defaults
|
||||||
$value = $All{"$Param"};
|
$value = $All{"$Param"};
|
||||||
if ( $value ne $EMPTY ) {
|
if ( $value ne $EMPTY ) {
|
||||||
@ -1334,7 +1370,8 @@ sub PrepParamTable {
|
|||||||
$Shared = $All{"Sh_$Param"};
|
$Shared = $All{"Sh_$Param"};
|
||||||
if ( $Shared!=1 || $iRun == 1 ) {
|
if ( $Shared!=1 || $iRun == 1 ) {
|
||||||
# It there are multiple runs index the parameters accordingly
|
# It there are multiple runs index the parameters accordingly
|
||||||
$Param=$Param."_".$iRun;
|
my $RUNtmp=sprintf("%04d",$RUN);
|
||||||
|
if ($Shared!=1) {$Param=$Param."_".$RUNtmp;}
|
||||||
# Check if this parameter has been initialized befor. If not take from defaults
|
# Check if this parameter has been initialized befor. If not take from defaults
|
||||||
$value = $All{"$Param"};
|
$value = $All{"$Param"};
|
||||||
if ( $value ne $EMPTY ) {
|
if ( $value ne $EMPTY ) {
|
||||||
@ -1448,8 +1485,9 @@ sub ExportParams {
|
|||||||
|
|
||||||
$Shared = $All{"Sh_$Param"};
|
$Shared = $All{"Sh_$Param"};
|
||||||
if ( $Shared!=1 || $iRun == 1 ) {
|
if ( $Shared!=1 || $iRun == 1 ) {
|
||||||
# It there are multiple runs index the parameters accordingly
|
# If there are multiple runs index the parameters accordingly
|
||||||
$Param=$Param."_".$iRun;
|
my $RUNtmp=sprintf("%04d",$RUN);
|
||||||
|
if ($Shared!=1) {$Param=$Param."_".$RUNtmp;}
|
||||||
# Check if this parameter has been initialized befor. (should be)
|
# Check if this parameter has been initialized befor. (should be)
|
||||||
$value = $All{"$Param"};
|
$value = $All{"$Param"};
|
||||||
$error = $All{"$erradd$Param"};
|
$error = $All{"$erradd$Param"};
|
||||||
@ -1493,8 +1531,9 @@ sub ExportParams {
|
|||||||
|
|
||||||
$Shared = $All{"Sh_$Param"};
|
$Shared = $All{"Sh_$Param"};
|
||||||
if ( $Shared!=1 || $iRun == 1 ) {
|
if ( $Shared!=1 || $iRun == 1 ) {
|
||||||
# It there are multiple runs index the parameters accordingly
|
# If there are multiple runs index the parameters accordingly
|
||||||
$Param=$Param."_".$iRun;
|
my $RUNtmp=sprintf("%04d",$RUN);
|
||||||
|
if ($Shared!=1) {$Param=$Param."_".$RUNtmp;}
|
||||||
# Check if this parameter has been initialized befor. (should be)
|
# Check if this parameter has been initialized befor. (should be)
|
||||||
$value = $All{"$Param"};
|
$value = $All{"$Param"};
|
||||||
$error = $All{"$erradd$Param"};
|
$error = $All{"$erradd$Param"};
|
||||||
@ -1625,11 +1664,7 @@ sub RUNFileNameAuto {
|
|||||||
(my $RUN, my $YEAR, my $BeamLine) = @_;
|
(my $RUN, my $YEAR, my $BeamLine) = @_;
|
||||||
|
|
||||||
my $DATADIR = $DATADIRS{$BeamLine};
|
my $DATADIR = $DATADIRS{$BeamLine};
|
||||||
my $RUNtmp = $EMPTY;
|
my $RUNtmp=sprintf("%04d",$RUN);
|
||||||
if ( $RUN < 10 ) { $RUNtmp = "000" . $RUN; }
|
|
||||||
elsif ( $RUN < 100 ) { $RUNtmp = "00" . $RUN; }
|
|
||||||
elsif ( $RUN < 1000 ) { $RUNtmp = "0" . $RUN; }
|
|
||||||
else { $RUNtmp=$RUN; }
|
|
||||||
|
|
||||||
# Get current year
|
# Get current year
|
||||||
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
|
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
|
||||||
@ -1763,9 +1798,8 @@ sub ExtractInfoLEM {
|
|||||||
# Uset to extract information from log files
|
# Uset to extract information from log files
|
||||||
sub ExtractInfoBulk {
|
sub ExtractInfoBulk {
|
||||||
my ($RUN,$AREA,$YEAR,$Arg) = @_;
|
my ($RUN,$AREA,$YEAR,$Arg) = @_;
|
||||||
if ($RUN < 10) { $RUN = "000".$RUN; }
|
my $RUNtmp=sprintf("%04d",$RUN);
|
||||||
elsif ($RUN < 100) { $RUN = "00".$RUN; }
|
$RUN=$RUNtmp;
|
||||||
elsif ($RUN < 1000) { $RUN = "0".$RUN; }
|
|
||||||
|
|
||||||
# Information may be found in these file
|
# Information may be found in these file
|
||||||
my $DBFILE=$DBDIR{$AREA}.$YEAR."/*.runs";
|
my $DBFILE=$DBDIR{$AREA}.$YEAR."/*.runs";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user