本文整理匯總了Python中PyMca5.PyMcaIO.ArraySave.save3DArrayAsHDF5方法的典型用法代碼示例。如果您正苦於以下問題:Python ArraySave.save3DArrayAsHDF5方法的具體用法?Python ArraySave.save3DArrayAsHDF5怎麽用?Python ArraySave.save3DArrayAsHDF5使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyMca5.PyMcaIO.ArraySave
的用法示例。
在下文中一共展示了ArraySave.save3DArrayAsHDF5方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: saveStackAsSimplestHDF5
# 需要導入模塊: from PyMca5.PyMcaIO import ArraySave [as 別名]
# 或者: from PyMca5.PyMcaIO.ArraySave import save3DArrayAsHDF5 [as 別名]
def saveStackAsSimplestHDF5(self):
filename = self._getOutputHDF5Filename()
if not len(filename):
return
view = self._getCroppedView()
ArraySave.save3DArrayAsHDF5(view, filename,
labels = None, dtype=None, mode='simplest')
示例2: saveStackAsNeXus
# 需要導入模塊: from PyMca5.PyMcaIO import ArraySave [as 別名]
# 或者: from PyMca5.PyMcaIO.ArraySave import save3DArrayAsHDF5 [as 別名]
def saveStackAsNeXus(self, dtype=None, interpretation=None, compression=False):
mcaIndex = self._stack.info.get('McaIndex', -1)
if interpretation is None:
if mcaIndex in [0]:
interpretation = "image"
else:
interpretation = "spectrum"
if interpretation not in ["spectrum", "image"]:
raise ValueError("Unknown data interpretation %s" % interpretation)
filename = self._getOutputHDF5Filename()
if not len(filename):
return
# get only the seen stack portion
view = self._getCroppedView()
# the current graph axis is saved
axes = [None] * len(self._stack.data.shape)
labels = [None] * len(self._stack.data.shape)
try:
xLabel = qt.safe_str(self.mcaWidget.graph.getGraphXLabel())
except:
xLabel = None
try:
xData, y, legend, info = self.mcaWidget.getActiveCurve()[:4]
except:
xData = self._mcaData0.x[0]
xLabel = 'Channels'
if interpretation == 'image':
labels[0] = xLabel
axes[0] = xData
else:
labels[-1] = xLabel
axes[-1] = xData
try:
ArraySave.save3DArrayAsHDF5(view,
filename,
axes=axes,
labels=labels,
dtype=dtype,
mode='nexus',
mcaindex=mcaIndex,
interpretation=interpretation,
compression=compression)
except:
msg = qt.QMessageBox(self)
msg.setIcon(qt.QMessageBox.Critical)
msg.setWindowTitle("Save error")
msg.setText("An error has occured while saving the data:")
msg.setInformativeText(qt.safe_str(sys.exc_info()[1]))
msg.setDetailedText(traceback.format_exc())
msg.exec_()
示例3: saveStackAsSimplestHDF5
# 需要導入模塊: from PyMca5.PyMcaIO import ArraySave [as 別名]
# 或者: from PyMca5.PyMcaIO.ArraySave import save3DArrayAsHDF5 [as 別名]
def saveStackAsSimplestHDF5(self):
filename = self._getOutputHDF5Filename()
if not len(filename):
return
ArraySave.save3DArrayAsHDF5(self._stack.data, filename,
labels = None, dtype=None, mode='simplest')
示例4: saveStackAsNeXusPlus
# 需要導入模塊: from PyMca5.PyMcaIO import ArraySave [as 別名]
# 或者: from PyMca5.PyMcaIO.ArraySave import save3DArrayAsHDF5 [as 別名]
def saveStackAsNeXusPlus(self):
filename = self._getOutputHDF5Filename()
if not len(filename):
return
ArraySave.save3DArrayAsHDF5(self._stack.data, filename,
labels = None, dtype=None, mode='nexus+')