Option to use msr2data to create global fit msr file. Still not complete.
This commit is contained in:
parent
84467eae96
commit
b4728250d7
71
src/external/MuSRFitGUI/devel/MSR.pm
vendored
71
src/external/MuSRFitGUI/devel/MSR.pm
vendored
@ -14,10 +14,10 @@ my %DATADIRS = (
|
|||||||
"GPD", "/afs/psi.ch/project/bulkmusr/data/gpd"
|
"GPD", "/afs/psi.ch/project/bulkmusr/data/gpd"
|
||||||
);
|
);
|
||||||
|
|
||||||
my %BeamLines = ( "LEM", "MUE4", "GPS", "PIM3", "LTF", "PIM3", "Dolly", "PIE1", "GPD", "PIE1" );
|
my %BeamLines = ( "LEM", "MUE4", "LEM (PPC)", "MUE4", "GPS", "PIM3", "LTF", "PIM3", "Dolly", "PIE1", "GPD", "PIE1" );
|
||||||
|
|
||||||
my %Def_Format =
|
my %Def_Format =
|
||||||
( "LEM", "ROOT-NPP", "GPS", "PSI-BIN", "LTF", "PSI-BIN", "Dolly", "PSI-BIN" , "GPD", "PSI-BIN");
|
( "LEM", "ROOT-NPP", "LEM (PPC)", "ROOT-PPC", "GPS", "PSI-BIN", "LTF", "PSI-BIN", "Dolly", "PSI-BIN" , "GPD", "PSI-BIN");
|
||||||
|
|
||||||
# Additional information to extract run properties from database
|
# Additional information to extract run properties from database
|
||||||
# For LEM use summary files
|
# For LEM use summary files
|
||||||
@ -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,18 +1664,14 @@ 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 ) =
|
||||||
localtime( time() );
|
localtime( time() );
|
||||||
my $current_year = $year + 1900;
|
my $current_year = $year + 1900;
|
||||||
|
|
||||||
if ( $BeamLine eq "LEM" ) {
|
if ( $BeamLine eq "LEM" || $BeamLine eq "LEM (PPC)") {
|
||||||
$RUN_File_Name = "lem" . substr( $YEAR, 2 ) . "_his_" . $RUNtmp;
|
$RUN_File_Name = "lem" . substr( $YEAR, 2 ) . "_his_" . $RUNtmp;
|
||||||
$RUNFILE = "$DATADIR/$YEAR/$RUN_File_Name";
|
$RUNFILE = "$DATADIR/$YEAR/$RUN_File_Name";
|
||||||
}
|
}
|
||||||
@ -1659,7 +1694,6 @@ sub RUNFileNameAuto {
|
|||||||
my $RUN_Line = join( $SPACE,
|
my $RUN_Line = join( $SPACE,
|
||||||
"RUN", $RUNFILE, $BeamLines{$BeamLine}, "PSI",
|
"RUN", $RUNFILE, $BeamLines{$BeamLine}, "PSI",
|
||||||
$Def_Format{$BeamLine} );
|
$Def_Format{$BeamLine} );
|
||||||
|
|
||||||
return $RUN_Line;
|
return $RUN_Line;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1764,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";
|
||||||
|
6
src/external/MuSRFitGUI/devel/MuSRFit.pl
vendored
6
src/external/MuSRFitGUI/devel/MuSRFit.pl
vendored
@ -1,6 +1,6 @@
|
|||||||
# Form implementation generated from reading ui file 'MuSRFit.ui'
|
# Form implementation generated from reading ui file 'MuSRFit.ui'
|
||||||
#
|
#
|
||||||
# Created: Fri May 13 14:43:52 2011
|
# Created: Mon Aug 29 15:52:41 2011
|
||||||
# by: The PerlQt User Interface Compiler (puic)
|
# by: The PerlQt User Interface Compiler (puic)
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
@ -3206,6 +3206,7 @@ sub languageChange
|
|||||||
BeamLine->insertItem( trUtf8("GPS") );
|
BeamLine->insertItem( trUtf8("GPS") );
|
||||||
BeamLine->insertItem( trUtf8("Dolly") );
|
BeamLine->insertItem( trUtf8("Dolly") );
|
||||||
BeamLine->insertItem( trUtf8("LTF") );
|
BeamLine->insertItem( trUtf8("LTF") );
|
||||||
|
BeamLine->insertItem( trUtf8("LEM (PPC)") );
|
||||||
BeamLineLabel->setText( trUtf8("On beam line") );
|
BeamLineLabel->setText( trUtf8("On beam line") );
|
||||||
YEARLabel->setText( trUtf8("Year") );
|
YEARLabel->setText( trUtf8("Year") );
|
||||||
RUNSMan->setTitle( trUtf8("RUN Files") );
|
RUNSMan->setTitle( trUtf8("RUN Files") );
|
||||||
@ -3888,6 +3889,9 @@ sub CreateAllInput
|
|||||||
# Construct a default filename if empty
|
# Construct a default filename if empty
|
||||||
if ( $All{"FILENAME"} eq "" && !$All{"RUNSType"}) {
|
if ( $All{"FILENAME"} eq "" && !$All{"RUNSType"}) {
|
||||||
$All{"FILENAME"}=$RUNS[0]."_".$All{"BeamLine"}."_".$All{"YEAR"};
|
$All{"FILENAME"}=$RUNS[0]."_".$All{"BeamLine"}."_".$All{"YEAR"};
|
||||||
|
if ($All{"BeamLine"} eq "LEM (PPC)") {
|
||||||
|
$All{"FILENAME"}=$RUNS[0]."_LEM_".$All{"YEAR"};
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$All{"FILENAME"}="TMP";
|
$All{"FILENAME"}="TMP";
|
||||||
}
|
}
|
||||||
|
5
src/external/MuSRFitGUI/devel/MuSRFit.ui
vendored
5
src/external/MuSRFitGUI/devel/MuSRFit.ui
vendored
@ -161,6 +161,11 @@
|
|||||||
<string>LTF</string>
|
<string>LTF</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>LEM (PPC)</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
<property name="name">
|
<property name="name">
|
||||||
<cstring>BeamLine</cstring>
|
<cstring>BeamLine</cstring>
|
||||||
</property>
|
</property>
|
||||||
|
3
src/external/MuSRFitGUI/devel/MuSRFit.ui.h
vendored
3
src/external/MuSRFitGUI/devel/MuSRFit.ui.h
vendored
@ -414,6 +414,9 @@ void MuSRFitform::CreateAllInput()
|
|||||||
# Construct a default filename if empty
|
# Construct a default filename if empty
|
||||||
if ( $All{"FILENAME"} eq "" && !$All{"RUNSType"}) {
|
if ( $All{"FILENAME"} eq "" && !$All{"RUNSType"}) {
|
||||||
$All{"FILENAME"}=$RUNS[0]."_".$All{"BeamLine"}."_".$All{"YEAR"};
|
$All{"FILENAME"}=$RUNS[0]."_".$All{"BeamLine"}."_".$All{"YEAR"};
|
||||||
|
if ($All{"BeamLine"} eq "LEM (PPC)") {
|
||||||
|
$All{"FILENAME"}=$RUNS[0]."_LEM_".$All{"YEAR"};
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$All{"FILENAME"}="TMP";
|
$All{"FILENAME"}="TMP";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user