Added ExtractInfo for LEM and Bulk files.

This commit is contained in:
salman 2009-09-22 11:33:02 +00:00
parent ecdaa1b2cb
commit 02334c8319
3 changed files with 128 additions and 21 deletions

View File

@ -17,6 +17,29 @@ my %BeamLines = ( "LEM", "MUE4", "GPS", "PIM3", "LTF", "PIM3", "Dolly", "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", "GPS", "PSI-BIN", "LTF", "PSI-BIN", "Dolly", "PSI-BIN" , "GPD", "PSI-BIN");
# Additional information to extract run properties from database
# For LEM use summary files
$SUMM_DIR="/afs/psi.ch/project/nemu/data/summ/";
# For Bulok use list files
%DBDIR=("LEM","/afs/psi.ch/project/nemu/data/log/",
"GPS","/afs/psi.ch/project/bulkmusr/olddata/list/",
"Dolly","/afs/psi.ch/project/bulkmusr/olddata/list/",
"GPD","/afs/psi.ch/project/bulkmusr/olddata/list/",
"ALC","/afs/psi.ch/project/bulkmusr/olddata/list/",
"LTF","/afs/psi.ch/project/bulkmusr/olddata/list/");
# Information available since
%MinYears=("LEM","2001",
"GPS","1993",
"Dolly","1998",
"GPD","1993",
"ALC","1993",
"LTF","1995");
# And to deal with old names of bulk muons
%AltArea=("GPS","PIM3","LTF","PIM3","ALC","PIE3","Dolly","PIE1","GPD","MUE1");
# Additions to paremeters' names # Additions to paremeters' names
my $erradd = "d"; my $erradd = "d";
my $minadd = "_min"; my $minadd = "_min";
@ -1497,4 +1520,88 @@ sub RUNFileNameMan {
return $RUN_Line; return $RUN_Line;
} }
########################
# ExtractInfoLEM
########################
# Uset to extract information from summary files
sub ExtractInfoLEM {
my ($RUN,$YEAR,$Arg) = @_;
my $Summ_File_Name = "lem" . substr( $YEAR, 2 ) . "_" . $RUN . ".summ";
my $SummFile = "$SUMM_DIR/$YEAR/$Summ_File_Name";
open( SFILE,q{<}, "$SummFile" );
my @lines = <SFILE>;
close(SFILE);
if ( $Arg eq "TITLE" ) {
$RTRN_Val = $lines[3];
$RTRN_Val =~ s/\n//g;
}
elsif ( $Arg eq "Temp" ) {
foreach my $line (@lines) {
if ( $line =~ /Mean Sample_CF1/ ) {
( my $tmp, my $T ) = split( /=/, $line );
( $T, $tmp ) = split( /\(/, $T );
$RTRN_Val = $T;
}
}
}
elsif ( $Arg eq "Field" ) {
foreach my $line (@lines) {
if ( $line =~ /Mean B field/ ) {
( $tmp, my $B ) = split( /=/, $line );
( $B, $tmp ) = split( /\(/, $B );
$RTRN_Val = $B;
}
}
}
elsif ( $Arg eq "Energy" ) {
foreach my $line (@lines) {
if ( $line =~ /implantation energy/ ) {
( my $tmp1, my $tmp2, my $E ) = split( /=/, $line );
( $E, $tmp ) = split( /keV/, $E );
$RTRN_Val = $E;
}
}
}
# $RTRN_Val =~ s/[\.\~\/\&\*\[\;\>\<\^\$\(\)\`\|\]\'\@]//g;
return $RTRN_Val;
}
# Uset to extract information from log files
sub ExtractInfoBulk {
my ($RUN,$AREA,$YEAR,$Arg) = @_;
if ($RUN < 10) { $RUN = "000".$RUN; }
elsif ($RUN < 100) { $RUN = "00".$RUN; }
elsif ($RUN < 1000) { $RUN = "0".$RUN; }
# Information may be found in these file
my $DBFILE=$DBDIR{$AREA}.$YEAR."/*.runs";
my @Lines =`cat $DBFILE`;
# Select intries with the right area
my $area=lc $AREA;
my @Lines1 = grep { /$area/ } @Lines;
my @Lines2 = grep { /$AltArea{$AREA}/ } @Lines;
@Lines=(@Lines1,@Lines2);
# Select intries with the right run number
@Lines = grep { /$RUN/ } @Lines;
@Words=split(/\s+/,$Lines[0]);
if ( $Arg eq "TITLE" ) {
$RTRN_Val = substr($Lines[0],104);
}
elsif ( $Arg eq "Temp" ) {
$RTRN_Val = $Words[6];
}
elsif ( $Arg eq "Field" ) {
$RTRN_Val = $Words[7];
}
return $RTRN_Val;
}
1; 1;

View File

@ -1,6 +1,6 @@
# Form implementation generated from reading ui file 'MuSRFit.ui' # Form implementation generated from reading ui file 'MuSRFit.ui'
# #
# Created: Tue Sep 22 10:33:24 2009 # Created: Tue Sep 22 11:42:50 2009
# 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!
@ -185,8 +185,8 @@ use Qt::attributes qw(
Edit Edit
Options Options
helpMenu helpMenu
toolBar FileToolBar
Toolbar ActionsToolBar
fileNewAction fileNewAction
fileOpenAction fileOpenAction
fileSaveAction fileSaveAction
@ -2502,20 +2502,20 @@ sub NEW
T0->setIconSet( Qt::IconSet($image19) ); T0->setIconSet( Qt::IconSet($image19) );
toolBar = Qt::ToolBar("", this, &DockTop); FileToolBar = Qt::ToolBar("", this, &DockTop);
fileOpenAction->addTo(toolBar); fileOpenAction->addTo(FileToolBar);
fileExitAction->addTo(toolBar); fileExitAction->addTo(FileToolBar);
fileChangeDirAction->addTo(toolBar); fileChangeDirAction->addTo(FileToolBar);
fileSaveAction->addTo(toolBar); fileSaveAction->addTo(FileToolBar);
filePrintAction->addTo(toolBar); filePrintAction->addTo(FileToolBar);
Toolbar = Qt::ToolBar("", this, &DockTop); ActionsToolBar = Qt::ToolBar("", this, &DockTop);
Fit->addTo(Toolbar); Fit->addTo(ActionsToolBar);
Plot->addTo(Toolbar); Plot->addTo(ActionsToolBar);
T0->addTo(Toolbar); T0->addTo(ActionsToolBar);
parametersExport_AsAction->addTo(Toolbar); parametersExport_AsAction->addTo(ActionsToolBar);
parametersAppend_ToAction->addTo(Toolbar); parametersAppend_ToAction->addTo(ActionsToolBar);
MenuBar= Qt::MenuBar( this, "MenuBar"); MenuBar= Qt::MenuBar( this, "MenuBar");
@ -2945,8 +2945,8 @@ sub languageChange
Plot->setAccel( Qt::KeySequence( trUtf8("Ctrl+P") ) ); Plot->setAccel( Qt::KeySequence( trUtf8("Ctrl+P") ) );
T0->setText( trUtf8("Show t0 and Bg Bins") ); T0->setText( trUtf8("Show t0 and Bg Bins") );
T0->setAccel( Qt::KeySequence( trUtf8("Ctrl+T") ) ); T0->setAccel( Qt::KeySequence( trUtf8("Ctrl+T") ) );
toolBar->setLabel( trUtf8("Tools") ); FileToolBar->setLabel( trUtf8("File Menu") );
Toolbar->setLabel( trUtf8("Toolbar") ); ActionsToolBar->setLabel( trUtf8("Actions Menu") );
MenuBar->findItem( 2 )->setText( trUtf8("&File") ); MenuBar->findItem( 2 )->setText( trUtf8("&File") );
MenuBar->findItem( 3 )->setText( trUtf8("Actions") ); MenuBar->findItem( 3 )->setText( trUtf8("Actions") );
MenuBar->findItem( 4 )->setText( trUtf8("Parameters") ); MenuBar->findItem( 4 )->setText( trUtf8("Parameters") );

View File

@ -3712,10 +3712,10 @@
<toolbars> <toolbars>
<toolbar dock="2"> <toolbar dock="2">
<property name="name"> <property name="name">
<cstring>toolBar</cstring> <cstring>FileToolBar</cstring>
</property> </property>
<property name="label"> <property name="label">
<string>Tools</string> <string>File Menu</string>
</property> </property>
<action name="fileOpenAction"/> <action name="fileOpenAction"/>
<action name="fileExitAction"/> <action name="fileExitAction"/>
@ -3725,10 +3725,10 @@
</toolbar> </toolbar>
<toolbar dock="2"> <toolbar dock="2">
<property name="name"> <property name="name">
<cstring>Toolbar</cstring> <cstring>ActionsToolBar</cstring>
</property> </property>
<property name="label"> <property name="label">
<string>Toolbar</string> <string>Actions Menu</string>
</property> </property>
<action name="Fit"/> <action name="Fit"/>
<action name="Plot"/> <action name="Plot"/>