The _eemd method was being applied to get the first IMF, and it was returning a null IMF. That is because the iterator all_IMFs was being used more than once, which would raise a StopIteration exception after its first use. Then, the code wasn't entering the loop to give values to E_IMF because all_IMFs was an empty list. There are 2 ways to fix this problem: (1) simply convert the iterator to a list before the next use, or (2) create two more iterators using itertools.tee. In this commit, option (2) is employed.
The
_eemd
method was being applied to get the first IMF, and it was returning a null IMF. That is because the iteratorall_IMFs
was being used more than once, which would raise a StopIteration exception after its first use. Then, the code wasn't entering the loop to give values to E_IMF because all_IMFs was an empty list. There are 2 ways to fix this problem: (1) simply convert the iterator to a list before the next use, or (2) create two more iterators using itertools.tee. In this commit, option (2) is employed.