当前位置: 首页>>代码示例>>Python>>正文


Python ConfigService.getInstrument方法代码示例

本文整理汇总了Python中mantid.kernel.ConfigService.getInstrument方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigService.getInstrument方法的具体用法?Python ConfigService.getInstrument怎么用?Python ConfigService.getInstrument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mantid.kernel.ConfigService的用法示例。


在下文中一共展示了ConfigService.getInstrument方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_default_grouping

# 需要导入模块: from mantid.kernel import ConfigService [as 别名]
# 或者: from mantid.kernel.ConfigService import getInstrument [as 别名]
def get_default_grouping(instrument, main_field_direction):
    parameter_name = "Default grouping file"
    if instrument == "MUSR":
        parameter_name += " - " + main_field_direction
    try:
        grouping_file = ConfigService.getInstrument(instrument).getStringParameter(parameter_name)[0]
    except IndexError:
        return [], []
    instrument_directory = ConfigServiceImpl.Instance().getInstrumentDirectory()
    filename = instrument_directory + grouping_file
    new_groups, new_pairs = load_utils.load_grouping_from_XML(filename)
    return new_groups, new_pairs
开发者ID:samueljackson92,项目名称:mantid,代码行数:14,代码来源:muon_data_context.py

示例2: setup_facilities_group

# 需要导入模块: from mantid.kernel import ConfigService [as 别名]
# 或者: from mantid.kernel.ConfigService import getInstrument [as 别名]
    def setup_facilities_group(self):
        facilities = ConfigService.getFacilityNames()
        self.view.facility.addItems(facilities)

        default_facility = ConfigService.getFacility().name()
        self.view.facility.setCurrentIndex(self.view.facility.findText(default_facility))
        self.action_facility_changed(default_facility)
        self.view.facility.currentTextChanged.connect(self.action_facility_changed)

        default_instrument = ConfigService.getInstrument().name()
        self.view.instrument.setCurrentIndex(self.view.instrument.findText(default_instrument))
        self.action_instrument_changed(default_instrument)
        self.view.instrument.currentTextChanged.connect(self.action_instrument_changed)
开发者ID:mantidproject,项目名称:mantid,代码行数:15,代码来源:presenter.py

示例3: __updateAlignAndFocusArgs

# 需要导入模块: from mantid.kernel import ConfigService [as 别名]
# 或者: from mantid.kernel.ConfigService import getInstrument [as 别名]
    def __updateAlignAndFocusArgs(self, wkspname):
        self.log().debug('__updateAlignAndFocusArgs(%s)' % wkspname)
        # if the files are missing, there is nothing to do
        if (CAL_FILE not in self.kwargs) and (GROUP_FILE not in self.kwargs):
            self.log().debug('--> Nothing to do')
            return
        self.log().debug('--> Updating')

        # delete the files from the list of kwargs
        if CAL_FILE in self.kwargs:
            del self.kwargs[CAL_FILE]
        if CAL_FILE in self.kwargs:
            del self.kwargs[GROUP_FILE]

        # get the instrument name
        instr = mtd[wkspname].getInstrument().getName()
        instr = ConfigService.getInstrument(instr).shortName()

        # use the canonical names if they weren't specifed
        for key, ext in zip((CAL_WKSP, GRP_WKSP, MASK_WKSP),
                            ('_cal', '_group', '_mask')):
            if key not in self.kwargs:
                self.kwargs[key] = instr + ext
开发者ID:samueljackson92,项目名称:mantid,代码行数:25,代码来源:AlignAndFocusPowderFromFiles.py

示例4: instrument

# 需要导入模块: from mantid.kernel import ConfigService [as 别名]
# 或者: from mantid.kernel.ConfigService import getInstrument [as 别名]
 def instrument(self):
     inst = ConfigService.getInstrument()
     return inst
开发者ID:samueljackson92,项目名称:mantid,代码行数:5,代码来源:muon_data_context.py

示例5: _get_leading_zeroes

# 需要导入模块: from mantid.kernel import ConfigService [as 别名]
# 或者: from mantid.kernel.ConfigService import getInstrument [as 别名]
 def _get_leading_zeroes(self, run_number):
     run_number_int = int(run_number)
     total_digits_for_inst = ConfigService.getInstrument(self.instrument_string).zeroPadding(run_number_int)
     zeros_to_add = total_digits_for_inst - len(run_number)
     return zeros_to_add * "0"
开发者ID:mantidproject,项目名称:mantid,代码行数:7,代码来源:add_runs_presenter.py


注:本文中的mantid.kernel.ConfigService.getInstrument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。