MCPcopy Create free account
hub / github.com/PyWavelets/pywt / _reconstruct

Method _reconstruct

pywt/_wavelet_packets.py:452–471  ·  view source on GitHub ↗
(self, update)

Source from the content-addressed store, hash-verified

450 return self._get_node(self.A), self._get_node(self.D)
451
452 def _reconstruct(self, update):
453 data_a, data_d = None, None
454 node_a, node_d = self._get_node(self.A), self._get_node(self.D)
455
456 if node_a is not None:
457 data_a = node_a.reconstruct() # TODO: (update) ???
458 if node_d is not None:
459 data_d = node_d.reconstruct() # TODO: (update) ???
460
461 if data_a is None and data_d is None:
462 raise ValueError("Node is a leaf node and cannot be reconstructed"
463 " from subnodes.")
464 else:
465 rec = idwt(data_a, data_d, self.wavelet, self.mode, axis=self.axes)
466 if self._data_shape is not None and (
467 rec.shape != self._data_shape):
468 rec = rec[tuple([slice(sz) for sz in self._data_shape])]
469 if update:
470 self.data = rec
471 return rec
472
473
474class Node2D(BaseNode):

Callers

nothing calls this directly

Calls 3

idwtFunction · 0.90
_get_nodeMethod · 0.45
reconstructMethod · 0.45

Tested by

no test coverage detected