當前位置: 首頁>>代碼示例>>Python>>正文


Python Elements.getMaterialTransmission方法代碼示例

本文整理匯總了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_()
開發者ID:vasole,項目名稱:pymca,代碼行數:46,代碼來源:MaterialEditor.py


注:本文中的PyMca5.PyMcaPhysics.Elements.getMaterialTransmission方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。