Skip to content
Snippets Groups Projects
Powder_Diffraction_Reduction.py 1.2 KiB
Newer Older
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
#     NScD Oak Ridge National Laboratory, European Spallation Source
#     & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
#pylint: disable=invalid-name
"""
    Script used to start the DGS reduction GUI from MantidPlot
"""
from __future__ import (absolute_import, division, print_function)
from reduction_application import ReductionGUI

reducer = ReductionGUI(instrument_list=["PG3", "NOM", "VULCAN"])
if reducer.setup_layout(load_last=True):

    # Set up reduction configuration from previous usage
    try:
        # Find home dir
        homedir = os.path.expanduser("~")
        mantidconfigdir = os.path.join(homedir, ".mantid")
        autopath = os.path.join(mantidconfigdir, 'snspowderreduction.xml')
        # Load configuration
        reducer.open_file(autopath)
    except IOError as e:
        print("[Error] Unable to load previously reduction setup from file %s.\nReason: %s." % (
            autopath, str(e)))
        print("[Info] Load earlier reduction setup from auto-saved %s." % (autopath))
    reducer.show()