Skip to content

contamination check for zooms broken #98

@dnarayanan

Description

@dnarayanan

on an arepo zoom:


## Largest 10 halos
## from: /blue/narayanan/desika.narayanan/arepo_runs/cosmic_sands/run0_gal0_ml10_baryon/output/Groups/caesar_snapshot_020.hdf5
## 142771 @ z=4.498

 ID    Mdm       Mstar     Mgas      r         fgas   nrho      |  CentralGalMstar
 ---------------------------------------------------------------------------------
 0000  2.78e+13  1.99e+12  4.17e+12  6.60e+03  3.10e-09 |  1.39e+11
 0001  6.95e+12  4.78e+11  1.02e+12  2.29e+03  1.89e-08 |  7.56e+10
 0002  4.25e+12  2.73e+11  6.62e+11  4.87e+03  3.34e-09 |  5.10e+10
 0003  3.42e+12  2.37e+11  5.34e+11  2.32e+03  1.38e-08 |  4.07e+10
 0004  2.59e+12  1.45e+11  4.46e+11  1.37e+03  2.58e-08 |  1.59e+10
 0005  1.99e+12  1.24e+11  3.06e+11  1.52e+03  2.67e-08 |  3.05e+10
 0006  1.54e+12  1.07e+11  2.48e+11  1.93e+03  1.79e-08 |  2.28e+10
 0007  1.37e+12  8.09e+10  2.26e+11  1.18e+03  1.58e-08 |  1.07e+10
 0008  1.25e+12  8.16e+10  1.95e+11  6.93e+02  1.72e-08 |  2.30e+10
 0009  1.17e+12  6.61e+10  1.77e+11  8.10e+02  1.96e-08 |  1.78e+10


In [3]: obj.halos[0].contamination_check()
yt : [INFO     ] 2023-11-06 12:13:12,509 Gathering low-res particles and constructing tree
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[3], line 1
----> 1 obj.halos[0].contamination_check()

File /blue/narayanan/desika.narayanan/conda/envs/py38/lib/python3.8/site-packages/caesar-0.2b0-py3.8-linux-x86_64.egg/caesar/loader.py:411, in Group.contamination_check(self, lowres, search_factor, printer)
    405 def contamination_check(self,
    406                         lowres=[2, 3, 5],
    407                         search_factor=2.5,
    408                         printer=True):
    409     from caesar.zoom_funcs import construct_lowres_tree
--> 411     construct_lowres_tree(self, lowres)
    413     if self.obj_type == 'halo':
    414         halo = self

File /blue/narayanan/desika.narayanan/conda/envs/py38/lib/python3.8/site-packages/caesar-0.2b0-py3.8-linux-x86_64.egg/caesar/zoom_funcs.py:205, in construct_lowres_tree(obj, lowres)
    202 lr_pos  = np.empty((0,3))
    203 lr_mass = np.empty(0)
--> 205 pos_unit  = obj.halos[0].pos.units
    206 mass_unit = obj.halos[0].masses['total_r20'].units
    208 for p in lowres:  # all low res particles to only build tree once

File /blue/narayanan/desika.narayanan/conda/envs/py38/lib/python3.8/site-packages/caesar-0.2b0-py3.8-linux-x86_64.egg/caesar/loader.py:527, in Halo.__getattr__(self, attr)
    523 if attr in self.obj._halo_dicts:
    524     return LazyDict(
    525         self.obj._halo_dicts[attr].keys(),
    526         lambda d: self.obj._halo_dicts[attr][d][self._index])
--> 527 raise AttributeError("'{}' object as no attribute '{}'".format(
    528     self.__class__.__name__, attr))

AttributeError: 'Halo' object as no attribute 'halos'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions