[yt-svn] commit/cookbook: brittonsmith: Moved two simple recipes to the docs.

Bitbucket commits-noreply at bitbucket.org
Thu May 24 20:02:32 PDT 2012


1 new commit in cookbook:


https://bitbucket.org/yt_analysis/cookbook/changeset/1aa9256d8512/
changeset:   1aa9256d8512
user:        brittonsmith
date:        2012-05-25 05:01:50
summary:     Moved two simple recipes to the docs.
affected #:  2 files

diff -r 03d5b459ae12c6e86bfd784fba03c14a1bf62e46 -r 1aa9256d85121f6a09ccf6f0b885a86b55d45c17 recipes/aligned_cutting_plane.py
--- a/recipes/aligned_cutting_plane.py
+++ /dev/null
@@ -1,31 +0,0 @@
-"""
-In this recipe, we create a sphere, calculate its angular momentum vector, then create
-a density slice aligned with that vector.  See :ref:`derived-quantities` and
-:ref:`methods-cutting-planes` for more information.
-"""
-from yt.mods import *
-
-# Load the dataset.
-pf = load("RedshiftOutput0005")
-
-# Create a 5 Mpc radius sphere, centered on the max density.
-sp = pf.h.sphere("max", (5.0, "mpc"))
-
-# Get the angular momentum vector for the sphere.
-L = sp.quantities["AngularMomentumVector"]()
-
-print "Angular momentum vector: %s" % (L)
-
-# Create a plot collection centered on the center of the sphere.
-pc = PlotCollection(pf, center=sp.center)
-
-# Add a slice oriented with our angular momentum vector.
-pc.add_cutting_plane("Density", L)
-
-# Change the width of the image.
-pc.set_width(2.5, 'mpc')
-
-# Save the image.
-# Optionally, give a string as an argument
-# to name files with a keyword.
-pc.save()


diff -r 03d5b459ae12c6e86bfd784fba03c14a1bf62e46 -r 1aa9256d85121f6a09ccf6f0b885a86b55d45c17 recipes/arbitrary_vectors_on_slice.py
--- a/recipes/arbitrary_vectors_on_slice.py
+++ /dev/null
@@ -1,28 +0,0 @@
-"""
-This is a simple recipe to show how to open a dataset, plot a slice
-through it, and add some extra vectors on top.  Here we've used the imaginary
-fields ``magnetic_field_x``, ``magnetic_field_y`` and ``magnetic_field_z``.
-"""
-from yt.mods import *
-
-# Load the dataset.
-pf = load(RedshiftOutput0005)
-
-# Create a plot collection for the dataset.
-# With no additional arguments, the center will be
-# the densest point in the box.
-pc = PlotCollection(pf)
-
-# Make a density slice in the x axis.
-p = pc.add_slice("Density", "x")
-
-# Draw a velocity vector every 16 pixels.
-p.modify["velocity"](factor=16)
-
-# Change the width of the image.
-pc.set_width(2.5, 'mpc')
-
-# Save the image.
-# Optionally, give a string as an argument
-# to name files with a keyword.
-pc.save()

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

--

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