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

CatalogMesh.to_real_field() output attributes #670

Open
ruilan-zh opened this issue Sep 5, 2022 · 1 comment
Open

CatalogMesh.to_real_field() output attributes #670

ruilan-zh opened this issue Sep 5, 2022 · 1 comment

Comments

@ruilan-zh
Copy link
Contributor

ruilan-zh commented Sep 5, 2022

Hi, I'm having some trouble understanding the output to CatalogMesh.to_real_field().

A relevant code snippet of how I'm using it is as below.

mesh = arraycat.to_mesh(resampler="nearest", BoxSize=boxsize, Nmesh=Nmesh, weight="Mass")
one_plus_delta = mesh.to_real_field()
print(one_plus_delta.attrs)
>> {'shotnoise': 301.4546997993518, 'N': 51832, 'W': 1.7454375300334058e+17, 
'num_per_cell': 42613220948081.195}

Looking at the source code, on line 385 of nbodykit/source/mesh/catalog.py, I'd expect "W2" to appear as an attribute, yet it does not show up. Also, the source code seems to set this to W. Should it not be W2?

toret.attrs['W2'] = W

EDIT: The struck-through issue was corrected by updating to the latest version nbodykit

@rainwoodman
Copy link
Member

I agree with you -- this should have been a W2 to my eyes too. It must be a bug. Would you mind filing a fix?

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