diff --git a/ChangeLog b/ChangeLog index 35adc455..909699b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ changes since 0.13.0 =================================== +NEW 2015-02-19 added a first preliminary user interface for musrFT within musredit. NEW 2015-02-16 changed the data export handling from musrview. It is now more main line and follows the implementation of musrFT. NEW 2015-02-13 first implementation of a standalone Fourier transform/plotter: diff --git a/doc/html/user/MUSR/BmwLibs.html b/doc/html/user/MUSR/BmwLibs.html index 492bc7f1..3ee693e6 100644 --- a/doc/html/user/MUSR/BmwLibs.html +++ b/doc/html/user/MUSR/BmwLibs.html @@ -1,6 +1,6 @@ - +
@@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {musrFT
is an interactive graphical user interface for the presentation of Fourier transforms of raw μSR histograms. It's purpose is to get a quick overview for high TF-field data, as found e.g. at the HAL-9500 instrument at PSI. It Fourier transforms the raw histogram data, i.e. N(t) rather than A(t), and hence shows the lifetime contribution of the muon. This is no problem for large enough fields, but will be a severe problem at very low fields. musrFT
is still in its early stage and should be considered a beta-version.
+
+If called from within a shell it accepts the following parameters: musrFT 3110.msr 3111.msr
+musrFT
tries to guess, based on musrfit_startup.xml
settings.
+musrfit_startup.xml
). Default will be 'power'.
+musrFT -df lem15_his_01234.root --histo 1 3
, will only be needed together with the option --data-file
. If multiple data file are given, <list> will apply to all data-files given. If --histo
is not given, all histos of a data file will be used. <list> can be anything like: 2 3 6, or 2-17, or 1-6 9, etc.
+--data-file
and --fourier-option
real allows to get the proper initial phase if t0's are known. If a single t0 for multiple histos is given, it is assume, that this t0 is common to all histos. Example: musrFT -df lem15_his_01234.root -fo real --t0 2750 --histo 1 3
.
+musrFT -df tdc_hifi_2014_00153.mdu --title "MnSi" -tr 0 10 -fr 7.0 7.6 -u Tesla --histo 2-17 -awill take time range from t=0..10μsec, will show the Fourier transform in units of Tesla from B=7.0..7.6 Tesla of the detectors 2-17. Rather than showing the 16 individual Fourier transforms, the average of all Fourier spectra will be shown. t0's will be guessed by the maximum of the time domain histogram (assuming a prompt peak). +
musrFT -df tdc_hifi_2014_00153.mdu -tr 0 10 -fr 7.0 7.6 -u Tesla --histo 2-17 --title "MnSi average, T=50K, B=7.5T" -a -g pdfas Example 1 but rather than showing an interactive GUI, the output will be dumped into a pdf-file. The file name will be
tdc_hifi_2014_00153.pdf
.
+musrFT -df tdc_hifi_2014_00153.mdu -tr 0 10 -fr 7.0 7.6 -u Tesla --histo 2-17 --title "MnSi average, T=50K, B=7.5T" -a --dump MnSi.datas Example 1 but rather than showing an interactive GUI, the output will be dumped into the ascii file
MnSi.dat
.
+ROOT
canvases might be performed.
+In the menu bar the MusrFT menu can be found. From there some musrFT
-specific actions might be taken: musrFT
+musrt0
is a user interface for the determination of t0 and the time windows of data and background needed to be specified in the RUN blocks of the msr file. It can be operated either as an interactive program or in a non-interactive mode. In the non-interactive mode it accepts the following parameters: musrt0
can be interrupted. No cha
Closing a window by clicking the X button is equivalent to pressing Q, i.e. musrt0
is simply terminated.
-musrfit_startup.xml
is a configuration file located at the musrfit
binary path. In this file the following XML tags are allowed to define settings: musrfit
and musrview
will search for data files
msr
file. Additionally, in case a χ2 single-histogram fit is done, also Pearson's χ2 will be added.
@@ -309,7 +358,7 @@ An example would look like:
-msr2msr
is a small utility for converting existing WKM
msr files into musrfit
msr files. It accepts the following parameters: WKM
msr file (mandatory first parameter)
musrfit
msr file (mandatory second parameter)
@@ -321,7 +370,7 @@ A typical example then looks like:
If the input file has already the musrfit
msr file structure, the output file will be just a copy of the input file.
-any2many
is a muSR data file converter. Currently different facilities (PSI, TRIUMF, ISIS, J-PARC) are saving their muSR data files in different formats, or even worse some instruments are using other muSR data formats than others. The aim of any2many
is that these files can be converted into each other. Of course only a subset of header information can be converted.
Currently any2many
can convert the following muSR data file formats: NeXus
input file
Will read the two files '2010/lem10_his_0123.root'
and '2010/lem10_his_0012.root'
, rebin them with 25 and export them as LEM ROOT
files with adding rebin25
to the name, e.g. 2010/lem10_his_0123_rebin25.root
.
-dump_header
is a little program which tries to read a μSR data file and sends the relevant information (required header info, start of the histos, etc.) to the standard output. Currently the following μSR data file formats are supported: MusrROOT
, ROOT
(old LEM format), PSI-BIN
, PSI-MDU
, NeXus
(IDF1 and IDF2), MUD
, and WKM
.
@@ -1540,20 +1589,8 @@ For reporting bugs or requesting new features and improvements please use the
-
-
-
-
-
-
-
-
musrgui / musredit
musredit / (musrgui)
musrgui
and musredit
are editors which also provide a graphical user interface to the programs contained in the musrfit
suite and are intended to help the user handle musrfit
msr files. They are implemented in C++
and use the Qt framework. Principally, musrgui
and musredit
are doing the same, but are based on different Qt versions. musrgui
is based on Qt 3.x and will only be maintained on bug-fixing level since the Qt 3.x licensing is less straight forward than the Qt 4.x one. musredit
is based on Qt 4.6 (or above) and this is the program which will be developed further.musredit
and musrgui
are editors which also provide a graphical user interface to the programs contained in the musrfit
suite and are intended to help the user handle musrfit
msr files. They are implemented in C++
and use the Qt framework. Principally, musrgui
and musredit
are doing the same, but are based on different Qt versions. musrgui
is based on Qt 3.x and will only be maintained on bug-fixing level since the Qt 3.x licensing is less straight forward than the Qt 4.x one. musredit
is based on Qt 4.6 (or above) and this is the program which will be developed further.musrfit
are described—the basic editor functions which should be self-explanatory are not.
Before going on using musrgui
/ musredit
it is strongly recommended to read the manual of musrfit
first!
musrgui
/ musredit
are the editor executables. If called from within a shell they accept a few optional parameters: musredit
/ musrgui
are the editor executables. If called from within a shell they accept a few optional parameters: musrgui
/ musredit
.
musrgui
/ musredit
@@ -148,10 +148,10 @@ On this documentation page only the features related to musrfit
are
If called without any parameters an empty editor window opens.
-musrgui_startup.xml
/ musredit_startup.xml
are configuration files located at the musrgui
/ musredit
binary path. It is also possible to have another version of this file in the working directory which then will be used!
+musredit_startup.xml
/ musrgui_startup.xml
are configuration files located at the musredit
/ musrgui
binary path. It is also possible to have another version of this file in the working directory which then will be used!
-In this file the following XML tags are allowed to define settings and might proof useful for all users of musrgui
/ musredit
: musredit
/ musrgui
: musrfit
, musrview
, musrt0
, etc. can be found (inside the <general> environment)
musrgui
/ musredit
point by default when opening and saving msr files (inside the <general> environment)
@@ -291,6 +291,9 @@ The features of musrfit
which can be accessed by the graphical fron
musrt0 <msr_file>is called for the <msr_file> selected in the editor. For further information refer to the manual of
musrfit
.
musrFT <with-many-options>
is called. For a proper documentation of it, check the manual of musrFT
.
+musrfit
can be chosen. These options are --keep-mn2-output
, --dump ascii
, --dump root
, and --title-from-data-file
. For further information refer to the manual of musrfit
. Additionally, the access to musrt0
can be enabled temporarily.
@@ -310,9 +313,9 @@ Besides the functions described above and which are mostly interfacing mus
5 Bugtracking
-For reporting bugs or requesting new features and improvements please use the PSI Tracker or send an e-mail to A. Suter.
+For reporting bugs or requesting new features and improvements please use the Bitbucket Tracker, PSI Tracker (PSI account needed) or send an e-mail to A. Suter.
--- BMW & AS
RunHeader/SampleEnvironmentInfo
:
-
RunHeader/SampleEnvironmentInfo
:
musrgui
/musredit
—editors interfacing musrfit
msr2data
—a program for automatically processing multiple musrfit msr
files
any2many
—a universal μSR-file-format converter
-MusrRoot
: an extensible open file format for μSR MusrRoot
: an extensible open file format for μSR
Constructor.
+ *
+ * \param currentMsrFile path-file name of the currently active msr-file in musredit
+ * \param prevCmd list of the last (potential) previously call.
+ * \param helpUrl help url for the asymmetry run block
+ */
+PGetMusrFTOptionsDialog::PGetMusrFTOptionsDialog(QString currentMsrFile, QStringList &prevCmd, const QString helpUrl) :
+ fCurrentMsrFileName(currentMsrFile), fHelpUrl(helpUrl)
+{
+ setupUi(this);
+ setModal(true);
+
+ fBkgRangeStartBin_lineEdit->setValidator( new QIntValidator(fBkgRangeStartBin_lineEdit) );
+ fBkgRangeEndBin_lineEdit->setValidator( new QIntValidator(fBkgRangeEndBin_lineEdit) );
+ fPacking_lineEdit->setValidator( new QIntValidator(fPacking_lineEdit) );
+ fTimeRangeStart_lineEdit->setValidator( new QDoubleValidator(fTimeRangeStart_lineEdit) );
+ fTimeRangeEnd_lineEdit->setValidator( new QDoubleValidator(fTimeRangeEnd_lineEdit) );
+ fFourierPower_lineEdit->setValidator( new QIntValidator(fFourierPower_lineEdit) );
+ fLifetimeCorrection_lineEdit->setValidator( new QDoubleValidator(fLifetimeCorrection_lineEdit) );
+ fFourierRangeStart_lineEdit->setValidator( new QDoubleValidator(fFourierRangeStart_lineEdit) );
+ fFourierRangeEnd_lineEdit->setValidator( new QDoubleValidator(fFourierRangeEnd_lineEdit) );
+ fPacking_lineEdit->setText("1");
+
+ // populate dialog with the previous cmd call
+ bool msrTag = true;
+ QString str, str1, line;
+ int idx;
+ for (int i=0; i returns the musrFT command line options.
+ */
+QStringList PGetMusrFTOptionsDialog::getMusrFTOptions()
+{
+ QStringList cmd;
+ QString str("");
+ QStringList strList;
+
+ // check if currently active msr-file shall be used
+ if (fCurrentMsrFile_checkBox->checkState() == Qt::Checked) {
+ cmd << fCurrentMsrFileName;
+ } else {
+ // msr-files
+ for (int i=0; i SLOT called when fCurrentMsrFile_checkBox is checked/unchecked. If checked, it will clean up
+ * the msr-file path-file list and the data-file path-file list.
+ */
+void PGetMusrFTOptionsDialog::currentMsrFileTagChanged(int state)
+{
+ if (state == Qt::Checked) {
+ fAllMsrFiles_checkBox->setCheckState(Qt::Unchecked);
+
+ // remove all msr-data-file-names and data-path-file-names
+ fMsrFilePaths.clear();
+ fMsrFileNames.clear();
+ fMsrFileSelector_lineEdit->setText("");
+ fDataFilePaths.clear();
+ fDataFileNames.clear();
+ fDataFileSelector_lineEdit->setText("");
+ }
+}
+
+//----------------------------------------------------------------------------------------------------
+/**
+ * SLOT called when fAllMsrFiles_checkBox is checked/unchecked. Currently it has no functionality.
+ */
+void PGetMusrFTOptionsDialog::allMsrFileTagChanged(int state)
+{
+ if (state == Qt::Checked) {
+ fCurrentMsrFile_checkBox->setCheckState(Qt::Unchecked);
+ }
+}
+
+//----------------------------------------------------------------------------------------------------
+/**
+ * SLOT called when fMsrFileSelector_pushButton is clicked. Collects the msr-file path-name list.
+ */
+void PGetMusrFTOptionsDialog::selectMsrFileNames()
+{
+ QStringList flns = QFileDialog::getOpenFileNames( this, tr("Open msr-File(s)"), tr( "./" ),
+ tr( "msr-Files (*.msr);;All Files (*)" ));
+
+ QString str(""), str1("");
+ int idx;
+ if (flns.size() > 0) {
+ // delete already present elements
+ fMsrFilePaths.clear();
+ fMsrFileNames.clear();
+
+ // split path-name into path and name
+ for (int i=0; i SLOT called when the fMsrFileNameClear_pushButton is clicked.
+ */
+void PGetMusrFTOptionsDialog::clearMsrFileNames()
+{
+ fMsrFileSelector_lineEdit->setText("");
+ fMsrFilePaths.clear();
+ fMsrFileNames.clear();
+}
+
+//----------------------------------------------------------------------------------------------------
+/**
+ * SLOT called when fDataFileSelector_pushButton is clicked. Collects the data-file path-name list.
+ */
+void PGetMusrFTOptionsDialog::selectDataFileNames()
+{
+ QStringList flns = QFileDialog::getOpenFileNames( this, tr("Open msr-File(s)"), tr( "./" ),
+ tr( "data-Files (*.root *.bin *.msr *.nxs *.mdu);;All Files (*)" ));
+
+ QString str(""), str1("");
+ int idx;
+ if (flns.size() > 0) {
+ // delete already present elements
+ fDataFilePaths.clear();
+ fDataFileNames.clear();
+
+ // split path-name into path and name
+ for (int i=0; i SLOT called when the fDataFileNameClear_pushButton is clicked.
+ */
+void PGetMusrFTOptionsDialog::clearDataFileNames()
+{
+ fDataFileSelector_lineEdit->setText("");
+ fDataFilePaths.clear();
+ fDataFileNames.clear();
+}
+
+//----------------------------------------------------------------------------------------------------
+/**
+ * SLOT called when the create-msr-file tag has changed
+ */
+void PGetMusrFTOptionsDialog::createMsrFileChanged(int state)
+{
+ if (state == Qt::Checked) {
+ fCreateMsrFileName = QFileDialog::getSaveFileName(this, tr("Create msr-file"), "./", tr("msr-Files (*.msr);;All Files (*)"));
+ if (fCreateMsrFileName.length() == 0)
+ fCreateMsrFile_checkBox->setCheckState(Qt::Unchecked);
+ } else {
+ fCreateMsrFileName = "";
+ }
+}
+
+//----------------------------------------------------------------------------------------------------
+/**
+ * SLOT called when the Reset All button is pressed. Will remove all settings.
+ */
+void PGetMusrFTOptionsDialog::resetAll()
+{
+ fCurrentMsrFile_checkBox->setCheckState(Qt::Unchecked);
+ fAllMsrFiles_checkBox->setCheckState(Qt::Unchecked);
+ fMsrFilePaths.clear();
+ fMsrFileNames.clear();
+ fMsrFileSelector_lineEdit->setText("");
+ fDataFilePaths.clear();
+ fDataFileNames.clear();
+ fDataFileSelector_lineEdit->setText("");
+ fBkgRangeStartBin_lineEdit->setText("");
+ fBkgRangeEndBin_lineEdit->setText("");
+ fBkgList_lineEdit->setText("");
+ fApodization_comboBox->setCurrentIndex(MUSRFT_APOD_UNDEF);
+ fPacking_lineEdit->setText("");
+ fTimeRangeStart_lineEdit->setText("");
+ fTimeRangeEnd_lineEdit->setText("");
+ fHistoList_lineEdit->setText("");
+ fT0_lineEdit->setText("");
+ fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_UNDEF);
+ fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_UNDEF);
+ fFourierPower_lineEdit->setText("");
+ fLifetimeCorrection_lineEdit->setText("");
+ fFourierRangeStart_lineEdit->setText("");
+ fFourierRangeEnd_lineEdit->setText("");
+ fAveragedView_checkBox->setCheckState(Qt::Unchecked);
+ fCreateMsrFile_checkBox->setCheckState(Qt::Unchecked);
+ fFourierTitle_lineEdit->setText("");
+}
+
+//----------------------------------------------------------------------------------------------------
+/**
+ * Generates a help content window showing the description for musrFT.
+ */
+void PGetMusrFTOptionsDialog::helpContent()
+{
+ if (fHelpUrl.isEmpty()) {
+ QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
+ } else {
+#ifdef _WIN32GCC
+ QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
+#else
+ PHelp *help = new PHelp(fHelpUrl);
+ help->show();
+#endif // _WIN32GCC
+ }
+}
diff --git a/src/musredit/PGetMusrFTOptionsDialog.h b/src/musredit/PGetMusrFTOptionsDialog.h
new file mode 100644
index 00000000..8d3e0942
--- /dev/null
+++ b/src/musredit/PGetMusrFTOptionsDialog.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+
+ PGetMusrFTOptionsDialog.h
+
+ Author: Andreas Suter
+ e-mail: andreas.suter@psi.ch
+
+*****************************************************************************/
+
+/***************************************************************************
+ * Copyright (C) 2010-2015 by Andreas Suter *
+ * andreas.suter@psi.ch *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _PGETMUSRFTOPTIONSDIALOG_H_
+#define _PGETMUSRFTOPTIONSDIALOG_H_
+
+#include Calls musrFT via selection/option dialog. It will ask the user if he/she wants to overwrite some
+ * of the default settings.
+ */
+void PTextEdit::musrFT()
+{
+
+ PGetMusrFTOptionsDialog *dlg = new PGetMusrFTOptionsDialog(*fFilenames.find( currentEditor() ), fMusrFTPrevCmd, fAdmin->getHelpUrl("musrFT"));
+
+ if (dlg == 0) {
+ QMessageBox::critical(this, "**ERROR** musrFT", "Couldn't invoke musrFT Options Dialog.");
+ return;
+ }
+
+ if (dlg->exec() == QDialog::Accepted) {
+ fMusrFTPrevCmd = dlg->getMusrFTOptions();
+ QProcess proc(this);
+ proc.setStandardOutputFile("musrFT.log");
+ proc.setStandardErrorFile("musrFT.log");
+ proc.startDetached("musrFT", fMusrFTPrevCmd);
+ }
+
+ delete dlg;
+ dlg = 0;
+}
+
//----------------------------------------------------------------------------------------------------
/**
* Calls the preferences dialog which is used to set some global options.
diff --git a/src/musredit/PTextEdit.h b/src/musredit/PTextEdit.h
index f565ed61..149ab0bf 100644
--- a/src/musredit/PTextEdit.h
+++ b/src/musredit/PTextEdit.h
@@ -131,6 +131,7 @@ private slots:
void musrMsr2Data();
void musrView();
void musrT0();
+ void musrFT();
void musrPrefs();
void musrSwapMsrMlog();
void musrDump();
@@ -157,6 +158,7 @@ private:
bool fFileSystemWatcherActive; ///< flag to enable/disable the file system watcher
QTimer fFileSystemWatcherTimeout; ///< timer used to re-enable file system watcher. Needed to delay the re-enabling
QString fLastDirInUse; ///< string holding the path from where the last file was loaded.
+ QStringList fMusrFTPrevCmd;
QAction *fMusrT0Action;
diff --git a/src/musredit/forms/PGetMusrFTOptionsDialog.ui b/src/musredit/forms/PGetMusrFTOptionsDialog.ui
new file mode 100644
index 00000000..d2cf38be
--- /dev/null
+++ b/src/musredit/forms/PGetMusrFTOptionsDialog.ui
@@ -0,0 +1,842 @@
+
+