Skip to content
Snippets Groups Projects
Powder_Diffraction_Reduction.py 880 B
Newer Older
#pylint: disable=invalid-name
"""
    Script used to start the DGS reduction GUI from MantidPlot
"""
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." % (
    else:
        print "[Info] Load earlier reduction setup from auto-saved %s." % (autopath)

    # Show GUI
    reducer.show()