Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two sided spectra #29

Open
apatlpo opened this issue Jun 22, 2019 · 4 comments
Open

two sided spectra #29

apatlpo opened this issue Jun 22, 2019 · 4 comments

Comments

@apatlpo
Copy link

apatlpo commented Jun 22, 2019

I would need for my applications to keep two-sided spectra.
This doesn't seem to be implemented.
Do you think it would be possible to modify the library to do that ?

@krischer
Copy link
Owner

What do you mean by two sided spectra? Also the negative frequencies? The Python wrapper currently only wraps the single and double precision floating point variants of the spectral computation.

But a single precision complex version does exist on the fortran side:

subroutine mtspec_c (npts,dt,x,tbp,kspec,nf,freq,spec, &

It should be fairly simple to add to the existing wrappers. I'm a bit short on time recently so I cannot tackle it but I'm happy to merge a PR and help along the way!

@apatlpo
Copy link
Author

apatlpo commented Jun 24, 2019

I mean the spectrum of a complex variable, for which we need to retain negative frequencies (as they will differ from positive ones).

What would the steps to wrap mtspec_c ?

Would you have another wrapping that could be used as a template?

@krischer
Copy link
Owner

I think it should just be two steps or so:

  1. Add a complex64 variant here:

    class _MtspecType(object):
    (Basically maps numpy dtype to the corresponding fortran subroutine).

  2. Maybe that is it already. If not: Fiddle a bit here:

    # Verbose mode on or off.

Testing should also be fairly simple: Passing in data with all complex values set to zero should result in a symmetric spectrum which can be tested against the already existing wrappers.

@apatlpo
Copy link
Author

apatlpo commented Jun 25, 2019

started working on it: #30
it is not as simple as I hoped for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants