本文整理汇总了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
示例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)
示例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
示例4: instrument
# 需要导入模块: from mantid.kernel import ConfigService [as 别名]
# 或者: from mantid.kernel.ConfigService import getInstrument [as 别名]
def instrument(self):
inst = ConfigService.getInstrument()
return inst
示例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"