From 6e80c54d753f6de13a7e22225281e812384c968f Mon Sep 17 00:00:00 2001 From: Vickie Lynch Date: Wed, 25 Mar 2015 13:54:46 -0400 Subject: [PATCH 1/2] Refs #11229 option for nexus output added --- .../scripts/SCD_Reduction/ReduceSCD.config | 2 + .../scripts/SCD_Reduction/ReduceSCD_OneRun.py | 27 +++++-- .../SCD_Reduction/ReduceSCD_Parallel.py | 71 ++++++++++++++++--- 3 files changed, 85 insertions(+), 15 deletions(-) diff --git a/Code/Mantid/scripts/SCD_Reduction/ReduceSCD.config b/Code/Mantid/scripts/SCD_Reduction/ReduceSCD.config index 67b5014828af..324b3883589c 100644 --- a/Code/Mantid/scripts/SCD_Reduction/ReduceSCD.config +++ b/Code/Mantid/scripts/SCD_Reduction/ReduceSCD.config @@ -43,6 +43,8 @@ calibration_file_2 None # data_directory None output_directory /SNS/TOPAZ/IPTS-9890/shared/SPAnH +# Change to true for data with lots of peaks. Use False for ISAW ASCII output +output_nexus False # # If use_monitor_counts is True, then the integrated beam monitor diff --git a/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_OneRun.py b/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_OneRun.py index da992481ba3a..8ae81127207b 100644 --- a/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_OneRun.py +++ b/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_OneRun.py @@ -72,6 +72,7 @@ calibration_file_2 = params_dictionary.get('calibration_file_2', None) data_directory = params_dictionary[ "data_directory" ] output_directory = params_dictionary[ "output_directory" ] +output_nexus = params_dictionary.get( "output_nexus", False) min_tof = params_dictionary[ "min_tof" ] max_tof = params_dictionary[ "max_tof" ] use_monitor_counts = params_dictionary[ "use_monitor_counts" ] @@ -145,7 +146,10 @@ # Name the files to write for this run # run_niggli_matrix_file = output_directory + "/" + run + "_Niggli.mat" -run_niggli_integrate_file = output_directory + "/" + run + "_Niggli.integrate" +if output_nexus: + run_niggli_integrate_file = output_directory + "/" + run + "_Niggli.nxs" +else: + run_niggli_integrate_file = output_directory + "/" + run + "_Niggli.integrate" # # Load the run data and find the total monitor counts @@ -219,7 +223,10 @@ # see these partial results # SaveIsawUB( InputWorkspace=peaks_ws,Filename=run_niggli_matrix_file ) -SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, +if output_nexus: + SaveNexus( InputWorkspace=peaks_ws, Filename=run_niggli_integrate_file ) +else: + SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=run_niggli_integrate_file ) # @@ -327,7 +334,10 @@ # This is the only file needed, for the driving script to get a combined # result. # -SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, +if output_nexus: + SaveNexus( InputWorkspace=peaks_ws, Filename=run_niggli_integrate_file ) +else: + SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=run_niggli_integrate_file ) # Print warning if user is trying to integrate using the cylindrical method and transorm the cell @@ -342,13 +352,20 @@ if (not cell_type is None) and (not centering is None) : run_conventional_matrix_file = output_directory + "/" + run + "_" + \ cell_type + "_" + centering + ".mat" - run_conventional_integrate_file = output_directory + "/" + run + "_" + \ + if output_nexus: + run_conventional_integrate_file = output_directory + "/" + run + "_" + \ + cell_type + "_" + centering + ".nxs" + else: + run_conventional_integrate_file = output_directory + "/" + run + "_" + \ cell_type + "_" + centering + ".integrate" SelectCellOfType( PeaksWorkspace=peaks_ws,\ CellType=cell_type, Centering=centering,\ AllowPermutations=allow_perm,\ Apply=True, Tolerance=tolerance ) - SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False,\ + if output_nexus: + SaveNexus( InputWorkspace=peaks_ws, Filename=run_conventional_integrate_file ) + else: + SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False,\ Filename=run_conventional_integrate_file ) SaveIsawUB( InputWorkspace=peaks_ws, Filename=run_conventional_matrix_file ) diff --git a/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_Parallel.py b/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_Parallel.py index 16a978089c34..804358531b1d 100644 --- a/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_Parallel.py +++ b/Code/Mantid/scripts/SCD_Reduction/ReduceSCD_Parallel.py @@ -84,6 +84,7 @@ def run ( self ): exp_name = params_dictionary[ "exp_name" ] output_directory = params_dictionary[ "output_directory" ] +output_nexus = params_dictionary.get( "output_nexus", False) reduce_one_run_script = params_dictionary[ "reduce_one_run_script" ] slurm_queue_name = params_dictionary[ "slurm_queue_name" ] max_processes = int(params_dictionary[ "max_processes" ]) @@ -94,6 +95,7 @@ def run ( self ): centering = params_dictionary[ "centering" ] allow_perm = params_dictionary[ "allow_perm" ] run_nums = params_dictionary[ "run_nums" ] +data_directory = params_dictionary[ "data_directory" ] use_cylindrical_integration = params_dictionary[ "use_cylindrical_integration" ] instrument_name = params_dictionary[ "instrument_name" ] @@ -153,14 +155,44 @@ def run ( self ): # appending them to a combined output file. # niggli_name = output_directory + "/" + exp_name + "_Niggli" -niggli_integrate_file = niggli_name + ".integrate" +if output_nexus: + niggli_integrate_file = niggli_name + ".nxs" +else: + niggli_integrate_file = niggli_name + ".integrate" niggli_matrix_file = niggli_name + ".mat" first_time = True + +if output_nexus: + #Only need this for instrument for peaks_total + short_filename = "%s_%s_event.nxs" % (instrument_name, str(run_nums[0])) + if data_directory is not None: + full_name = data_directory + "/" + short_filename + else: + candidates = FileFinder.findRuns(short_filename) + full_name = "" + for item in candidates: + if os.path.exists(item): + full_name = str(item) + + if not full_name.endswith('nxs'): + print "Exiting since the data_directory was not specified and" + print "findnexus failed for event NeXus file: " + instrument_name + " " + str(run) + exit(0) + # + # Load the first data file to find instrument + # + wksp = LoadEventNexus( Filename=full_name, FilterByTofMin=0, FilterByTofMax=0 ) + peaks_total = CreatePeaksWorkspace(NumberOfPeaks=0, InstrumentWorkspace=wksp) + if not use_cylindrical_integration: for r_num in run_nums: - one_run_file = output_directory + '/' + str(r_num) + '_Niggli.integrate' - peaks_ws = LoadIsawPeaks( Filename=one_run_file ) + if output_nexus: + one_run_file = output_directory + '/' + str(r_num) + '_Niggli.nxs' + peaks_ws = Load( Filename=one_run_file ) + else: + one_run_file = output_directory + '/' + str(r_num) + '_Niggli.integrate' + peaks_ws = LoadIsawPeaks( Filename=one_run_file ) if first_time: if UseFirstLattice and not read_UB: # Find a UB (using FFT) for the first run to use in the FindUBUsingLatticeParameters @@ -171,17 +203,27 @@ def run ( self ): uc_alpha = peaks_ws.sample().getOrientedLattice().alpha() uc_beta = peaks_ws.sample().getOrientedLattice().beta() uc_gamma = peaks_ws.sample().getOrientedLattice().gamma() - SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=niggli_integrate_file ) - + if output_nexus: + peaks_total = CombinePeaksWorkspaces(LHSWorkspace=peaks_total, RHSWorkspace=peaks_ws) + SaveNexus( InputWorkspace=peaks_ws, Filename=niggli_integrate_file ) + else: + SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=niggli_integrate_file ) first_time = False else: - SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=True, Filename=niggli_integrate_file ) + if output_nexus: + peaks_total = CombinePeaksWorkspaces(LHSWorkspace=peaks_total, RHSWorkspace=peaks_ws) + SaveNexus( InputWorkspace=peaks_total, Filename=niggli_integrate_file ) + else: + SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=True, Filename=niggli_integrate_file ) # # Load the combined file and re-index all of the peaks together. # Save them back to the combined Niggli file (Or selcted UB file if in use...) # - peaks_ws = LoadIsawPeaks( Filename=niggli_integrate_file ) + if output_nexus: + peaks_ws = Load( Filename=niggli_integrate_file ) + else: + peaks_ws = LoadIsawPeaks( Filename=niggli_integrate_file ) # # Find a Niggli UB matrix that indexes the peaks in this run @@ -206,7 +248,10 @@ def run ( self ): FindUBUsingFFT( PeaksWorkspace=peaks_ws, MinD=min_d, MaxD=max_d, Tolerance=tolerance ) IndexPeaks( PeaksWorkspace=peaks_ws, Tolerance=tolerance ) - SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=niggli_integrate_file ) + if output_nexus: + SaveNexus( InputWorkspace=peaks_ws, Filename=niggli_integrate_file ) + else: + SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=niggli_integrate_file ) SaveIsawUB( InputWorkspace=peaks_ws, Filename=niggli_matrix_file ) # @@ -216,12 +261,18 @@ def run ( self ): if not use_cylindrical_integration: if (not cell_type is None) and (not centering is None) : conv_name = output_directory + "/" + exp_name + "_" + cell_type + "_" + centering - conventional_integrate_file = conv_name + ".integrate" + if output_nexus: + conventional_integrate_file = conv_name + ".nxs" + else: + conventional_integrate_file = conv_name + ".integrate" conventional_matrix_file = conv_name + ".mat" SelectCellOfType( PeaksWorkspace=peaks_ws, CellType=cell_type, Centering=centering,\ AllowPermutations=allow_perm, Apply=True, Tolerance=tolerance ) - SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=conventional_integrate_file ) + if output_nexus: + SaveNexus( InputWorkspace=peaks_ws, Filename=conventional_integrate_file ) + else: + SaveIsawPeaks( InputWorkspace=peaks_ws, AppendFile=False, Filename=conventional_integrate_file ) SaveIsawUB( InputWorkspace=peaks_ws, Filename=conventional_matrix_file ) if use_cylindrical_integration: From 44e535e69caa12d8b4ca5415711f4ce14efa052c Mon Sep 17 00:00:00 2001 From: Vickie Lynch Date: Thu, 26 Mar 2015 13:32:55 -0400 Subject: [PATCH 2/2] Refs #11229 nexus output/input for peaks in interface --- .../inc/MantidQtCustomInterfaces/MantidEV.h | 6 + .../inc/MantidQtCustomInterfaces/MantidEV.ui | 6615 +++++++++-------- .../MantidQtCustomInterfaces/MantidEVWorker.h | 8 + .../CustomInterfaces/src/MantidEV.cpp | 117 +- .../CustomInterfaces/src/MantidEVWorker.cpp | 61 +- 5 files changed, 3494 insertions(+), 3313 deletions(-) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.h index 2bb6f7f0130a..d521c6f5df8c 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.h @@ -310,6 +310,12 @@ private slots: /// Slot to load a peaks workspace to the current MantidEV named workspace void loadIsawPeaks_slot(); + /// Slot to save the current MantidEV peaks workspace + void saveNexusPeaks_slot(); + + /// Slot to load a peaks workspace to the current MantidEV named workspace + void loadNexusPeaks_slot(); + /// Slot to show the UB matrix void showUB_slot(); diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.ui index bffc3627533b..4906f166dbcb 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEV.ui @@ -20,3442 +20,3435 @@ SCD Event Data Reduction - - - - - - File - - - - - - - - - - - - View - - + + + + + + File + + + + + + + + + + + + + + View + + + + + + Help + + + + + + - - - Help + + + + + - - - - - - - - - - - - - - 3 - - - - - 0 - 0 - + + 1 - - Select Data - - - - - - true - - - - 0 - 0 - - - - - 0 - 0 - - - - - 0 - 0 - - - - QFrame::NoFrame - - - QFrame::Plain - - - 0 - - - Qt::ScrollBarAsNeeded - - - true - - - Qt::AlignCenter - - - - - 0 - 0 - 903 - 708 - + + + + 0 + 0 + + + + Select Data + + + + + + true + + + + 0 + 0 + - 500 - 500 + 0 + 0 + + + + + 0 + 0 - + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + Qt::ScrollBarAsNeeded + + true - - - - - QLayout::SetDefaultConstraint - - - - - Event Workspace Name - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 200 - 0 - - - - Name of the event workspace to use. This name is set by default,<br> if data is loaded from an event file and mapped to an MD workspace. - - - - - - - - - - - MD Workspace Name - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 200 - 0 - - - - Name of the MD workspace to use. This name is set<br>by default, if data is loaded from an event file and mapped to an MD workspace. - - - - - - - - - - 0 - 160 - - - - Not doing this will use existing workspace - - - Convert to MD - - - true - - - - - - QLayout::SetDefaultConstraint - - - - - - - Min |Q| to Map to MD - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - Specify value to use as bound on |Qx|, |Qy| and |Qz| - - - - - - - - - - - Max |Q| to Map to MD - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - Specify value to use as bound on |Qx|, |Qy| and |Qz| - - - - - - - - - Apply the Lorentz Correction as<br> data is mapped to reciprocal space and stored in the MD workspace. This helps with finding peaks with larger |Q|. - - - Apply Lorentz Correction - - - - + + Qt::AlignCenter + + + + + 0 + 0 + 903 + 696 + + + + + 500 + 500 + + + + true + + + + + + QLayout::SetDefaultConstraint + + + + + Event Workspace Name + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 200 + 0 + + + + Name of the event workspace to use. This name is set by default,<br> if data is loaded from an event file and mapped to an MD workspace. + + - - - - - - - 0 - 200 - - - - If disabled then use existing workspaces - - - Load Event Data - - - true - - - - - - QLayout::SetDefaultConstraint - - - - - - - Filename - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 400 - 0 - - - - Specify the name of the data file to load. Press<br> return to set default names for Event, MD and Peaks workspaces. - - - - - - - Browse for the event file to be loaded. - - - Browse - - - - - - - - - Optionally, apply<br> calibration information from the specified .DetCal file(s). - - - Load ISAW Detector Calibration - - - - - - - - - Filename - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 400 - 0 - - - - Select the .DetCal file to apply. - - - - - - - Browse for the first .DetCal file to be used. - - - Browse - - - - - - - - - - - Filename2 - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 400 - 0 - - - - Select the second .DetCal file for the second detector<br> panel on the SNAP instrument at the SNS. - - - - - - - Browse for the second .DetCal file to be used<br> for the second panel on SNAP. - - - Browse - - - - - - + + + + + + + MD Workspace Name + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 200 + 0 + + + + Name of the MD workspace to use. This name is set<br>by default, if data is loaded from an event file and mapped to an MD workspace. + + - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - QLayout::SetDefaultConstraint - - - - - Qt::Horizontal - - - - 40 - 0 - - - - - - - - Actually load the data and convert to MD, or just<br> proceed to the next tab using previously loaded data. - - - Apply - - - - - - + + + + + + 0 + 160 + + + + Not doing this will use existing workspace + + + Convert to MD + + + true + + + + + + QLayout::SetDefaultConstraint + + + + + + + Min |Q| to Map to MD + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + Specify value to use as bound on |Qx|, |Qy| and |Qz| + + + + + + + + + + + Max |Q| to Map to MD + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + Specify value to use as bound on |Qx|, |Qy| and |Qz| + + + + + + + + + Apply the Lorentz Correction as<br> data is mapped to reciprocal space and stored in the MD workspace. This helps with finding peaks with larger |Q|. + + + Apply Lorentz Correction + + + + + + + + + + + + + 0 + 200 + + + + If disabled then use existing workspaces + + + Load Event Data + + + true + + + + + + QLayout::SetDefaultConstraint + + + + + + + Filename + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 400 + 0 + + + + Specify the name of the data file to load. Press<br> return to set default names for Event, MD and Peaks workspaces. + + + + + + + Browse for the event file to be loaded. + + + Browse + + + + + + + + + Optionally, apply<br> calibration information from the specified .DetCal file(s). + + + Load ISAW Detector Calibration + + + + + + + + + Filename + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 400 + 0 + + + + Select the .DetCal file to apply. + + + + + + + Browse for the first .DetCal file to be used. + + + Browse + + + + + + + + + + + Filename2 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 400 + 0 + + + + Select the second .DetCal file for the second detector<br> panel on the SNAP instrument at the SNS. + + + + + + + Browse for the second .DetCal file to be used<br> for the second panel on SNAP. + + + Browse + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + QLayout::SetDefaultConstraint + + + + + Qt::Horizontal + + + + 40 + 0 + + + + + + + + Actually load the data and convert to MD, or just<br> proceed to the next tab using previously loaded data. + + + Apply + + + + + + + - - - - - - - Find Peaks - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - true - - - - - 0 - 0 - 903 - 708 - + + + + + + Find Peaks + + + + + + QFrame::NoFrame - - - - - - - Peaks Workspace Name - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Name of the peaks workspace to use. This name is set by default,<br> if data is loaded from an event file and mapped to an MD workspace on the Select Data tab. - - - - - - - - - Qt::Horizontal - - - - - - - Search through the MD workspace to find Bragg peaks. - - - Find Peaks - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Estimated Max of a,b,c - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Estimated maximum for real<br> space cell edge length in Angstroms. This is used to get an approximate lower bound on the possible distances between peaks. - - - 15 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 20 - - - - - - - - Number of Peaks to Find - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Maximum number of peaks to find. Boxes with progressively<br> lower local intensity will be tried, until the specified number of peaks is found, or until the intensity falls below the specified Min Intensity. - - - 50 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 20 - - - - - - - - Min Intensity(above ave) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Lower bound on the local intensity of MD boxes to consider as possible peaks, expressed as a multiple of the overall average intensity of the entire MD workspace region. Boxes with progressively<br> lower local intensity will be tried, until the specified number of peaks is found, or until the intensity falls below the specified Min Intensity. - - - 10000 - - - - - - - - - Use a peaks workspace with peaks that have been<br> been previously found, predicted, or loaded. - - - Use Existing Peaks Workspace - - - - - - - Load the peaks workspace from a file of peaks<br> that have been previously found or predicted. - - - Load ISAW Peaks (or Integrate) File - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 20 - - - - - - - - Filename - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Name of the peaks file that should be loaded. - - - - - - - Browse for the file of peaks to load. - - - Browse - - - - - - - - - Qt::Vertical - - - - 20 - 20 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Proceed to actually get the<br> peaks or use the existing peaks, as specified.. - - - Apply - - - - - - - - - - - - - - Find UB - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - true - - - - - 0 - 0 - 903 - 708 - + + QFrame::Plain - - - - - Find a UB matrix using the<br> FindUBUsingFFT algorithm. This will produce a UB matrix corresponding to the Niggli reduced cell for the lattice. - - - Find UB Using FFT - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Estimated Lower Bound for a,b,c - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Set this to a value that is<br> about 50%-90% of the shortest real space edge length, in Angstroms. - - - 3 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Estimated Upper Bound for a,b,c - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Set this to a value that is<br> about 110%-150% of the longest real space edge length, in Angstroms. - - - 15 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Tolerance - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Maximum distance of h,k or l from integer values to<br> consider a peak to be indexed. - - - 0.12 - - - - - - - - - Find the UB matrix using the FindUBUsingIndexedPeaks algorithm. Specifically, if the<br> peaks in the peaks workspace have already been indexed, find the UB matrix that corresponds to that indexing. - - - Find UB Using Indexed Peaks - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Tolerance - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Maximum distance of h,k or l from integer values to<br> consider a peak to be indexed. - - - 0.1 - - - - - - - - - Load the UB matrix from a file. - - - Load Isaw UB - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Filename - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - Name of the file with the UB matrix. - - - - - - - Browse for the file with the UB matrix. - - - Browse - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Optimize the goniometer<br> angles, to index the peaks as accurately as possible using the UB matrix that was loaded. - - - Optimize Phi, Chi and Omega - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Maximum Change (degrees) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Maximum number of degrees that CHI, PHI<br> or OMEGA can be changed. - - - 5 - - - - - - - - - - - If the peaks workspace<br> already has a UB matrix, just use that UB. - - - Use Current UB (if already found or loaded) - - - - - - - - - Qt::Horizontal - - - - - - - - - After obtaining the UB<br> matrix, index the peaks using that UB. - - - Index Peaks Using UB - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Indexing Tolerance - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Only set the h,k,l values on peaks for which the maximum distance of h,k or l from integer values<br> is less than this tolerance. - - - 0.12 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Round the h,k,l values to the nearest integer. - - - Round HKLs - - - - - - - - - Predict Peaks - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - - 160 - 16777215 - - - - Minimum wavelength - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 146 - 0 - - - - - 146 - 16777215 - - - - 0.4 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - - 160 - 16777215 - - - - Maximum wavelength - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 146 - 16777215 - - - - 3.5 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - - 160 - 16777215 - - - - Minimum d-spacing - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 146 - 16777215 - - - - 0.4 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - - 160 - 16777215 - - - - Maximum d-spacing - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 146 - 16777215 - - - - 8.5 - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Proceed to actually get the<br> UB matrix and (optionally) index the peaks. - - - Apply - - - - - - - - - - - - - - Choose Cell - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - true - - - - - 0 - 0 - 903 - 708 - + + true - - - - - Show a list of the possible<br> conventional cells in the MantidPlot Results Log window. NOTE: The current UB must correspond to a Niggli reduced cell for these to be valid. - - - Show Possible Cells - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Max Scalar Error - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Maximum error allowed in the cell<br> scalars. If this is set very large, all possible conventional cells will be shown, including those that don't really match the current cell. If this is set too small, the desired correct cell may be missing from the list due to experimental error. The default value of 0.2 should usually work. - - - 0.2 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Only show the best fitting<br> cell for each cell type and centering that is in the list of possible cells. - - - Best Only - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Allow permutations of conventional cells. - - - Allow Permutations - - - - - - - - - Transform the current UB<br> matrix and indexing to correspond to the best fitting cell with the specified cell-type and centering. - - - Select Cell of Type - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - The cell-type to be used. - - + + + + 0 + 0 + 903 + 696 + + + + + + + + + Peaks Workspace Name + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Name of the peaks workspace to use. This name is set by default,<br> if data is loaded from an event file and mapped to an MD workspace on the Select Data tab. + + + + + + + + + Qt::Horizontal + + + + + + + Search through the MD workspace to find Bragg peaks. + + + Find Peaks + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Estimated Max of a,b,c + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Estimated maximum for real<br> space cell edge length in Angstroms. This is used to get an approximate lower bound on the possible distances between peaks. + + + 15 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 20 + + + + + + + + Number of Peaks to Find + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Maximum number of peaks to find. Boxes with progressively<br> lower local intensity will be tried, until the specified number of peaks is found, or until the intensity falls below the specified Min Intensity. + + + 50 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 20 + + + + + + + + Min Intensity(above ave) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Lower bound on the local intensity of MD boxes to consider as possible peaks, expressed as a multiple of the overall average intensity of the entire MD workspace region. Boxes with progressively<br> lower local intensity will be tried, until the specified number of peaks is found, or until the intensity falls below the specified Min Intensity. + + + 10000 + + + + + + + + + Use a peaks workspace with peaks that have been<br> been previously found, predicted, or loaded. + + + Use Existing Peaks Workspace + + + + + + + Load the peaks workspace from a file of peaks<br> that have been previously found or predicted. + + + Load ISAW Peaks (or Integrate or Nexus) File + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 20 + + + + + + + + Filename + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Name of the peaks file that should be loaded. + + + + + + + Browse for the file of peaks to load. + + + Browse + + + + + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Proceed to actually get the<br> peaks or use the existing peaks, as specified.. + + + Apply + + + + + + + + + + + + + + Find UB + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + true + + + + + 0 + 0 + 903 + 696 + + + + + + + Find a UB matrix using the<br> FindUBUsingFFT algorithm. This will produce a UB matrix corresponding to the Niggli reduced cell for the lattice. + + + Find UB Using FFT + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Estimated Lower Bound for a,b,c + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Set this to a value that is<br> about 50%-90% of the shortest real space edge length, in Angstroms. + + + 3 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Estimated Upper Bound for a,b,c + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Set this to a value that is<br> about 110%-150% of the longest real space edge length, in Angstroms. + + + 15 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Tolerance + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Maximum distance of h,k or l from integer values to<br> consider a peak to be indexed. + + + 0.12 + + + + + + + + + Find the UB matrix using the FindUBUsingIndexedPeaks algorithm. Specifically, if the<br> peaks in the peaks workspace have already been indexed, find the UB matrix that corresponds to that indexing. + + + Find UB Using Indexed Peaks + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Tolerance + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Maximum distance of h,k or l from integer values to<br> consider a peak to be indexed. + + + 0.1 + + + + + + + + + Load the UB matrix from a file. + + + Load Isaw UB + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Filename + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + Name of the file with the UB matrix. + + + + + + + Browse for the file with the UB matrix. + + + Browse + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Optimize the goniometer<br> angles, to index the peaks as accurately as possible using the UB matrix that was loaded. + + + Optimize Phi, Chi and Omega + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Maximum Change (degrees) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Maximum number of degrees that CHI, PHI<br> or OMEGA can be changed. + + + 5 + + + + + + + + + + + If the peaks workspace<br> already has a UB matrix, just use that UB. + + + Use Current UB (if already found or loaded) + + + + + + + + + Qt::Horizontal + + + + + + + + + After obtaining the UB<br> matrix, index the peaks using that UB. + + + Index Peaks Using UB + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Indexing Tolerance + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Only set the h,k,l values on peaks for which the maximum distance of h,k or l from integer values<br> is less than this tolerance. + + + 0.12 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Round the h,k,l values to the nearest integer. + + + Round HKLs + + + + + + + + + Predict Peaks + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + + 160 + 16777215 + + + + Minimum wavelength + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 146 + 0 + + + + + 146 + 16777215 + + + + 0.4 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + + 160 + 16777215 + + + + Maximum wavelength + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 146 + 16777215 + + + + 3.5 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + + 160 + 16777215 + + + + Minimum d-spacing + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 146 + 16777215 + + + + 0.4 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + + 160 + 16777215 + + + + Maximum d-spacing + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 146 + 16777215 + + + + 8.5 + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Proceed to actually get the<br> UB matrix and (optionally) index the peaks. + + + Apply + + + + + + + + + + + + + + Choose Cell + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + true + + + + + 0 + 0 + 903 + 696 + + + + + + + Show a list of the possible<br> conventional cells in the MantidPlot Results Log window. NOTE: The current UB must correspond to a Niggli reduced cell for these to be valid. + + + Show Possible Cells + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Max Scalar Error + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Maximum error allowed in the cell<br> scalars. If this is set very large, all possible conventional cells will be shown, including those that don't really match the current cell. If this is set too small, the desired correct cell may be missing from the list due to experimental error. The default value of 0.2 should usually work. + + + 0.2 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Only show the best fitting<br> cell for each cell type and centering that is in the list of possible cells. + + + Best Only + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Allow permutations of conventional cells. + + + Allow Permutations + + + + + + + + + Transform the current UB<br> matrix and indexing to correspond to the best fitting cell with the specified cell-type and centering. + + + Select Cell of Type + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + The cell-type to be used. + + + + Cubic + + + + + Hexagonal + + + + + Monoclinic + + + + + Orthorhombic + + + + + Rhombohedral + + + + + Tetragonal + + + + + Triclinic + + + + + + + + The centering to be used. + + + + C + + + + + F + + + + + I + + + + + P + + + + + R + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Transform the current UB<br> matrix and indexing to correspond to the cell with the specified Form number, as shown in the list of possible cells. + + + Select Cell With Form + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + The Form number of the<br> desired conventional cell. + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + + + + 8 + + + + + 9 + + + + + 10 + + + + + 11 + + + + + 12 + + + + + 13 + + + + + 14 + + + + + 15 + + + + + 16 + + + + + 17 + + + + + 18 + + + + + 19 + + + + + 20 + + + + + 21 + + + + + 22 + + + + + 23 + + + + + 24 + + + + + 25 + + + + + 26 + + + + + 27 + + + + + 28 + + + + + 29 + + + + + 30 + + + + + 31 + + + + + 32 + + + + + 33 + + + + + 34 + + + + + 35 + + + + + 36 + + + + + 37 + + + + + 38 + + + + + 39 + + + + + 40 + + + + + 41 + + + + + 42 + + + + + 43 + + + + + 44 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Proceed to show the<br> possible cells, or change the UB matrix and indexing, according to the options selected. + - Cubic + Apply + + + + + + + + + + + + + + Change HKL + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + true + + + + + 0 + 0 + 903 + 696 + + + + + + + + + Transform the UB matrix<br> and peak indexes using the specified 3X3 matrix. - - - Hexagonal + Specify 3x3 Matrix to Apply to HKL - - + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + - Monoclinic + HKL Transformation, Row 1 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + First row of the<br> transformation matrix to apply the HKL indexes. - - - Orthorhombic + 1, 0, 0 - - + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + - Rhombohedral + HKL Transformation, Row 2 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Second row of the<br> transformation matrix to apply the HKL indexes. - - - Tetragonal + 0, 1, 0 - - + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + - Triclinic + HKL Transformation, Row 3 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Third row of the<br> transformation matrix to apply the HKL indexes. - - - - - - - The centering to be used. - - - C + 0, 0, 1 + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Use the specified matrix<br> to update the peak indexes and UB matrix. - - - F + Apply - - + + + + + + + + + + + + + Integrate + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + true + + + + + 0 + 0 + 903 + 696 + + + + + + + Apply the IntegratePeaksMD<br> algorithm to integrate the current list of peaks, using spherical regions around the peaks in reciprocal space. This is the fastest of the integration methods. See the algorithm documentation for more details. + + + Spherical or Cylindrical Integration + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + - I + Peak Radius (A^-1) + + + + + + + + 0 + 0 + + + + Radius of the spherical<br> region that will be considered the body of the peak. - - - P + 0.20 - - + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + - R + Background Inner Radius (A^-1) + + + + + + + + 0 + 0 + + + + Radius of the inner surface<br> of the spherical shell that will be used for the background estimate. - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Transform the current UB<br> matrix and indexing to correspond to the cell with the specified Form number, as shown in the list of possible cells. - - - Select Cell With Form - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - The Form number of the<br> desired conventional cell. - - - 1 + 0.20 - - + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + - 2 + Background Outer Radius (A^-1) + + + + + + + + 0 + 0 + + + + Radius of the outer surface<br> of the spherical shell that will be used for the background estimate. - - - 3 + 0.25 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + If true, all peaks will be<br> integrated. If false, any peak for which the background shell goes off the edge of the detector will not be integrated. - - - 4 + Integrate if on Edge + + + + + + + If true, cylinder instead of sphere.. - - - 5 + Integrate with cylinder - - + + + + + + Fit cylinder profile with function + + + + BackToBackExponential + + + + + Bk2BKExpConvPV + + + + + DeltaFunction + + + + + ElasticDiffSphere + + + + + ExamplePeakFunction + + + + + Gaussian + + + + + IkedaCarpenterPV + + + + + Lorentzian + + + + + NoFit + + + + + Voigt + + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + - 6 + Cylinder Length (A^-1) + + + + + + + + 0 + 0 + + + + Length of the cylinder used for integration. - - - 7 + 0.4 - - + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + - 8 + Percent of cylinder length that is background. - - + + + + + + + 0 + 0 + + + + Radius of the outer surface<br> of the spherical shell that will be used for the background estimate. + + + 0.25 + + + + + + + + + Apply the PeakIntegration<br> algorithm to integrate the current list of peaks, by combining the integrated intensities on multiple time-of-flight slices. This method is much slower than the Spherical Integration method, so please allow time for the calculation to complete. See the algorithm documentation for more details. + + + 2-D Fitting Integration + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + - 9 + Rebin Parameters + + + + + + + + 0 + 0 + + + + Parameters used to form<br> histograms from the event data. The first and last values are the start and end times-of-flight. The middle value is the step size. If the step size is negative it represents the decimal fraction increase in the bin boundary at each step, instead of the actual bin size. + + + 1000,-0.004,16000 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + Number of Bad Edge Pixels + + + + + + + + 0 + 0 + + + + The width of the border of<br> bad pixels around the edge of each detector that should be omitted. + + + 5 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 15 + 0 + + + + + + + + If true, the Ikeda-Carpenter<br> function will be used to fit the results of integrating the various time-of-flight slices, to obtain the final integrated result. - - - 10 + Ikeda-Carpenter TOF - - - - 11 + + + + + + + + Apply the IntegrateEllipsoids<br> algorithm to integrate the current list of peaks, by finding the principal axes of the 3D events in regions around each peak. This method is a little slower than the Spherical Integration method. See the algorithm documentation for more details. + + + Ellipsoidal Integration (Integer HKL only) + + + + + + + + + Qt::Horizontal - - - - 12 + + QSizePolicy::Fixed - - - - 13 + + + 15 + 0 + - - + + + + - 14 + Region Radius (A^-1) - - - - 15 + + + + + + + 0 + 0 + - - - - 16 + + Radius of a spherical region<br> around each peak that will be used when finding the principal axes. This should be large enough to include the entire peak and nearby background region, but not much larger. - - - 17 + 0.25 - - - - 18 + + + + + + + + + + Qt::Horizontal - - - - 19 + + QSizePolicy::Fixed - - - - 20 + + + 15 + 0 + - - - - 21 + + + + + + If this is set true, the major axis<br> size of each ellipsoidal region will be constant for all peaks, and will be set by the following three parameters. If this is set false, the major axis sizes will be calculated based on the standard deviation in the direction of the major axis. - - - 22 + Specify Size - - - - 23 + + + + + + + + + + Qt::Horizontal - - - - 24 + + QSizePolicy::Fixed - - - - 25 + + + 40 + 0 + - - + + + + - 26 + Peak Size (A^-1) - - - - 27 + + + + + + + 0 + 0 + - - - - 28 + + Length of the major axis<br> to use for the ellipsoidal peak region. - - - 29 + 0.20 - - - - 30 + + + + + + + + + + Qt::Horizontal - - - - 31 + + QSizePolicy::Fixed - - - - 32 + + + 40 + 0 + - - + + + + - 33 + Background Inner Size (A^-1) - - - - 34 + + + + + + + 0 + 0 + - - - - 35 + + Length of the major axis<br> of the inner surface of the ellipsoidal shell used for the background region. - - - 36 + 0.20 - - - - 37 + + + + + + + + + + Qt::Horizontal - - - - 38 + + QSizePolicy::Fixed - - - - 39 + + + 40 + 0 + - - + + + + - 40 + Background Outer Size (A^-1) - - - - 41 + + + + + + + 0 + 0 + - - - - 42 + + Length of the major axis<br> of the outer surface of the ellipsoidal shell used for the background region. - - - 43 + 0.25 + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Proceed to actually do the peak integration as specified. - - - 44 + Apply - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Proceed to show the<br> possible cells, or change the UB matrix and indexing, according to the options selected. - - - Apply - - - - - - + + + + + + - - - - - - - Change HKL - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - true - - - - - 0 - 0 - 903 - 708 - + + + + + + Point Info + + + + + + Selected Point Info - - - - - - - Transform the UB matrix<br> and peak indexes using the specified 3X3 matrix. - - - Specify 3x3 Matrix to Apply to HKL - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - HKL Transformation, Row 1 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - First row of the<br> transformation matrix to apply the HKL indexes. - - - 1, 0, 0 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - HKL Transformation, Row 2 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Second row of the<br> transformation matrix to apply the HKL indexes. - - - 0, 1, 0 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - HKL Transformation, Row 3 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Third row of the<br> transformation matrix to apply the HKL indexes. - - - 0, 0, 1 - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Use the specified matrix<br> to update the peak indexes and UB matrix. - - - Apply - - - - + - - - - - - - - - Integrate - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - true - - - - - 0 - 0 - 903 - 708 - - - - - - Apply the IntegratePeaksMD<br> algorithm to integrate the current list of peaks, using spherical regions around the peaks in reciprocal space. This is the fastest of the integration methods. See the algorithm documentation for more details. - - - Spherical or Cylindrical Integration + + + Specify Qx Qy Qz - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Peak Radius (A^-1) - - - - - - - - 0 - 0 - - - - Radius of the spherical<br> region that will be considered the body of the peak. - - - 0.20 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Background Inner Radius (A^-1) - - - - - - - - 0 - 0 - - - - Radius of the inner surface<br> of the spherical shell that will be used for the background estimate. - - - 0.20 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Background Outer Radius (A^-1) - - - - - - - - 0 - 0 - - - - Radius of the outer surface<br> of the spherical shell that will be used for the background estimate. - - - 0.25 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - If true, all peaks will be<br> integrated. If false, any peak for which the background shell goes off the edge of the detector will not be integrated. - - - Integrate if on Edge - - - - - - - If true, cylinder instead of sphere.. - - - Integrate with cylinder - - - - - - - Fit cylinder profile with function - - - - BackToBackExponential - - - - - Bk2BKExpConvPV - - - - - DeltaFunction + + + + + The X-coordinate of a point<br> of interest in reciprocal space specified in lab coordinates. - - - ElasticDiffSphere + 0.0 - - - - ExamplePeakFunction + + + + + + The Y-coordinate of a point<br> of interest in reciprocal space specified in lab coordinates. - - - Gaussian + 0.0 - - - - IkedaCarpenterPV + + + + + + The Z-coordinate of a point<br> of interest in reciprocal space specified in lab coordinates. - - - Lorentzian + 0.0 - - - - NoFit + + + + + + Press this after entering<br> Qx,Qy,Qz in lab coordinates to display information about that point in the Selected Point Info table. - - - Voigt + Show Info - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Cylinder Length (A^-1) - - - - - - - - 0 - 0 - - - - Length of the cylinder used for integration. - - - 0.4 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Percent of cylinder length that is background. - - - - - - - - 0 - 0 - - - - Radius of the outer surface<br> of the spherical shell that will be used for the background estimate. - - - 0.25 - - - - - - - - - Apply the PeakIntegration<br> algorithm to integrate the current list of peaks, by combining the integrated intensities on multiple time-of-flight slices. This method is much slower than the Spherical Integration method, so please allow time for the calculation to complete. See the algorithm documentation for more details. - - - 2-D Fitting Integration - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Rebin Parameters - - - - - - - - 0 - 0 - - - - Parameters used to form<br> histograms from the event data. The first and last values are the start and end times-of-flight. The middle value is the step size. If the step size is negative it represents the decimal fraction increase in the bin boundary at each step, instead of the actual bin size. - - - 1000,-0.004,16000 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Number of Bad Edge Pixels - - - - - - - - 0 - 0 - - - - The width of the border of<br> bad pixels around the edge of each detector that should be omitted. - - - 5 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - If true, the Ikeda-Carpenter<br> function will be used to fit the results of integrating the various time-of-flight slices, to obtain the final integrated result. - - - Ikeda-Carpenter TOF - - - - - - - - - Apply the IntegrateEllipsoids<br> algorithm to integrate the current list of peaks, by finding the principal axes of the 3D events in regions around each peak. This method is a little slower than the Spherical Integration method. See the algorithm documentation for more details. - - - Ellipsoidal Integration (Integer HKL only) - + + + - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - Region Radius (A^-1) - - - - - - - - 0 - 0 - - - - Radius of a spherical region<br> around each peak that will be used when finding the principal axes. This should be large enough to include the entire peak and nearby background region, but not much larger. - - - 0.25 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 15 - 0 - - - - - - - - If this is set true, the major axis<br> size of each ellipsoidal region will be constant for all peaks, and will be set by the following three parameters. If this is set false, the major axis sizes will be calculated based on the standard deviation in the direction of the major axis. - - - Specify Size - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 0 - - - - - - - - Peak Size (A^-1) - - - - - - - - 0 - 0 - - - - Length of the major axis<br> to use for the ellipsoidal peak region. - - - 0.20 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 0 - - - - - - - - Background Inner Size (A^-1) - - - - - - - - 0 - 0 - - - - Length of the major axis<br> of the inner surface of the ellipsoidal shell used for the background region. - - - 0.20 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 0 - - - - - - - - Background Outer Size (A^-1) - - - - - - - - 0 - 0 - - - - Length of the major axis<br> of the outer surface of the ellipsoidal shell used for the background region. - - - 0.25 - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Proceed to actually do the peak integration as specified. - - - Apply - - - - - - - - - - - - Point Info - - - - - - Selected Point Info - - - - - - - - - Specify Qx Qy Qz - - - - - - The X-coordinate of a point<br> of interest in reciprocal space specified in lab coordinates. - - - 0.0 - - - - - - - The Y-coordinate of a point<br> of interest in reciprocal space specified in lab coordinates. - - - 0.0 - - - - - - - The Z-coordinate of a point<br> of interest in reciprocal space specified in lab coordinates. - - - 0.0 - - - - - - - Press this after entering<br> Qx,Qy,Qz in lab coordinates to display information about that point in the Selected Point Info table. - - - Show Info - - - - - - - - - - + + + - - - - - - - - 0 - 0 - 3 - 27 - - + + + Save Settings @@ -3529,6 +3522,16 @@ Online Help Page + + + Save Nexus Peaks + + + + + Load Nexus Peaks + + diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEVWorker.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEVWorker.h index af3a2a596b9f..5f92a905fa2e 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEVWorker.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MantidEVWorker.h @@ -95,11 +95,19 @@ class DLLExport MantidEVWorker bool loadIsawPeaks( const std::string & peaks_ws_name, const std::string & file_name ); + bool loadNexusPeaks( const std::string & peaks_ws_name, + const std::string & file_name ); + /// Save the peaks workspace to a .peaks or .integrate file bool saveIsawPeaks( const std::string & peaks_ws_name, const std::string & file_name, bool append ); + /// Save the peaks workspace to a .nxs file + bool saveNexusPeaks( const std::string & peaks_ws_name, + const std::string & file_name, + bool append ); + /// Index the peaks using the FFT method bool findUBUsingFFT( const std::string & peaks_ws_name, double min_abc, diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp index 12e730113c93..ab5077ba1421 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "MantidQtCustomInterfaces/MantidEV.h" #include "MantidAPI/AlgorithmManager.h" @@ -319,6 +320,12 @@ void MantidEV::initLayout() QObject::connect( m_uiForm.actionLoad_Isaw_Peaks, SIGNAL(triggered()), this, SLOT(loadIsawPeaks_slot()) ); + QObject::connect( m_uiForm.actionSave_Nexus_Peaks, SIGNAL(triggered()), + this, SLOT(saveNexusPeaks_slot()) ); + + QObject::connect( m_uiForm.actionLoad_Nexus_Peaks, SIGNAL(triggered()), + this, SLOT(loadNexusPeaks_slot()) ); + QObject::connect( m_uiForm.actionShow_UB, SIGNAL(triggered()), this, SLOT(showUB_slot()) ); @@ -765,15 +772,22 @@ void MantidEV::findPeaks_slot() else if ( load_peaks ) { std::string file_name = m_uiForm.SelectPeaksFile_ledt->text().trimmed().toStdString(); + std::string extension = Poco::Path(file_name).getExtension(); if ( file_name.length() == 0 ) { errorMessage("Specify a peaks file with the peaks to be loaded."); return; } - - if ( !worker->loadIsawPeaks( peaks_ws_name, file_name ) ) - { - errorMessage("Could not load requested peaks file"); + if (extension.compare("nxs") == 0 || extension.compare("h5") == 0){ + if ( !worker->loadNexusPeaks( peaks_ws_name, file_name ) ){ + errorMessage("Could not load requested peaks file"); + } + } + else { + if ( !worker->loadIsawPeaks( peaks_ws_name, file_name ) ) + { + errorMessage("Could not load requested NeXus file"); + } } } } @@ -788,7 +802,7 @@ void MantidEV::getLoadPeaksFileName_slot() QString Qfile_name = QFileDialog::getOpenFileName( this, tr("Load peaks file"), file_path, - tr("Peaks Files (*.peaks *.integrate);; All files(*.*)")); + tr("Peaks Files (*.peaks *.integrate *.nxs *.h5);; All files(*.*)")); if ( Qfile_name.length()> 0 ) { @@ -808,7 +822,7 @@ void MantidEV::getSavePeaksFileName() QString Qfile_name = QFileDialog::getSaveFileName( this, tr("Save peaks file"), file_path, - tr("Peaks Files (*.peaks *.integrate);; All files(*.*) "), + tr("Peaks Files (*.peaks *.integrate *.nxs *.h5);; All files(*.*)"), 0, QFileDialog::DontConfirmOverwrite ); if ( Qfile_name.length() > 0 ) @@ -1495,6 +1509,67 @@ void MantidEV::saveIsawPeaks_slot() } } +/** + * Slot called when the Save Nexus Peaks action is selected from the File menu. + */ +void MantidEV::saveNexusPeaks_slot() +{ + std::string peaks_ws_name = m_uiForm.PeaksWorkspace_ledt->text().trimmed().toStdString(); + if ( peaks_ws_name.length() == 0 ) + { + errorMessage("Specify a peaks workspace name on the Find Peaks tab."); + return; + } + + getSavePeaksFileName(); + + std::string file_name = m_uiForm.SelectPeaksFile_ledt->text().trimmed().toStdString(); + if ( file_name.length() == 0 ) + { + errorMessage("Specify a peaks file name for saving the peaks workspace."); + return; + } + else + { + // if the file exists, check for overwrite or append + bool append = false; + QFile peaks_file( QString::fromStdString( file_name ) ); + if ( peaks_file.exists() ) + { + QMessageBox message_box( this->window() ); + message_box.setText( tr("File Exists") ); + message_box.setInformativeText("Replace file, or append peaks to file?"); + QAbstractButton *replace_btn = message_box.addButton( tr("Replace"), QMessageBox::NoRole ); + QAbstractButton *append_btn = message_box.addButton( tr("Append"), QMessageBox::YesRole ); + message_box.setIcon( QMessageBox::Question ); + // it should not be necessary to do the next + // four lines, but without them the message box + // appears at random locations on RHEL 6 + message_box.show(); + QSize box_size = message_box.sizeHint(); + QRect screen_rect = QDesktopWidget().screen()->rect(); + message_box.move( QPoint( screen_rect.width()/2 - box_size.width()/2, + screen_rect.height()/2 - box_size.height()/2 ) ); + message_box.exec(); + + if ( message_box.clickedButton() == append_btn ) + { + append = true; + } + else if ( message_box.clickedButton() == replace_btn ) // no strictly needed, but clearer + { + append = false; + } + } + + if ( !worker->saveNexusPeaks( peaks_ws_name, file_name, append ) ) + { + errorMessage( "Failed to save peaks to file" ); + return; + } + } +} + /** * Slot called when the Load Isaw Peaks action is selected from the File menu. @@ -1526,6 +1601,36 @@ void MantidEV::loadIsawPeaks_slot() } } +/** + * Slot called when the Load Nexus Peaks action is selected from the File menu. + */ +void MantidEV::loadNexusPeaks_slot() +{ + std::string peaks_ws_name = m_uiForm.PeaksWorkspace_ledt->text().trimmed().toStdString(); + if ( peaks_ws_name.length() == 0 ) + { + errorMessage("Specify a peaks workspace name on the Find Peaks tab."); + return; + } + + getLoadPeaksFileName_slot(); + + std::string file_name = m_uiForm.SelectPeaksFile_ledt->text().trimmed().toStdString(); + if ( file_name.length() == 0 ) + { + errorMessage("Select a peaks file to be loaded."); + return; + } + else + { + if ( !worker->loadNexusPeaks( peaks_ws_name, file_name ) ) + { + errorMessage( "Failed to Load Peaks File" ); + return; + } + } +} + /** * Slot called when the Show UB action is selected from the View menu. diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEVWorker.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEVWorker.cpp index 0cba832b97f1..6200f7641430 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEVWorker.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEVWorker.cpp @@ -397,9 +397,31 @@ bool MantidEVWorker::loadIsawPeaks( const std::string & peaks_ws_name, return false; } +/** + * Load the specified peaks workspace from the specified NeXus file. + * + * @param peaks_ws_name The name of the peaks workspace to load/create. + * @param file_name The name of the NeXus file to load. + * + * @return true if LoadNexusPeaks completed successfully. + */ +bool MantidEVWorker::loadNexusPeaks( const std::string & peaks_ws_name, + const std::string & file_name ) +{ + + IAlgorithm_sptr alg = AlgorithmManager::Instance().create("Load"); + alg->setProperty("Filename",file_name ); + + alg->setProperty("OutputWorkspace", peaks_ws_name ); + + if ( alg->execute() ) + return true; + + return false; +} /** - * Load the specified peaks workspace to the specified peaks file. + * Save the specified peaks workspace to the specified peaks file. * * @param peaks_ws_name The name of the peaks workspace to save. * @param file_name The name of the peaks file to write to. @@ -425,6 +447,43 @@ bool MantidEVWorker::saveIsawPeaks( const std::string & peaks_ws_name, return false; } +/** + * Save the specified peaks workspace to the specified peaks file. + * + * @param peaks_ws_name The name of the peaks workspace to save. + * @param file_name The name of the NeXus file to write to. + * + * @return true if SaveNexusPeaks completed successfully. + */ +bool MantidEVWorker::saveNexusPeaks( const std::string & peaks_ws_name, + const std::string & file_name, + bool append ) +{ + if (append){ + std::string temp_peaks_ws_name = "__MantidEVWorker_peaks_ws"; + IAlgorithm_sptr load = AlgorithmManager::Instance().create("Load"); + load->setProperty("OutputWorkspace", temp_peaks_ws_name ); + load->setProperty("Filename",file_name ); + + load->execute(); + + IAlgorithm_sptr combine = AlgorithmManager::Instance().create("CombinePeaksWorkspaces"); + combine->setProperty("LHSWorkspace", temp_peaks_ws_name ); + combine->setProperty("RHSWorkspace", peaks_ws_name ); + combine->setProperty("OutputWorkspace", peaks_ws_name ); + + combine->execute(); + } + IAlgorithm_sptr alg = AlgorithmManager::Instance().create("SaveNexus"); + alg->setProperty("InputWorkspace", peaks_ws_name ); + alg->setProperty("Filename",file_name ); + + if ( alg->execute() ) + return true; + + return false; +} + /** * Find an optimized UB matrix that indexes the peaks in the specified