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

Not able to read the Halo Finder output generated using HOP halo finder.. #5096

Open
chavan-shende opened this issue Jan 10, 2025 · 2 comments

Comments

@chavan-shende
Copy link

chavan-shende commented Jan 10, 2025

What I am trying is to use yt HOP halo finder for identifying halos in a gadget/gizmo snapshot generated for DM cosmological Simulation. I was able to read the file, and then create the HaloCatalog, but when I am trying to load the HaloCatalog I am getting the error...

from yt.extensions.astro_analysis.halo_analysis import HaloCatalog

ds = yt.load("snapshot_012.0.hdf5")

hc = HaloCatalog(data_ds=ds, finder_method="hop")
hc.create()
-------------------------------------------------------------------------------------------------------------
'''  The HaloCatalog was created successfully '''
yt : [INFO     ] 2025-01-09 22:03:43,323 Omega Lambda is 0.0, so we are turning off Cosmology.
yt : [INFO     ] 2025-01-09 22:03:43,324 Assuming length units are in kpc (physical)
yt : [INFO     ] 2025-01-09 22:03:43,354 Parameters: current_time              = 0.39999999999999997
yt : [INFO     ] 2025-01-09 22:03:43,355 Parameters: domain_dimensions         = [1 1 1]
yt : [INFO     ] 2025-01-09 22:03:43,355 Parameters: domain_left_edge          = [0. 0. 0.]
yt : [INFO     ] 2025-01-09 22:03:43,356 Parameters: domain_right_edge         = [100. 100. 100.]
yt : [INFO     ] 2025-01-09 22:03:43,357 Parameters: cosmological_simulation   = 0
yt : [INFO     ] 2025-01-09 22:03:43,398 Allocating for 2.097e+06 particles
Loading particle index: 100%|█████████████████████████| 9/9 [00:00<00:00, 816.61it/s]
yt : [INFO     ] 2025-01-09 22:03:43,944 Initializing HOP
Calling hop... 2097152 1.600e+02
yt : [INFO     ] 2025-01-09 22:04:08,221 Parsing outputs
Copying arrays for 2097152 particles
Building Tree...
Finding Densities...
Finding Densest Neighbors...
Grouping...
Merging Groups...
Writing Output...
All Done!
nSmooth = 65 kd->nActive = 2097152
Calling regroup...
No minimum group size specified.  Assuming 10 particles.
ngroups = 9545
yt : [INFO     ] 2025-01-09 22:04:24,939 Saving 1239 halos: halo_catalogs/snapshot_012/snapshot_012.0.h5.

But now when I am trying to read that HaloCatalog,

halo = yt.load("halo_catalogs/snapshot_012/snapshot_012.0.h5")
-----------------------------------------------------------------------------------------------------------------------
# I am getting an error
AttributeError: 'YTHaloCatalogDataset' object has no attribute 'cosmology'

Please guide me if I am making any mistake...

Edit : I just tried on the dataset provided by yt

galaxy = yt.load_sample("IsolatedGalaxy")
hc = HaloCatalog(data_ds=galaxy, finder_method="hop", )
hc.create()

and I am getting the same "Attribute error" when I am trying to load the HaloCatalog file...

galaxy_halo = yt.load("halo_catalogs/galaxy0030/galaxy0030.0.h5")
---------------------------------------------------------------------------------------------------------------------
'YTHaloCatalogDataset' object has no attribute 'cosmology'
Copy link

welcome bot commented Jan 10, 2025

Hi, and welcome to yt! Thanks for opening your first issue. We have an issue template that helps us to gather relevant information to help diagnosing and fixing the issue.

@neutrinoceros
Copy link
Member

This looks like a bug in yt_astro_analysis, in which case, this issue should be moved there. But I'll let @cphyc and @brittonsmith be the judges.

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