示例#1
0
class _MockInst(AbstractInst):

    _param_map = [
        ParamMapEntry(ext_name="cal_dir", int_name="calibration_dir"),
        ParamMapEntry(ext_name="cal_map", int_name="cal_mapping_path"),
        ParamMapEntry(ext_name="file_ext",
                      int_name="file_extension",
                      optional=True),
        ParamMapEntry(ext_name="group_file", int_name="grouping_file_name"),
        ParamMapEntry(ext_name="out_dir", int_name="output_dir"),
        ParamMapEntry(ext_name="suffix", int_name="suffix", optional=True),
        ParamMapEntry(ext_name="user_name", int_name="user_name")
    ]
    _advanced_config = {"user_name": "ISISPowderAbstractInstrumentTest"}
    INST_PREFIX = "MOCK"

    def __init__(self, **kwargs):
        self._inst_settings = InstrumentSettings(
            param_map=self._param_map,
            adv_conf_dict=self._advanced_config,
            kwargs=kwargs)

        super(_MockInst, self).__init__(
            user_name=self._inst_settings.user_name,
            calibration_dir=self._inst_settings.calibration_dir,
            output_dir=self._inst_settings.output_dir,
            inst_prefix=self.INST_PREFIX)
示例#2
0
from __future__ import (absolute_import, division, print_function)

from isis_powder.routines.param_map_entry import ParamMapEntry
from isis_powder.routines.common_enums import INPUT_BATCHING
from isis_powder.polaris_routines.polaris_enums import POLARIS_CHOPPER_MODES

#                 Maps friendly user name (ext_name) -> script name (int_name)
attr_mapping = \
    [
     ParamMapEntry(ext_name="calibration_directory",       int_name="calibration_dir"),
     ParamMapEntry(ext_name="calibration_mapping_file",    int_name="cal_mapping_path"),
     ParamMapEntry(ext_name="config_file",                 int_name="config_file"),
     ParamMapEntry(ext_name="do_absorb_corrections",       int_name="do_absorb_corrections"),
     ParamMapEntry(ext_name="do_van_normalisation",        int_name="do_van_normalisation"),
     ParamMapEntry(ext_name="file_ext",                    int_name="file_extension", optional=True),
     ParamMapEntry(ext_name="first_cycle_run_no",          int_name="run_in_range"),
     ParamMapEntry(ext_name="focused_cropping_values",     int_name="focused_cropping_values"),
     ParamMapEntry(ext_name="focused_bin_widths",          int_name="focused_bin_widths"),
     ParamMapEntry(ext_name="grouping_file_name",          int_name="grouping_file_name"),
     ParamMapEntry(ext_name="input_mode",                  int_name="input_mode", enum_class=INPUT_BATCHING),
     ParamMapEntry(ext_name="merge_banks",                 int_name="merge_banks"),
     ParamMapEntry(ext_name="mode",                        int_name="mode", enum_class=POLARIS_CHOPPER_MODES),
     ParamMapEntry(ext_name="multiple_scattering",         int_name="multiple_scattering", optional=True),
     ParamMapEntry(ext_name="raw_data_cropping_values",    int_name="raw_data_crop_values"),
     ParamMapEntry(ext_name="run_number",                  int_name="run_number"),
     ParamMapEntry(ext_name="sample_empty",                int_name="sample_empty",   optional=True),
     ParamMapEntry(ext_name="sample_empty_scale",          int_name="sample_empty_scale"),
     ParamMapEntry(ext_name="suffix",                      int_name="suffix", optional=True),
     ParamMapEntry(ext_name="spline_coefficient",          int_name="spline_coeff"),
     ParamMapEntry(ext_name="output_directory",            int_name="output_dir"),
     ParamMapEntry(ext_name="user_name",                   int_name="user_name"),
示例#3
0
from __future__ import (absolute_import, division, print_function)

from isis_powder.routines.param_map_entry import ParamMapEntry
from isis_powder.pearl_routines.pearl_enums import PEARL_FOCUS_MODES, PEARL_TT_MODES

#                 Maps friendly user name (ext_name) -> script name (int_name)
attr_mapping = \
    [
        ParamMapEntry(ext_name="attenuation_file_path",      int_name="attenuation_file_path"),
        ParamMapEntry(ext_name="config_file",                int_name="config_file_name"),
        ParamMapEntry(ext_name="calibration_mapping_file",   int_name="cal_mapping_path"),
        ParamMapEntry(ext_name="calibration_directory",      int_name="calibration_dir"),
        ParamMapEntry(ext_name="do_absorb_corrections",      int_name="absorb_corrections"),
        ParamMapEntry(ext_name="file_ext",                   int_name="file_extension", optional=True),
        ParamMapEntry(ext_name="focused_cropping_values",    int_name="tof_cropping_values"),
        ParamMapEntry(ext_name="focus_mode",                 int_name="focus_mode", enum_class=PEARL_FOCUS_MODES),
        ParamMapEntry(ext_name="long_mode",                  int_name="long_mode"),
        ParamMapEntry(ext_name="monitor_lambda_crop_range",  int_name="monitor_lambda"),
        ParamMapEntry(ext_name="monitor_integration_range",  int_name="monitor_integration_range"),
        ParamMapEntry(ext_name="monitor_mask_regions",       int_name="monitor_mask_regions"),
        ParamMapEntry(ext_name="monitor_spectrum_number",    int_name="monitor_spec_no"),
        ParamMapEntry(ext_name="monitor_spline_coefficient", int_name="monitor_spline"),
        ParamMapEntry(ext_name="output_directory",           int_name="output_dir"),
        ParamMapEntry(ext_name="perform_attenuation",        int_name="perform_atten"),
        ParamMapEntry(ext_name="raw_data_tof_cropping",      int_name="raw_data_crop_vals"),
        ParamMapEntry(ext_name="run_in_cycle",               int_name="run_in_range"),
        ParamMapEntry(ext_name="run_number",                 int_name="run_number"),
        ParamMapEntry(ext_name="spline_coefficient",         int_name="spline_coefficient"),
        ParamMapEntry(ext_name="tt88_grouping_filename",     int_name="tt88_grouping"),
        ParamMapEntry(ext_name="tt70_grouping_filename",     int_name="tt70_grouping"),
        ParamMapEntry(ext_name="tt35_grouping_filename",     int_name="tt35_grouping"),
# 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 +
from __future__ import (absolute_import, division, print_function)

from isis_powder.hrpd_routines.hrpd_enums import HRPD_MODES, HRPD_TOF_WINDOWS
from isis_powder.routines.param_map_entry import ParamMapEntry

attr_mapping = \
    [
        ParamMapEntry(ext_name="calibration_directory",     int_name="calibration_dir"),
        ParamMapEntry(ext_name="calibration_mapping_file",  int_name="cal_mapping_path"),
        ParamMapEntry(ext_name="config_file",               int_name="config_file_name"),
        ParamMapEntry(ext_name="do_absorb_corrections",     int_name="do_absorb_corrections"),
        ParamMapEntry(ext_name="file_ext",                  int_name="file_extension", optional=True),
        ParamMapEntry(ext_name="focused_bin_widths",        int_name="focused_bin_widths"),
        ParamMapEntry(ext_name="focused_cropping_values",   int_name="tof_cropping_values"),
        ParamMapEntry(ext_name="grouping_file_name",        int_name="grouping_file_name"),
        ParamMapEntry(ext_name="output_directory",          int_name="output_dir"),
        ParamMapEntry(ext_name="spline_coefficient",        int_name="spline_coeff"),
        ParamMapEntry(ext_name="first_cycle_run_no",        int_name="run_in_range"),
        ParamMapEntry(ext_name="mode",                      int_name="mode", enum_class=HRPD_MODES),
        ParamMapEntry(ext_name="multiple_scattering",       int_name="multiple_scattering"),
        ParamMapEntry(ext_name="run_number",                int_name="run_number"),
        ParamMapEntry(ext_name="sample_empty",              int_name="sample_empty", optional=True),
        ParamMapEntry(ext_name="sample_empty_scale",        int_name="sample_empty_scale"),
        ParamMapEntry(ext_name="suffix",                    int_name="suffix", optional=True),
        ParamMapEntry(ext_name="user_name",                 int_name="user_name"),
from __future__ import (absolute_import, division, print_function)

from isis_powder.routines.param_map_entry import ParamMapEntry
from isis_powder.gem_routines.gem_enums import GEM_CHOPPER_MODES
from isis_powder.routines.common_enums import INPUT_BATCHING, WORKSPACE_UNITS

#                 Maps friendly user name (ext_name) -> script name (int_name)
attr_mapping = \
    [
     ParamMapEntry(ext_name="calibration_directory",     int_name="calibration_dir"),
     ParamMapEntry(ext_name="calibration_mapping_file",  int_name="cal_mapping_path"),
     ParamMapEntry(ext_name="config_file",               int_name="config_file"),
     ParamMapEntry(ext_name="do_absorb_corrections",     int_name="do_absorb_corrections"),
     ParamMapEntry(ext_name="file_ext",                  int_name="file_extension", optional=True),
     ParamMapEntry(ext_name="first_cycle_run_no",        int_name="run_in_range"),
     ParamMapEntry(ext_name="focused_cropping_values",   int_name="focused_cropping_values"),
     ParamMapEntry(ext_name="grouping_file_name",        int_name="grouping_file_name"),
     ParamMapEntry(ext_name="input_mode",                int_name="input_batching", enum_class=INPUT_BATCHING),
     ParamMapEntry(ext_name="mode",                      int_name="mode",           enum_class=GEM_CHOPPER_MODES),
     ParamMapEntry(ext_name="multiple_scattering",       int_name="multiple_scattering"),
     ParamMapEntry(ext_name="raw_tof_cropping_values",   int_name="raw_tof_cropping_values"),
     ParamMapEntry(ext_name="run_number",                int_name="run_number"),
     ParamMapEntry(ext_name="sample_empty",              int_name="sample_empty",   optional=True),
     ParamMapEntry(ext_name="sample_empty_scale",        int_name="sample_empty_scale"),
     ParamMapEntry(ext_name="spline_coefficient",        int_name="spline_coeff"),
     ParamMapEntry(ext_name="output_directory",          int_name="output_dir"),
     ParamMapEntry(ext_name="unit_to_keep",              int_name="unit_to_keep",
                   enum_class=WORKSPACE_UNITS,           optional=True),
     ParamMapEntry(ext_name="user_name",                 int_name="user_name"),
     ParamMapEntry(ext_name="vanadium_cropping_values",  int_name="vanadium_cropping_values"),
     ParamMapEntry(ext_name="vanadium_normalisation",    int_name="do_van_norm")
示例#6
0
# 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 +
from __future__ import (absolute_import, division, print_function)

from isis_powder.routines.param_map_entry import ParamMapEntry
from isis_powder.pearl_routines.pearl_enums import PEARL_FOCUS_MODES, PEARL_TT_MODES

#                 Maps friendly user name (ext_name) -> script name (int_name)
attr_mapping = \
    [
        ParamMapEntry(ext_name="attenuation_file_path",           int_name="attenuation_file_path"),
        ParamMapEntry(ext_name="config_file",                     int_name="config_file_name"),
        ParamMapEntry(ext_name="calibration_mapping_file",        int_name="cal_mapping_path"),
        ParamMapEntry(ext_name="calibration_directory",           int_name="calibration_dir"),
        ParamMapEntry(ext_name="create_cal_rebin_1_params",       int_name="cal_rebin_1"),
        ParamMapEntry(ext_name="create_cal_rebin_2_params",       int_name="cal_rebin_2"),
        ParamMapEntry(ext_name="cross_corr_reference_spectra",    int_name="reference_spectra"),
        ParamMapEntry(ext_name="cross_corr_ws_index_max",         int_name="cross_corr_ws_max"),
        ParamMapEntry(ext_name="cross_corr_ws_index_min",         int_name="cross_corr_ws_min"),
        ParamMapEntry(ext_name="cross_corr_x_min",                int_name="cross_corr_x_min"),
        ParamMapEntry(ext_name="cross_corr_x_max",                int_name="cross_corr_x_max"),
        ParamMapEntry(ext_name="do_absorb_corrections",           int_name="absorb_corrections"),
        ParamMapEntry(ext_name="file_ext",                        int_name="file_extension", optional=True),
        ParamMapEntry(ext_name="focused_cropping_values",         int_name="tof_cropping_values"),
        ParamMapEntry(ext_name="focus_mode",                      int_name="focus_mode", enum_class=PEARL_FOCUS_MODES),
        ParamMapEntry(ext_name="generate_absorb_corrections",     int_name="gen_absorb"),
        ParamMapEntry(ext_name="get_det_offsets_d_ref",           int_name="d_reference"),
示例#7
0
# 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 & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from isis_powder.routines.param_map_entry import ParamMapEntry
from isis_powder.routines.common import PARAM_MAPPING as COMMON_PARAM_MAPPING
from isis_powder.routines.common_enums import INPUT_BATCHING, EMPTY_CAN_SUBTRACTION_METHOD, VAN_NORMALISATION_METHOD
from isis_powder.polaris_routines.polaris_enums import POLARIS_CHOPPER_MODES

#                 Maps friendly user name (ext_name) -> script name (int_name)
attr_mapping = [
    ParamMapEntry(ext_name="calibration_directory",
                  int_name="calibration_dir"),
    ParamMapEntry(ext_name="calibration_mapping_file",
                  int_name="cal_mapping_path"),
    ParamMapEntry(ext_name="config_file", int_name="config_file"),
    ParamMapEntry(ext_name="debug", int_name="debug", optional=True),
    ParamMapEntry(ext_name="delta_r", int_name="delta_r", optional=True),
    ParamMapEntry(ext_name="delta_q", int_name="delta_q", optional=True),
    ParamMapEntry(ext_name="do_absorb_corrections",
                  int_name="do_absorb_corrections"),
    ParamMapEntry(ext_name="do_van_normalisation",
                  int_name="do_van_normalisation"),
    ParamMapEntry(ext_name="van_normalisation_method",
                  int_name="van_normalisation_method",
                  enum_class=VAN_NORMALISATION_METHOD,
                  optional=True),
    ParamMapEntry(ext_name="empty_can_subtraction_method",
                  int_name="empty_can_subtraction_method",
示例#8
0
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
#   NScD Oak Ridge National Laboratory, European Spallation Source,
#   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
import collections
import copy
import warnings

import mantid.kernel as kernel
import mantid.simpleapi as mantid
from isis_powder.routines.common_enums import INPUT_BATCHING, WORKSPACE_UNITS
from isis_powder.routines.param_map_entry import ParamMapEntry

# Common param mapping entries
PARAM_MAPPING = [
    ParamMapEntry(ext_name="nxs_filename", int_name="nxs_filename"),
    ParamMapEntry(ext_name="gss_filename", int_name="gss_filename"),
    ParamMapEntry(ext_name="dat_files_directory",
                  int_name="dat_files_directory"),
    ParamMapEntry(ext_name="tof_xye_filename", int_name="tof_xye_filename"),
    ParamMapEntry(ext_name="dspacing_xye_filename",
                  int_name="dspacing_xye_filename"),
]

# Set of defaults for the advanced config settings
ADVANCED_CONFIG = {
    "nxs_filename":
    "{fileext}{inst}{runno}{suffix}.nxs",
    "gss_filename":
    "{fileext}{inst}{runno}{suffix}.gsas",
    "dat_files_directory":
示例#9
0
class _MockInst(AbstractInst):

    _param_map = [
        ParamMapEntry(ext_name="cal_dir", int_name="calibration_dir"),
        ParamMapEntry(ext_name="cal_map", int_name="cal_mapping_path"),
        ParamMapEntry(ext_name="file_ext",
                      int_name="file_extension",
                      optional=True),
        ParamMapEntry(ext_name="group_file", int_name="grouping_file_name"),
        ParamMapEntry(ext_name="out_dir", int_name="output_dir"),
        ParamMapEntry(ext_name="suffix", int_name="suffix", optional=True),
        ParamMapEntry(ext_name="user_name", int_name="user_name"),
        ParamMapEntry(ext_name="nxs_filename", int_name="nxs_filename"),
        ParamMapEntry(ext_name="gss_filename", int_name="gss_filename"),
        ParamMapEntry(ext_name="dat_files_directory",
                      int_name="dat_files_directory"),
        ParamMapEntry(ext_name="tof_xye_filename",
                      int_name="tof_xye_filename"),
        ParamMapEntry(ext_name="dspacing_xye_filename",
                      int_name="dspacing_xye_filename"),
    ]
    _advanced_config = {
        "user_name":
        "ISISPowderAbstractInstrumentTest",
        "nxs_filename":
        "{inst}{runno}{suffix}.nxs",
        "gss_filename":
        "{inst}{runno}{suffix}.gss",
        "dat_files_directory":
        "dat_files",
        "tof_xye_filename":
        "{inst}{runno}_{fileext}{suffix}_b{{bankno}}_TOF.dat",
        "dspacing_xye_filename":
        "{inst}{runno}{fileext}{suffix}_b{{bankno}}_D.dat",
    }
    INST_PREFIX = "MOCK"

    def __init__(self, cal_file_path, **kwargs):
        self._inst_settings = InstrumentSettings(
            param_map=self._param_map,
            adv_conf_dict=self._advanced_config,
            kwargs=kwargs)
        self.cal_mapping_path = cal_file_path

        super(_MockInst, self).__init__(
            user_name=self._inst_settings.user_name,
            calibration_dir=self._inst_settings.calibration_dir,
            output_dir=self._inst_settings.output_dir,
            inst_prefix=self.INST_PREFIX)
示例#10
0
# 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 & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from isis_powder.routines.param_map_entry import ParamMapEntry
from isis_powder.gem_routines.gem_enums import GEM_CHOPPER_MODES
from isis_powder.routines.common import PARAM_MAPPING as COMMON_PARAM_MAPPING
from isis_powder.routines.common_enums import INPUT_BATCHING, WORKSPACE_UNITS, EMPTY_CAN_SUBTRACTION_METHOD
#                 Maps friendly user name (ext_name) -> script name (int_name)
attr_mapping = [
    ParamMapEntry(ext_name="calibration_to_adjust", int_name="cal_adjust", optional=True),
    ParamMapEntry(ext_name="calibration_directory", int_name="calibration_dir"),
    ParamMapEntry(ext_name="calibration_mapping_file", int_name="cal_mapping_path"),
    ParamMapEntry(ext_name="config_file", int_name="config_file"),
    ParamMapEntry(ext_name="create_cal_rebin_1_params", int_name="cal_rebin_1"),
    ParamMapEntry(ext_name="create_cal_rebin_2_params", int_name="cal_rebin_2"),
    ParamMapEntry(ext_name="cross_corr_reference_spectra", int_name="reference_spectra"),
    ParamMapEntry(ext_name="cross_corr_ws_index_max", int_name="cross_corr_ws_max"),
    ParamMapEntry(ext_name="cross_corr_ws_index_min", int_name="cross_corr_ws_min"),
    ParamMapEntry(ext_name="cross_corr_x_min", int_name="cross_corr_x_min"),
    ParamMapEntry(ext_name="cross_corr_x_max", int_name="cross_corr_x_max"),
    ParamMapEntry(ext_name="get_det_offsets_d_ref", int_name="d_reference"),
    ParamMapEntry(ext_name="get_det_offsets_step", int_name="get_det_offsets_step"),
    ParamMapEntry(ext_name="get_det_offsets_x_min", int_name="get_det_offsets_x_min"),
    ParamMapEntry(ext_name="get_det_offsets_x_max", int_name="get_det_offsets_x_max"),
    ParamMapEntry(ext_name="do_absorb_corrections", int_name="do_absorb_corrections"),
    ParamMapEntry(ext_name="empty_can_subtraction_method", int_name="empty_can_subtraction_method",
                  enum_class=EMPTY_CAN_SUBTRACTION_METHOD, optional=True),
    ParamMapEntry(ext_name="file_ext", int_name="file_extension", optional=True),
示例#11
0
# 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 & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from isis_powder.hrpd_routines.hrpd_enums import HRPD_MODES, HRPD_TOF_WINDOWS
from isis_powder.routines.common import PARAM_MAPPING as COMMON_PARAM_MAPPING
from isis_powder.routines.common_enums import EMPTY_CAN_SUBTRACTION_METHOD
from isis_powder.routines.param_map_entry import ParamMapEntry

attr_mapping = [
    ParamMapEntry(ext_name="calibration_directory", int_name="calibration_dir"),
    ParamMapEntry(ext_name="calibration_mapping_file", int_name="cal_mapping_path"),
    ParamMapEntry(ext_name="config_file", int_name="config_file_name"),
    ParamMapEntry(ext_name="do_absorb_corrections", int_name="do_absorb_corrections"),
    ParamMapEntry(ext_name="empty_can_subtraction_method", int_name="empty_can_subtraction_method",
                  enum_class=EMPTY_CAN_SUBTRACTION_METHOD, optional=True),
    ParamMapEntry(ext_name="eff_integration_range", int_name="eff_integration_range",
                  optional=True),
    ParamMapEntry(ext_name="file_ext", int_name="file_extension", optional=True),
    ParamMapEntry(ext_name="focused_bin_widths", int_name="focused_bin_widths"),
    ParamMapEntry(ext_name="focused_cropping_values", int_name="tof_cropping_values"),
    ParamMapEntry(ext_name="grouping_file_name", int_name="grouping_file_name"),
    ParamMapEntry(ext_name="output_directory", int_name="output_dir"),
    ParamMapEntry(ext_name="spline_coefficient", int_name="spline_coeff"),
    ParamMapEntry(ext_name="first_cycle_run_no", int_name="run_in_range"),
    ParamMapEntry(ext_name="mode", int_name="mode", enum_class=HRPD_MODES),
    ParamMapEntry(ext_name="multiple_scattering", int_name="multiple_scattering"),
    ParamMapEntry(ext_name="run_number", int_name="run_number"),
    ParamMapEntry(ext_name="sample_empty", int_name="sample_empty", optional=True),