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

Method get_level

pywt/_wavelet_packets.py:1024–1051  ·  view source on GitHub ↗

Returns all nodes from specified level. Parameters ---------- level : int Decomposition `level` from which the nodes will be collected. decompose : bool, optional If set then the method will try to decompose the data up

(self, level, decompose=True)

Source from the content-addressed store, hash-verified

1022 return self.data # return original data
1023
1024 def get_level(self, level, decompose=True):
1025 """
1026 Returns all nodes from specified level.
1027
1028 Parameters
1029 ----------
1030 level : int
1031 Decomposition `level` from which the nodes will be
1032 collected.
1033 decompose : bool, optional
1034 If set then the method will try to decompose the data up
1035 to the specified `level` (default: True).
1036 """
1037 if level > self.maxlevel:
1038 raise ValueError("The level cannot be greater than the maximum"
1039 " decomposition level value (%d)" % self.maxlevel)
1040
1041 result = []
1042
1043 def collect(node):
1044 if node.level == level:
1045 result.append(node)
1046 return False
1047 return True
1048
1049 self.walk(collect, decompose=decompose)
1050
1051 return result

Callers 3

test_collecting_nodes_ndFunction · 0.95
test_wavelet_packet_axesFunction · 0.95

Calls 1

walkMethod · 0.80

Tested by 3

test_collecting_nodes_ndFunction · 0.76
test_wavelet_packet_axesFunction · 0.76