cokelaer/spectrum

Documentation and example for usage of pmtm is incorrect

Closed this issue · 1 comments

In the docstring of function pmtm
https://github.com/cokelaer/spectrum/blob/master/src/spectrum/mtm.py#L111-L112
as well as in the example on readthedocs.io
http://pyspectrum.readthedocs.io/en/latest/ref_mtm.html
the tapers are used as argument 'e' and the eigenvalues as argument 'v'.

But then arguments are interpreted as eigenvalues = 'e' and tapers = 'v' in
https://github.com/cokelaer/spectrum/blob/master/src/spectrum/mtm.py#L164-L165,
such that multiplication of the signal with the tapers crashes due to incompatible shapes.

Order of return arguments of dpss needs to be re-checked as well as reading of arguments to function pmtm.

@gemeinl thanks for reporting those different issues/typos

  • Fixed the documentation in mtm.py
  • this also fixed automatically the oneline documentation on readthedocs
  • Only documentation was wrong. I believe the code does not need to be changed. The code on line L160-L165 uses the e parameter for eigenvalue and v parameter for eigenvectors.
  • Also fixed example in the http://pyspectrum.readthedocs.io/en/latest/ref_mtm.html

the doc is now updated on-line