[yt-svn] commit/yt: MatthewTurk: Merged in hegan/yt/yt-3.0 (pull request #888)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu May 8 16:56:19 PDT 2014


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/91fafe916170/
Changeset:   91fafe916170
Branch:      yt-3.0
User:        MatthewTurk
Date:        2014-05-09 01:56:11
Summary:     Merged in hegan/yt/yt-3.0 (pull request #888)

Cookbook Recipe Updates
Affected #:  11 files

diff -r 721b37f6b4378a5487d0208dfd0897eace5db5a1 -r 91fafe9161705f1bfc26276508b19cdfcbb2d476 doc/source/cookbook/halo_finding.py
--- a/doc/source/cookbook/halo_finding.py
+++ /dev/null
@@ -1,10 +0,0 @@
-"""
-This script shows the simplest way of getting halo information.  For more
-information, see :ref:`halo_finding`.
-"""
-import yt
-
-ds = yt.load("Enzo_64/DD0043/data0043")
-
-halos = yt.HaloFinder(ds)
-halos.write_out("%s_halos.txt" % ds)

diff -r 721b37f6b4378a5487d0208dfd0897eace5db5a1 -r 91fafe9161705f1bfc26276508b19cdfcbb2d476 doc/source/cookbook/halo_mass_info.py
--- a/doc/source/cookbook/halo_mass_info.py
+++ /dev/null
@@ -1,34 +0,0 @@
-"""
-Title: Halo Mass Info
-Description: This recipe finds halos and then prints out information about
-             them.  Note that this recipe will take advantage of multiple CPUs
-             if executed with mpirun and supplied the --parallel command line
-             argument.  
-Outputs: [RedshiftOutput0006_halo_info.txt]
-"""
-from yt.mods import *
-
-fn = "Enzo_64/RD0006/RedshiftOutput0006" # parameter file to load
-pf = load(fn) # load data
-
-# First we run our halo finder to identify all the halos in the dataset.  This
-# can take arguments, but the default are pretty sane.
-halos = HaloFinder(pf)
-
-f = open("%s_halo_info.txt" % pf, "w")
-
-# Now, for every halo, we get the baryon data and examine it.
-for halo in halos:
-    # The halo has a property called 'get_sphere' that obtains a sphere
-    # centered on the point of maximum density (or the center of mass, if that
-    # argument is supplied) and with the radius the maximum particle radius of
-    # that halo.
-    sphere = halo.get_sphere()
-    # We use the quantities[] method to get the total mass in baryons and in
-    # particles.
-    baryon_mass, particle_mass = sphere.quantities["TotalQuantity"](
-            ["cell_mass", "particle_mass"])
-    # Now we print out this information, along with the ID.
-    f.write("Total mass in HOP group %s is %0.5e (gas = %0.5e / particles = %0.5e)\n" % \
-            (halo.id, baryon_mass + particle_mass, baryon_mass, particle_mass))
-f.close()

diff -r 721b37f6b4378a5487d0208dfd0897eace5db5a1 -r 91fafe9161705f1bfc26276508b19cdfcbb2d476 doc/source/cookbook/halo_particle_plotting.py
--- a/doc/source/cookbook/halo_particle_plotting.py
+++ /dev/null
@@ -1,14 +0,0 @@
-"""
-This is a simple mechanism for overplotting the particles belonging only to
-halos.  For more information, see :ref:`halo_finding`.
-"""
-from yt.mods import * # set up our namespace
-
-pf = load("Enzo_64/DD0043/data0043")
-
-halos = HaloFinder(pf)
-
-p = ProjectionPlot(pf, "x", "density")
-p.annotate_hop_circles(halos)
-p.annotate_hop_particles(halos, max_number=100)
-p.save()

diff -r 721b37f6b4378a5487d0208dfd0897eace5db5a1 -r 91fafe9161705f1bfc26276508b19cdfcbb2d476 doc/source/cookbook/halo_plotting.py
--- a/doc/source/cookbook/halo_plotting.py
+++ b/doc/source/cookbook/halo_plotting.py
@@ -4,10 +4,13 @@
 """
 from yt.mods import * # set up our namespace
 
-pf = load("Enzo_64/DD0043/data0043")
+data_pf = load("Enzo_64/RD0006/RedshiftOutput0006")
 
-halos = HaloFinder(pf)
+halo_pf = load('rockstar_halos/halos_0.0.bin')
 
-p = ProjectionPlot(pf, "z", "density")
-p.annotate_hop_circles(halos)
+hc - HaloCatalog(halos_pf = halo_pf)
+hc.load()
+
+p = ProjectionPlot(pf, "x", "density")
+p.annotate_halos(hc)
 p.save()

diff -r 721b37f6b4378a5487d0208dfd0897eace5db5a1 -r 91fafe9161705f1bfc26276508b19cdfcbb2d476 doc/source/cookbook/simple_contour_in_slice.py
--- a/doc/source/cookbook/simple_contour_in_slice.py
+++ b/doc/source/cookbook/simple_contour_in_slice.py
@@ -4,20 +4,20 @@
 pf = load("Sedov_3d/sedov_hdf5_chk_0002")
 
 # Make a traditional slice plot.
-sp = SlicePlot(pf,"x","dens")
+sp = SlicePlot(pf,"x","density")
 
 # Overlay the slice plot with thick red contours of density.
-sp.annotate_contour("dens", ncont=3, clim=(1e-2,1e-1), label=True,
+sp.annotate_contour("density", ncont=3, clim=(1e-2,1e-1), label=True,
                     plot_args={"colors": "red",
                                "linewidths": 2})
 
 # What about some nice temperature contours in blue?
-sp.annotate_contour("temp", ncont=3, clim=(1e-8,1e-6), label=True,
+sp.annotate_contour("temperature", ncont=3, clim=(1e-8,1e-6), label=True,
                     plot_args={"colors": "blue",
                                "linewidths": 2})
 
 # This is the plot object.
-po = sp.plots["dens"]
+po = sp.plots["density"]
 
 # Turn off the colormap image, leaving just the contours.
 po.axes.images[0].set_visible(False)

diff -r 721b37f6b4378a5487d0208dfd0897eace5db5a1 -r 91fafe9161705f1bfc26276508b19cdfcbb2d476 doc/source/cookbook/simple_off_axis_projection.py
--- a/doc/source/cookbook/simple_off_axis_projection.py
+++ b/doc/source/cookbook/simple_off_axis_projection.py
@@ -11,7 +11,7 @@
 # Get the angular momentum vector for the sphere.
 L = sp.quantities["AngularMomentumVector"]()
 
-print "Angular momentum vector: %s" % (L)
+print "Angular momentum vector: {0}".format(L)
 
 # Create an OffAxisSlicePlot on the object with the L vector as its normal
 p = OffAxisProjectionPlot(pf, L, "density", sp.center, (25, "kpc"))

diff -r 721b37f6b4378a5487d0208dfd0897eace5db5a1 -r 91fafe9161705f1bfc26276508b19cdfcbb2d476 doc/source/cookbook/simple_slice_with_multiple_fields.py
--- a/doc/source/cookbook/simple_slice_with_multiple_fields.py
+++ b/doc/source/cookbook/simple_slice_with_multiple_fields.py
@@ -4,5 +4,5 @@
 pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
 
 # Create density slices of several fields along the x axis
-SlicePlot(pf, 'x', ['density','temperature','Pressure','VorticitySquared'], 
+SlicePlot(pf, 'x', ['density','temperature','pressure','vorticity_squared'], 
           width = (800.0, 'kpc')).save()

diff -r 721b37f6b4378a5487d0208dfd0897eace5db5a1 -r 91fafe9161705f1bfc26276508b19cdfcbb2d476 doc/source/cookbook/thin_slice_projection.py
--- a/doc/source/cookbook/thin_slice_projection.py
+++ b/doc/source/cookbook/thin_slice_projection.py
@@ -17,10 +17,9 @@
 right_corner = pf.domain_right_edge
 
 # Now adjust the size of the region along the line of sight (x axis).
-depth = 10.0 # in Mpc
-left_corner[0] = center[0] - 0.5 * depth / pf.units['mpc']
-left_corner[0] = center[0] + 0.5 * depth / pf.units['mpc']
-
+depth = pf.quan(10.0,'Mpc') 
+left_corner[0] = center[0] - 0.5 * depth 
+left_corner[0] = center[0] + 0.5 * depth 
 # Create the region
 region = pf.region(center, left_corner, right_corner)
 

diff -r 721b37f6b4378a5487d0208dfd0897eace5db5a1 -r 91fafe9161705f1bfc26276508b19cdfcbb2d476 doc/source/yt3differences.rst
--- a/doc/source/yt3differences.rst
+++ b/doc/source/yt3differences.rst
@@ -27,7 +27,7 @@
     FieldName)``.
   * Previously, yt would use "Enzo-isms" for field names.  We now very
     specifically define fields as lowercase with underscores.  For instance,
-    what used to be ``VelocityMagnitude`` would not be ``velocity_magnitude``.
+    what used to be ``VelocityMagnitude`` would now be ``velocity_magnitude``.
   * Particles are either named by their type or default to the type ``io``.
   * Axis names are now at the *end* of field names, not the beginning.
     ``x-velocity`` is now ``velocity_x``.

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list