@@ -196,6 +196,7 class MergeH5(object): | |||
|
196 | 196 | |
|
197 | 197 | self.fill_dataIn(data, self.ch_dataIn[ch]) |
|
198 | 198 | |
|
199 | ||
|
199 | 200 | return |
|
200 | 201 | |
|
201 | 202 | |
@@ -235,14 +236,33 class MergeH5(object): | |||
|
235 | 236 | if data[attr].ndim == 1: |
|
236 | 237 | setattr(dataIn, attr, data[attr][:]) |
|
237 | 238 | else: |
|
238 | setattr(dataIn, attr, data[attr][:,:]) | |
|
239 | setattr(dataIn, attr, numpy.squeeze(data[attr][:,:])) | |
|
239 | 240 | #print("shape in", dataIn.data_spc.shape, len(dataIn.data_spc)) |
|
240 | 241 | if dataIn.data_spc.ndim > 3: |
|
241 | 242 | dataIn.data_spc = dataIn.data_spc[0] |
|
242 | 243 | #print("shape in", dataIn.data_spc.shape) |
|
243 | if self.blocksPerFile == None: | |
|
244 | self.blocksPerFile = len(dataIn.data_spc) #blocks, ch, fft, hei | |
|
245 | print("blocks per file: ", self.blocksPerFile) | |
|
244 | ||
|
245 | ||
|
246 | ||
|
247 | def getBlocksPerFile(self): | |
|
248 | b = numpy.zeros(self.nChannels) | |
|
249 | for i in range(self.nChannels): | |
|
250 | b[i] = self.ch_dataIn[i].data_spc.shape[0] #number of blocks | |
|
251 | ||
|
252 | self.blocksPerFile = int(b.min()) | |
|
253 | iresh_ch = numpy.where(b > self.blocksPerFile)[0] | |
|
254 | if len(iresh_ch) > 0: | |
|
255 | for ich in iresh_ch: | |
|
256 | for i in range(len(self.dataList)): | |
|
257 | if hasattr(self.ch_dataIn[ich], self.dataList[i]): | |
|
258 | # print("reshaping ", self.dataList[i]) | |
|
259 | # print(getattr(self.ch_dataIn[ich], self.dataList[i]).shape) | |
|
260 | dataAux = getattr(self.ch_dataIn[ich], self.dataList[i]) | |
|
261 | setattr(self.ch_dataIn[ich], self.dataList[i], None) | |
|
262 | setattr(self.ch_dataIn[ich], self.dataList[i], dataAux[0:self.blocksPerFile]) | |
|
263 | # print(getattr(self.ch_dataIn[ich], self.dataList[i]).shape) | |
|
264 | else: | |
|
265 | return | |
|
246 | 266 | |
|
247 | 267 | |
|
248 | 268 | def getLabel(self, name, x=None): |
@@ -317,7 +337,6 class MergeH5(object): | |||
|
317 | 337 | ints = [data.nIncohInt for data in self.ch_dataIn] |
|
318 | 338 | self.dataOut.nIncohInt = numpy.stack(ints, axis=1) |
|
319 | 339 | |
|
320 | print("nIncohInt 1: ",self.dataOut.nIncohInt.shape) | |
|
321 | 340 | |
|
322 | 341 | if self.dataOut.nIncohInt.ndim > 3: |
|
323 | 342 | aux = self.dataOut.nIncohInt |
@@ -334,7 +353,6 class MergeH5(object): | |||
|
334 | 353 | if (self.dataOut.nIncohInt.shape)[0]==self.nChannels: ## ch,blocks, hei |
|
335 | 354 | self.dataOut.nIncohInt = numpy.swapaxes(self.dataOut.nIncohInt, 0, 1) ## blocks,ch, hei |
|
336 | 355 | |
|
337 | print("nIncohInt 2: ", self.dataOut.nIncohInt.shape) | |
|
338 | 356 | #print("utcTime: ", time.shape) |
|
339 | 357 | #print("data_spc ",self.dataOut.data_spc.shape) |
|
340 | 358 | pairsList = [pair for pair in itertools.combinations(self.channelList, 2)] |
@@ -487,6 +505,11 class MergeH5(object): | |||
|
487 | 505 | #print("Opening file: ",filename) |
|
488 | 506 | self.readFile(fp,ch) |
|
489 | 507 | fp.close() |
|
508 | ||
|
509 | if self.blocksPerFile == None: | |
|
510 | self.getBlocksPerFile() | |
|
511 | print("blocks per file: ", self.blocksPerFile) | |
|
512 | ||
|
490 | 513 | self.getDataOut() |
|
491 | 514 | name = name[-16:] |
|
492 | 515 | #print("Final name out: ", name) |
@@ -2120,8 +2120,12 class IncohInt(Operation): | |||
|
2120 | 2120 | dataOut.data_spc, |
|
2121 | 2121 | dataOut.data_cspc, |
|
2122 | 2122 | dataOut.data_dc) |
|
2123 | ||
|
2123 | 2124 | self.incohInt += dataOut.nIncohInt |
|
2125 | ||
|
2126 | if isinstance(dataOut.data_outlier,numpy.ndarray) or isinstance(dataOut.data_outlier,int) or isinstance(dataOut.data_outlier, float): | |
|
2124 | 2127 | self.nOutliers += dataOut.data_outlier |
|
2128 | ||
|
2125 | 2129 | if self.__dataReady: |
|
2126 | 2130 | #print("prof: ",dataOut.max_nIncohInt,self.__profIndex) |
|
2127 | 2131 | dataOut.data_spc = avgdata_spc |
General Comments 0
You need to be logged in to leave comments.
Login now