[yt-svn] commit/yt-doc: 3 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Fri May 10 10:35:35 PDT 2013
3 new commits in yt-doc:
https://bitbucket.org/yt_analysis/yt-doc/commits/f563905ef33c/
Changeset: f563905ef33c
User: brittonsmith
Date: 2013-04-12 19:13:53
Summary: Adding documentation on calculating variances for profiles.
Affected #: 1 file
diff -r 1bcd066cb04af677efdda6581d103fbac9273c45 -r f563905ef33c793ac321443fbc8ef7062650b0f3 source/analyzing/generating_processed_data.rst
--- a/source/analyzing/generating_processed_data.rst
+++ b/source/analyzing/generating_processed_data.rst
@@ -141,6 +141,21 @@
.. _generating-line-queries:
+Calculating the Variance of Profiled Fields
++++++++++++++++++++++++++++++++++++++++++++
+
+When calculating average 1D and 2D profiles (when the *weight* keyword is not
+None), the variance within each bin is calculated automatically. A practical
+application for this would be calculating velocity dispersion by profiling the
+average velocity magnitude. The variance values for 1D and 2D profiles are
+accessible as the name of the profiled field followed by *_std*. For the above
+examples, this is done with
+
+.. code-block:: python
+
+ print profile["Temperature_std"]
+ print prof2d["Temperature_std"]
+
Line Queries and Planar Integrals
---------------------------------
https://bitbucket.org/yt_analysis/yt-doc/commits/bf98657bfa9e/
Changeset: bf98657bfa9e
User: brittonsmith
Date: 2013-04-12 20:16:33
Summary: Adding recipe for plotting profile variance.
Affected #: 2 files
diff -r f563905ef33c793ac321443fbc8ef7062650b0f3 -r bf98657bfa9ef251bbbdb86424ecbe2e6294cc23 source/cookbook/profile_with_variance.py
--- /dev/null
+++ b/source/cookbook/profile_with_variance.py
@@ -0,0 +1,30 @@
+from matplotlib import pyplot
+
+from yt.mods import *
+
+# Load the dataset.
+pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+
+# Create a sphere of radius 1000 kpc centered on the max density.
+sphere = pf.h.sphere("max", (1000, "kpc"))
+
+# Calculate and store the bulk velocity for the sphere.
+bulk_velocity = sphere.quantities['BulkVelocity']()
+sphere.set_field_parameter('bulk_velocity', bulk_velocity)
+
+# Create a 1D profile object for profiles over radius
+# and add a velocity profile.
+profile = BinnedProfile1D(sphere, 100, "Radiuskpc", 0.1, 1000.)
+profile.add_fields('VelocityMagnitude')
+
+# Plot the average velocity magnitude.
+pyplot.loglog(profile['Radiuskpc'], profile['VelocityMagnitude'],
+ label='mean')
+# Plot the variance of the velocity madnitude.
+pyplot.loglog(profile['Radiuskpc'], profile['VelocityMagnitude_std'],
+ label='std')
+pyplot.xlabel('r [kpc]')
+pyplot.ylabel('v [cm/s]')
+pyplot.legend()
+
+pyplot.savefig('velocity_profiles.png')
diff -r f563905ef33c793ac321443fbc8ef7062650b0f3 -r bf98657bfa9ef251bbbdb86424ecbe2e6294cc23 source/cookbook/simple_plots.rst
--- a/source/cookbook/simple_plots.rst
+++ b/source/cookbook/simple_plots.rst
@@ -55,6 +55,15 @@
.. yt_cookbook:: simple_radial_profile.py
+Profiles with Variance Values
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This shows how to plot the variance for a 1D profile. In this example, we
+manually create a 1D profile object, which gives us access to the variance
+data.
+
+.. yt_cookbook:: profile_with_variance.py
+
Making Plots of Multiple Fields Simultaneously
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://bitbucket.org/yt_analysis/yt-doc/commits/e51925933f47/
Changeset: e51925933f47
User: brittonsmith
Date: 2013-05-09 23:04:04
Summary: Adding reference to cookbook recipe for profile variance section.
Affected #: 2 files
diff -r bf98657bfa9ef251bbbdb86424ecbe2e6294cc23 -r e51925933f472b148476b2e61cc5ff90f01f5713 source/analyzing/generating_processed_data.rst
--- a/source/analyzing/generating_processed_data.rst
+++ b/source/analyzing/generating_processed_data.rst
@@ -144,12 +144,13 @@
Calculating the Variance of Profiled Fields
+++++++++++++++++++++++++++++++++++++++++++
+See :ref:`cookbook-profile-variance` for an example of the following.
When calculating average 1D and 2D profiles (when the *weight* keyword is not
None), the variance within each bin is calculated automatically. A practical
application for this would be calculating velocity dispersion by profiling the
average velocity magnitude. The variance values for 1D and 2D profiles are
-accessible as the name of the profiled field followed by *_std*. For the above
-examples, this is done with
+accessible as the name of the profiled field followed by ``_std``. For the
+above examples, this is done with
.. code-block:: python
diff -r bf98657bfa9ef251bbbdb86424ecbe2e6294cc23 -r e51925933f472b148476b2e61cc5ff90f01f5713 source/cookbook/simple_plots.rst
--- a/source/cookbook/simple_plots.rst
+++ b/source/cookbook/simple_plots.rst
@@ -55,6 +55,8 @@
.. yt_cookbook:: simple_radial_profile.py
+.. _cookbook-profile-variance:
+
Profiles with Variance Values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Repository URL: https://bitbucket.org/yt_analysis/yt-doc/
--
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