[Yt-svn] yt-commit r1425 - trunk/examples

britton at wrangler.dreamhost.com britton at wrangler.dreamhost.com
Wed Sep 2 21:38:02 PDT 2009


Author: britton
Date: Wed Sep  2 21:38:02 2009
New Revision: 1425
URL: http://yt.spacepope.org/changeset/1425

Log:
Adding simulation halo profiler recipe.


Added:
   trunk/examples/cookbook_simulation_halo_profiler.py

Added: trunk/examples/cookbook_simulation_halo_profiler.py
==============================================================================
--- (empty file)
+++ trunk/examples/cookbook_simulation_halo_profiler.py	Wed Sep  2 21:38:02 2009
@@ -0,0 +1,36 @@
+import yt.extensions.EnzoSimulation as ES
+import yt.extensions.HaloProfiler as HP
+
+es = ES.EnzoSimulation("simulation_parameter_file", initial_redshift=10, final_redshift=0)
+
+# Loop over all dataset in the requested time interval.
+for output in es.allOutputs:
+
+    # Instantiate HaloProfiler for this dataset.
+    hp = HP.HaloProfiler(output['filename'])
+
+    # Add a virialization filter.
+    hp.add_halo_filter(HP.VirialFilter,must_be_virialized=True,
+                       overdensity_field='ActualOverdensity',
+                       virial_overdensity=200,
+                       virial_filters=[['TotalMassMsun','>=','1e14']],
+                       virial_quantities=['TotalMassMsun','RadiusMpc'])
+
+    # Add profile fields.
+    hp.add_profile('CellVolume',weight_field=None,accumulation=True)
+    hp.add_profile('TotalMassMsun',weight_field=None,accumulation=True)
+    hp.add_profile('Density',weight_field=None,accumulation=False)
+    hp.add_profile('Temperature',weight_field='CellMassMsun',accumulation=False)
+    # Make profiles and output filtered halo list to FilteredQuantities.out.
+    hp.make_profiles(filename="FilteredQuantities.out")
+
+    # Add projection fields.
+    hp.add_projection('Density',weight_field=None)
+    hp.add_projection('Temperature',weight_field='Density')
+    hp.add_projection('Metallicity',weight_field='Density')
+    # Make projections for all three axes using the filtered halo list and 
+    # save data to hdf5 files.
+    hp.make_projections(save_cube=True,save_images=True,
+                        halo_list='filtered',axes=[0,1,2])
+
+    del hp



More information about the yt-svn mailing list