Ich habe eine große Sequenz (1000000) von kleinen Matrizen (32x32) in einer hdf5-Datei gespeichert, jede mit einem Label. Jede dieser Matrizen repräsentiert eine Sensordaten für eine bestimmte Zeit.hdf5 Matrix Lesen mit Python
Ich möchte die Entwicklung für jedes Pixel für eine kleine Zeitscheibe erhalten, die für jede x, y-Position in der Matrix unterschiedlich ist.
Dies dauert mehr Zeit als ich erwarte.
def getPixelSlice (self,xpixel,ypixel,initphoto,endphoto):
#obtain h5 keys inside time range between initphoto and endphoto
valid=np.where(np.logical_and(self.photoList>=initphoto,self.photoList<endphoto))
#look at pixel data in valid frames
evolution = []
#for each valid frame, obtain the data, and append the target pixel to the list.
for frame in valid[0]:
data = self.h5f[str(self.photoList[frame])]
evolution.append(data[ypixel][xpixel])
return evolution,valid