bccp / nbodykit

Analysis kit for large-scale structure datasets, the massively parallel way
http://nbodykit.rtfd.io
GNU General Public License v3.0
111 stars 60 forks source link

k=0 included in the first bin, lowering its k value #632

Open eelregit opened 4 years ago

eelregit commented 4 years ago

Using FFTPower, the first bin k value seems to agree with k_fundamental * (0 + 6 + 12*np.sqrt(2)) / 19 to 7 digits, implying the title. This may affect other power spectrum code too?

rainwoodman commented 4 years ago

Yes. The binning is likely following the numpy convention of using [0, k1). I think other codes do not usually have an incentive to follow numpy convention. I don't think the numpy convention is correct for us, as including k=0 is clearly biasing the estimate of the power in the first bin. Would you file a PR? (Probably shall updated the docstring of FFTPower.

eelregit commented 4 years ago

You meant we should switch to (k_i, k_{i+1}] in BinnedStatistic? I can try that. This will also affect other modules that use it. Will it break any assumption they make?

eelregit commented 4 years ago

poke @rainwoodman

rainwoodman commented 4 years ago

I mean only change the first bin to exclude the zero mode -- conceptually this is to always exclude zero mode from binning as the mode contains no information.