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

Function _match_coeff_dims

pywt/_multilevel.py:445–458  ·  view source on GitHub ↗
(a_coeff, d_coeff_dict)

Source from the content-addressed store, hash-verified

443
444
445def _match_coeff_dims(a_coeff, d_coeff_dict):
446 # For each axis, compare the approximation coeff shape to one of the
447 # stored detail coeffs and truncate the last element along the axis
448 # if necessary.
449 if a_coeff is None:
450 return None
451 if not d_coeff_dict:
452 return a_coeff
453 d_coeff = d_coeff_dict[next(iter(d_coeff_dict))]
454 size_diffs = np.subtract(a_coeff.shape, d_coeff.shape)
455 if np.any((size_diffs < 0) | (size_diffs > 1)):
456 print(size_diffs)
457 raise ValueError("incompatible coefficient array sizes")
458 return a_coeff[tuple(slice(s) for s in d_coeff.shape)]
459
460
461def waverecn(coeffs, wavelet, mode='symmetric', axes=None):

Callers 1

waverecnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected