Hi,
I am a little confused as to how to use hop_circles. I tried this but it fails...
from yt.mods import *
fn = "RedshiftOutput0002"
pf = load(fn)
halos = HaloFinder(pf)
halos.modify["hop_circles"](self, hop_output, max_number=None, annotate=False, min_size=20, max_size=10000000, font_size=8, print_halo_size=False, print_halo_mass=False, width=None)
halos.write_out("HopAnalysis.out")
Also, I tried HaloProfiler using http://yt.enzotools.org/doc/cookbook/recipes.html#cookbook-run-halo-profiler. It generated the radial_profiles/ directory with Halo_xxxx_profile.dat files. I am printing here the first few lines from Halo_0000_profile.dat...
# ActualOverdensity CellVolume Density RadiusMpc Temperature TotalMassMsun myweight
2.796608e+03 9.422900e+72 1.407563e-27 1.086579e+00 4.551426e+07 3.320010e+13 3.334302e+12
1.587191e+03 1.884580e+73 3.247510e-28 1.121908e+00 3.392715e+07 3.768487e+13 7.692859e+11
1.213350e+03 3.298015e+73 8.512354e-28 1.158386e+00 3.176131e+07 5.041525e+13 2.016447e+12
9.092253e+02 5.182595e+73 7.672296e-28 1.196051e+00 3.692482e+07 5.936658e+13 1.817450e+12
Is Halo_0000_profile.dat related to the first Halo listed in HopAnalysis.out file ?
What is # ?
What is the meaning of ActualOverdensity ? And units ?
What is the meaning of CellVolume? And units ?
What is Density referring to ? And units ?
What is mywieght ?
I also got the projection/ directory. But I got errors...
yt.lagos INFO 2009-11-24 16:57:52,561 Writing filtered halo list to /usr/rmt_share/scratch95/a/agarwa23/0eV/512/box200/sim1/RD0002/FilteredQuantities.out.
yt INFO 2009-11-24 16:57:53,873 Created plot collection with default plot-center = [0.5, 0.5, 0.5]
yt.lagos INFO 2009-11-24 16:57:53,873 Projecting halo 0000 in region: [0.154949, 0.130009, 0.810277] to [0.183709, 0.158769, 0.839037].
yt INFO 2009-11-24 16:57:53,875 Generating overlap masks for level 0
Reading and masking grids 100% ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 yt INFO 2009-11-24 16:57:53,875 Finished calculating overlap.
Projecting level 0 / 0 100% ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:01 Combining level 0 / 0 100% ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 yt INFO 2009-11-24 16:57:55,640 Level 0 done: 256 final
yt INFO 2009-11-24 16:57:55,896 Generating overlap masks for level 0
Reading and masking grids 100% ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 yt INFO 2009-11-24 16:57:55,896 Finished calculating overlap.
Projecting level 0 / 0 100% ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:01 Combining level 0 / 0 100% ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 yt INFO 2009-11-24 16:57:57,381 Level 0 done: 256 final
yt INFO 2009-11-24 16:57:57,527 Generating overlap masks for level 0
Reading and masking grids 100% ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 yt INFO 2009-11-24 16:57:57,527 Finished calculating overlap.
Traceback (most recent call last): | ETA: --:--:-- File "run_halo_profiler.py", line 37, in <module>
halo_list='filtered',axes=[0,1,2])
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/extensions/HaloProfiler.py", line 474, in make_projections
serialize=False, **kwargs)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/raven/PlotCollection.py", line 262, in add_projection
return self._add_projection(PlotTypes.ProjectionPlot, *args, **kwargs)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/raven/PlotCollection.py", line 285, in _add_projection
center=center, **kwargs)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/BaseDataTypes.py", line 951, in __init__
self._refresh_data()
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/BaseDataTypes.py", line 190, in _refresh_data
self.get_data()
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/BaseDataTypes.py", line 1137, in get_data
my_coords, my_dx, my_fields = self.__project_level(level, fields)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/BaseDataTypes.py", line 1029, in __project_level
g_coords, g_fields = self._project_grid(grid, fields, zero_out)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/BaseDataTypes.py", line 1182, in _project_grid
for field in fields]
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/BaseDataTypes.py", line 40, in save_state
tr = func(self, grid, field)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/BaseDataTypes.py", line 1222, in _get_data_from_grid
return grid[field] * bad_points
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/BaseDataTypes.py", line 199, in __getitem__
self.get_data(key)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/BaseGridType.py", line 96, in get_data
self._generate_field(field)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/BaseGridType.py", line 54, in _generate_field
self.pf.field_info[field].check_available(self)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/FieldInfoContainer.py", line 244, in check_available
validator(data)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/FieldInfoContainer.py", line 337, in __call__
raise NeedsDataField(doesnt_have)
yt.lagos.FieldInfoContainer.NeedsDataField: (['Metal_Density'])
shankar
Hi, I ran HaloProfiler on HaloAnalysis.out and here is the data for the first halo...
# id center[0] center[1] center[2] RadiusMpc TotalMassMsun
0000 0.169329105 0.144388856 0.8246570556 3.1986507886 1.07530961369e+15
Then I ran sum_mass_in_sphere.py with the above center and radius ...
from yt.mods import *
fn = "RedshiftOutput0002"
pf = load(fn)
sp = pf.h.sphere([0.169329105,0.144388856,0.8246570556],3.1986507886/pf["mpc"])
baryon_mass, particle_mass = sp.quantities["TotalQuantity"](
["CellMassMsun", "ParticleMassMsun"], lazy_reader=True)
print "Total mass in sphere is %0.5e (gas = %0.5e / particles = %0.5e)" % \
(baryon_mass + particle_mass, baryon_mass, particle_mass)
And got...
Total mass in sphere is 1.27226e+15 (gas = 2.06890e+14 / particles = 1.06537e+15)
Let me know if the TotalMassMsun should match. Because they don't.
regards
shankar
KU Cosmology
Hi, a couple of questions..
1. I did pc.add_slice("Density",0). Now, I want to plot the halos just for that slice. Is it possible to plot the Halos (from HaloAnalysis.out) slice wise ?
2. I added the Density contours on the slice like...
p.modify["contour"]("Density",ncont=4,take_log=False,clim=(1e-28,1e-30))
Here, if I am correct, the (1e-28,1e-30) range is divided into 4 equal intervals. So, would the contours be (1e-28,7.525e-29,5.05e-29, 2.575e-29, 1e-30) ? And which of these 5 will get plotted (the first 4? or the last 4?)
In any case, I have the plot here... http://drop.io/hop_circles . And it does not show any contour with 1e-29.
regards
shankar
Hi, In the following code, I am getting an error when I use pc.add_projection("Density", ax). But If I specifically use pc.add_projection("Density", 0) then it runs fine. Any idea ?
Code...
from yt.mods import *
pf = load("RedshiftOutput0002")
pc = PlotCollection(pf)
for ax in range(3):
p = pc.add_projection("Density", ax)
p.modify["hop_circles"](halos, max_number=None, annotate=True, min_size=0, max_size=100000000, font_size=8, print_halo_size=True, print_halo_mass=True, width=None)
pc.save()
Error....
Traceback (most recent call last):
File "hop_yt.py", line 20, in <module>
p = pc.add_projection("Density", ax)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/raven/PlotCollection.py", line 262, in add_projection
return self._add_projection(PlotTypes.ProjectionPlot, *args, **kwargs)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/raven/PlotCollection.py", line 285, in _add_projection
center=center, **kwargs)
Shankar
KU cosmology
Hi, I was trying the following 2 methods...
from yt.mods import *
p = plots.get_slice("RedshiftOutput0002", "Density", 0)
p.modify["grids"]()
p.modify["contour"]("Density")
p.save_image("plot1")
from yt.mods import *
pf = load("RedshiftOutput0002")
pc = PlotCollection(pf)
for ax in range(1): pc.add_slice("Density", ax).modify["grids"]()
pc.save("plot2")
I have the plots for them attached.
My simulation box is 200 Mpc/h. I wanted to know what are the default span (length scales) for the 2 methods ?
For plot 1, how can I control the spacing of contours ? And where is plot 1 centered at ?
For plot 2, it is centered at the most dense point in the box. But how can I add density contours ? Also, how to control the spacing ?
regards
shankar
KU Cosmology
Hi,
I ran cookbook_hop_mass_sum.py and it gives me this error...
Traceback (most recent call last):
File "cookbook_hop_mass_sum.py", line 19, in <module>
sphere = halo.get_sphere()
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/HaloFinding.py", line 128, in get_sphere
center, radius=radius)
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/lagos/BaseDataTypes.py", line 1800, in __init__
raise SyntaxError("Your radius is smaller than your finest cell!")
SyntaxError: Your radius is smaller than your finest cell!
How does it matter if halo radius is smaller than finest cell ?
cookbook_hop_mass_sum.py should just spit the baryon mass, dark matter mass and total mass.
# Group Mass # part max densx y z center-of-mass x y z vx vy vz max_r
0 1.009603589e+15 3202 6.803410660e+03 2.691574395e-01 1.892197430e-01 8.293117285e-01 2.701045173e-01 1.889703433e-01 8.276973165e-01 -6.232934392e+06
-2.872425257e+07 1.526929994e+06 1.886896417e-02
shankar
Hi, I am generating Halos using HOP (via yt). I see that the default overdensity is 160. I guess it means 160 particles per cell. But isn't cell size a function of the simulation box volume and the grid ?
For example, if Box=200Mpc and Ngrid=512^3, then cell=(0.390625 Mpc)^3
Isn't 0.390625 Mpc too big for a galaxy ?
What is the calculation behind 160 ?
shankar
KU Cosmology
Hi, Is there a syntax error in the piece below I took from run_halo_profiler.py ...
"""
This is a recipe for making radial profiles and projections of all of the halos
within a cosmological simulation. See :ref:`halo_profiling` for full documentation
of the HaloProfiler.
"""
import yt.extensions.HaloProfiler as HP
# Instantiate HaloProfiler for this dataset.
hp = HP.HaloProfiler("RD0002/RedshiftOutput0002")
I get the following error...
[agarwa23@tg-steele sim1]$ python run_halo_profiler.py
yt.lagos INFO 2009-11-23 14:20:48,664 No HDF4 support
/home/ba01/u118/agarwa23/enzo1/src/yt/doc/yt-x86_64/lib/python2.6/site-packages/IPython/Magic.py:38: DeprecationWarning: the sets module is deprecated
from sets import Set
Traceback (most recent call last):
File "run_halo_profiler.py", line 7, in <module>
import yt.extensions.HaloProfiler as HP
File "/autohome/u118/agarwa23/enzo1/src/yt/yt/extensions/HaloProfiler.py", line 30, in <module>
from HaloFilters import *
ImportError: No module named HaloFilters
shankar