本文整理汇总了Python中EnggUtils.default_ceria_expected_peaks方法的典型用法代码示例。如果您正苦于以下问题:Python EnggUtils.default_ceria_expected_peaks方法的具体用法?Python EnggUtils.default_ceria_expected_peaks怎么用?Python EnggUtils.default_ceria_expected_peaks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EnggUtils
的用法示例。
在下文中一共展示了EnggUtils.default_ceria_expected_peaks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_default_peaks
# 需要导入模块: import EnggUtils [as 别名]
# 或者: from EnggUtils import default_ceria_expected_peaks [as 别名]
def _get_default_peaks(self):
"""
Gets default peaks for Engg algorithms. Values from CeO2
"""
import EnggUtils
return EnggUtils.default_ceria_expected_peaks()
示例2: PyInit
# 需要导入模块: import EnggUtils [as 别名]
# 或者: from EnggUtils import default_ceria_expected_peaks [as 别名]
def PyInit(self):
self.declareProperty(
MatrixWorkspaceProperty("InputWorkspace", "", Direction.Input),
doc="Workspace with the calibration run to use.",
)
import EnggUtils
self.declareProperty(
FloatArrayProperty(
"ExpectedPeaks", values=EnggUtils.default_ceria_expected_peaks(), direction=Direction.Input
),
doc="A list of dSpacing values where peaks are expected.",
)
self.declareProperty(
FileProperty(
name="ExpectedPeaksFromFile", defaultValue="", action=FileAction.OptionalLoad, extensions=[".csv"]
),
doc="Load from file a list of dSpacing values to be translated into TOF to "
"find expected peaks. This takes precedence over 'ExpectedPeaks' if both "
"options are given.",
)
peaks_grp = "Peaks to fit"
self.setPropertyGroup("ExpectedPeaks", peaks_grp)
self.setPropertyGroup("ExpectedPeaksFromFile", peaks_grp)
self.declareProperty(
MatrixWorkspaceProperty("VanadiumWorkspace", "", Direction.Input, PropertyMode.Optional),
doc="Workspace with the Vanadium (correction and calibration) run. "
"Alternatively, when the Vanadium run has been already processed, "
"the properties can be used",
)
self.declareProperty(
ITableWorkspaceProperty("VanIntegrationWorkspace", "", Direction.Input, PropertyMode.Optional),
doc="Results of integrating the spectra of a Vanadium run, with one column "
"(integration result) and one row per spectrum. This can be used in "
"combination with OutVanadiumCurveFits from a previous execution and "
"VanadiumWorkspace to provide pre-calculated values for Vanadium correction.",
)
self.declareProperty(
MatrixWorkspaceProperty("VanCurvesWorkspace", "", Direction.Input, PropertyMode.Optional),
doc="A workspace2D with the fitting workspaces corresponding to "
"the instrument banks. This workspace has three spectra per bank, as produced "
"by the algorithm Fit. This is meant to be used as an alternative input "
"VanadiumWorkspace for testing and performance reasons. If not given, no "
"workspace is generated.",
)
vana_grp = "Vanadium (open beam) properties"
self.setPropertyGroup("VanadiumWorkspace", vana_grp)
self.setPropertyGroup("VanIntegrationWorkspace", vana_grp)
self.setPropertyGroup("VanCurvesWorkspace", vana_grp)
self.declareProperty(
"Bank",
"",
StringListValidator(EnggUtils.ENGINX_BANKS),
direction=Direction.Input,
doc="Which bank to calibrate. It can be specified as 1 or 2, or "
"equivalently, North or South. See also " + self.INDICES_PROP_NAME + " "
"for a more flexible alternative to select specific detectors",
)
self.declareProperty(
self.INDICES_PROP_NAME,
"",
direction=Direction.Input,
doc="Sets the spectrum numbers for the detectors "
"that should be considered in the calibration (all others will be "
"ignored). This option cannot be used together with Bank, as they overlap. "
'You can give multiple ranges, for example: "0-99", or "0-9, 50-59, 100-109".',
)
banks_grp = "Banks / spectra"
self.setPropertyGroup("Bank", banks_grp)
self.setPropertyGroup(self.INDICES_PROP_NAME, banks_grp)
self.declareProperty(
ITableWorkspaceProperty("DetectorPositions", "", Direction.Input, PropertyMode.Optional),
"Calibrated detector positions. If not specified, default ones (from the "
"current instrument definition) are used.",
)
self.declareProperty(
"OutputParametersTableName",
"",
direction=Direction.Input,
doc="Name for a table workspace with the calibration parameters calculated "
"from this algorithm: difc and zero parameters for GSAS. these two parameters "
"are added as two columns in a single row. If not given, no table is "
"generated.",
)
self.declareProperty(
"Difc",
0.0,
#.........这里部分代码省略.........
示例3: PyInit
# 需要导入模块: import EnggUtils [as 别名]
# 或者: from EnggUtils import default_ceria_expected_peaks [as 别名]
def PyInit(self):
self.declareProperty(MatrixWorkspaceProperty("Workspace", "", Direction.InOut),
"Workspace with the calibration run to use. The calibration will be applied on it.")
self.declareProperty(MatrixWorkspaceProperty("VanadiumWorkspace", "", Direction.Input,
PropertyMode.Optional),
"Workspace with the Vanadium (correction and calibration) run.")
self.declareProperty(ITableWorkspaceProperty('VanIntegrationWorkspace', '',
Direction.Input, PropertyMode.Optional),
doc = 'Results of integrating the spectra of a Vanadium run, with one column '
'(integration result) and one row per spectrum. This can be used in '
'combination with OutVanadiumCurveFits from a previous execution and '
'VanadiumWorkspace to provide pre-calculated values for Vanadium correction.')
self.declareProperty(MatrixWorkspaceProperty('VanCurvesWorkspace', '', Direction.Input,
PropertyMode.Optional),
doc = 'A workspace2D with the fitting workspaces corresponding to '
'the instrument banks. This workspace has three spectra per bank, as produced '
'by the algorithm Fit. This is meant to be used as an alternative input '
'VanadiumWorkspace for testing and performance reasons. If not given, no '
'workspace is generated.')
vana_grp = 'Vanadium (open beam) properties'
self.setPropertyGroup('VanadiumWorkspace', vana_grp)
self.setPropertyGroup('VanIntegrationWorkspace', vana_grp)
self.setPropertyGroup('VanCurvesWorkspace', vana_grp)
self.declareProperty(ITableWorkspaceProperty("OutDetPosTable", "", Direction.Output),\
doc="A table with the detector IDs and calibrated detector positions and "
"additional calibration information. The table includes: the old positions "
"in V3D format (3D vector with x, y, z values), the new positions in V3D, the "
"new positions in spherical coordinates, the change in L2, and the DIFC and "
"ZERO parameters.")
self.declareProperty("Bank", '', StringListValidator(EnggUtils.ENGINX_BANKS),
direction=Direction.Input,
doc = "Which bank to calibrate: It can be specified as 1 or 2, or "
"equivalently, North or South. See also " + self.INDICES_PROP_NAME + " "
"for a more flexible alternative to select specific detectors")
self.declareProperty(self.INDICES_PROP_NAME, '', direction=Direction.Input,
doc = 'Sets the spectrum numbers for the detectors '
'that should be considered in the calibration (all others will be '
'ignored). This option cannot be used together with Bank, as they overlap. '
'You can give multiple ranges, for example: "0-99", or "0-9, 50-59, 100-109".')
banks_grp = 'Banks / spectra'
self.setPropertyGroup('Bank', banks_grp)
self.setPropertyGroup(self.INDICES_PROP_NAME, banks_grp)
self.declareProperty(FileProperty("OutDetPosFilename", "", FileAction.OptionalSave, [".csv"]),
doc="Name of the file to save the pre-/post-calibrated detector positions - this "
"saves the same information that is provided in the output table workspace "
"(OutDetPosTable).")
opt_outs_grp = 'Optional outputs'
self.setPropertyGroup('OutDetPosFilename', opt_outs_grp)
self.declareProperty(FloatArrayProperty("ExpectedPeaks",
values=EnggUtils.default_ceria_expected_peaks(),
direction=Direction.Input),
doc="A list of dSpacing values where peaks are expected.")
self.declareProperty(FileProperty(name="ExpectedPeaksFromFile",defaultValue="",
action=FileAction.OptionalLoad,extensions = [".csv"]),
doc="Load from file a list of dSpacing values to be translated into TOF to "
"find expected peaks. This takes precedence over 'ExpectedPeaks' if both "
"options are given.")
peaks_grp = 'Peaks to fit'
self.setPropertyGroup('ExpectedPeaks', peaks_grp)
self.setPropertyGroup('ExpectedPeaksFromFile', peaks_grp)