def saveMA(self, fileName=None): if self.imgData is None: raise HelpfulException("There is no processed data to save.") if fileName is None: dh = self.getElement("File Loader").baseDir().name() self.fileDialog = FileDialog(None, "Save image data", dh, '*.ma') self.fileDialog.setAcceptMode(QtGui.QFileDialog.AcceptSave) self.fileDialog.show() self.fileDialog.fileSelected.connect(self.saveMA) return table = self.dbquery.table() x = table['xPos'].min() y = table['yPos'].min() #print "params:", self.imgData.dtype.names #print "shape:", self.imgData.shape #arr = MetaArray(self.currentData) ### need to format this with axes and info arr = MetaArray([self.imgData[p] for p in self.imgData.dtype.names], info=[ {'name':'vals', 'cols':[{'name':p} for p in self.imgData.dtype.names]}, {'name':'xPos', 'units':'m', 'values':np.arange(self.imgData.shape[0])*self.spacing+x}, {'name':'yPos', 'units':'m', 'values':np.arange(self.imgData.shape[1])*self.spacing+y}, {'spacing':self.spacing} ]) arr.write(fileName)
def saveMA(self, fileName=None): if fileName is None: dh = self.getElement("File Loader").baseDir().name() self.fileDialog = FileDialog(None, "Save traces", dh, '*.ma') self.fileDialog.setAcceptMode(QtGui.QFileDialog.AcceptSave) self.fileDialog.show() self.fileDialog.fileSelected.connect(self.saveMA) return #arr = MetaArray(self.currentData) ### need to format this with axes and info arr = MetaArray([ self.currentData['Rs'], self.currentData['Rm'], self.currentData['Ih'] ], info=[{ 'name': 'vals', 'cols': [{ 'name': 'Rs', 'units': 'Ohms' }, { 'name': 'Rm', 'units': 'Ohms' }, { 'name': 'Ih', 'units': 'A' }] }, { 'name': 'time', 'units': 's', 'values': self.currentData['time'] }]) arr.write(fileName)