本文整理汇总了Python中PyMca5.PyMcaPhysics.Elements.getMaterialTransmission方法的典型用法代码示例。如果您正苦于以下问题:Python Elements.getMaterialTransmission方法的具体用法?Python Elements.getMaterialTransmission怎么用?Python Elements.getMaterialTransmission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyMca5.PyMcaPhysics.Elements
的用法示例。
在下文中一共展示了Elements.getMaterialTransmission方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _transmissionSlot
# 需要导入模块: from PyMca5.PyMcaPhysics import Elements [as 别名]
# 或者: from PyMca5.PyMcaPhysics.Elements import getMaterialTransmission [as 别名]
def _transmissionSlot(self, ddict):
try:
compoundList = ddict['CompoundList']
fractionList = ddict['CompoundFraction']
density = ddict['Density']
thickness = ddict.get('Thickness', 0.1)
energy = numpy.arange(1, 100, 0.1)
data=Elements.getMaterialTransmission(compoundList, fractionList, energy,
density=density, thickness=thickness, listoutput=False)
addButton = False
if self.graph is None:
# probably dead code (ScanWindow not imported)
self.graphDialog = qt.QDialog(self)
self.graphDialog.mainLayout = qt.QVBoxLayout(self.graphDialog)
self.graphDialog.mainLayout.setContentsMargins(0, 0, 0, 0)
self.graphDialog.mainLayout.setSpacing(0)
#self.graph = ScanWindow.ScanWindow(self.graphDialog)
self.graph = ScanWindow(self.graphDialog)
self.graphDialog.mainLayout.addWidget(self.graph)
self.graph._togglePointsSignal()
self.graph.graph.crossPicker.setEnabled(False)
addButton = True
if addButton:
self._addGraphDialogButton()
if self.__toolMode:
legend = ddict['Comment']
else:
legend = str(self.matCombo.currentText()) +\
" with density = %f g/cm3" % density +\
" and thickness = %f cm" % thickness
self.graph.addCurve(energy, data['transmission'],
legend=legend,
xlabel='Energy (keV)',
ylabel='Transmission',
replace=True)
self.graph.setGraphTitle(ddict['Comment'])
if self.graphDialog is not None:
self.graphDialog.exec_()
except:
msg=qt.QMessageBox(self)
msg.setIcon(qt.QMessageBox.Critical)
msg.setInformativeText(str(sys.exc_info()[1]))
msg.setDetailedText(traceback.format_exc())
msg.exec_()