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

FKPCatalog failing in absence of N(z) #677

Open parphyam opened 1 year ago

parphyam commented 1 year ago

Hi,

I am using the FKPCatalogue object for power spectrum of a survey box. On doing fkp = FKPCatalog(data, randoms), I am getting an error ValueError: Column 'NZ' is not defined in 'data'. The catalogue is an hdf5 catalogue and I am using the method outlined here.

Surprisingly, I am receiving the same error when following the above tutorial verbatim. As per the API documentation, N(z) is an optional parameter (as described here, so why is this happening?

I am using the version 0.3.15 of the code, installed in a conda environment (following these instructions).

Any help/suggestion is appreciated. Thank you.

dyliu0312 commented 15 hours ago

I found that issues too, but it's easy to handle, simply add the 'NZ' dataset into 'data' and 'random' before using fkp.

# add the n(z) columns first
data['randoms/NZ'] = nofz(randoms['z'])
randoms['data/NZ'] = nofz(data['z'])
# and then 
# initialize the FKP source
fkp = FKPCatalog(data, randoms)