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

How to get log spaced bins? #658

Open
danpryer opened this issue Aug 22, 2021 · 2 comments · May be fixed by #669
Open

How to get log spaced bins? #658

danpryer opened this issue Aug 22, 2021 · 2 comments · May be fixed by #669

Comments

@danpryer
Copy link

Hi,
Just doing an FKP based measurement on a data/randoms catalogue and wondering if there was a way to get log-spaced k bins for the P(k) measurement instead of linear, using the ConvolvedFFTPower class? Had a look at the source code but couldn't seem to see an option for this. Any help appreciated.
Cheers,
Dan

@rainwoodman
Copy link
Member

Indeed I don't see how to use log bins neither.

The result is a BinnedStatistic object, which appears to allow non-uniform edges.

Unfortunately the reindex method assumes uniform edges/bins.

I think the algorithm can be extended to deal with non-uniform edges/bins (with cumsum + interp1d + diff) Do you want to take a stab at this? If not I can look at it in a week or two.

@danpryer
Copy link
Author

Thanks for the reply, and no worries if it's going to be complicated, the linear bins are ok for what i'm currently using it for... I would take a stab at it myself but currently pretty busy with thesis writing to be trying to hack the source code of this library, never tried messing with something quite so elaborate 🙃 . For my 'homebrew' estimator code I just specify the kmin/max and the number of bins rather than specifying dk, then the edges/mids are simply
k_edges = np.logspace(np.log10(kmin), np.log10(kmax), nkbin+1)
k_mid = np.exp(0.5*(np.log(kbins[1:]) + np.log(kbins[:-1])))

As you say though.. this would break the reindex function. I guess specifying dk is a better method for when you have linear bins.

I think long term though it would be useful to have log bins, particularly for measuring the very large scales, which upcoming LSS redshift surveys will start to approach with more accuracy.

@surhudm surhudm linked a pull request Aug 30, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants