[yt-svn] commit/yt-doc: 6 new changesets
Bitbucket
commits-noreply at bitbucket.org
Sat Jul 28 10:22:47 PDT 2012
6 new commits in yt-doc:
https://bitbucket.org/yt_analysis/yt-doc/changeset/1bb783919ffb/
changeset: 1bb783919ffb
user: MatthewTurk
date: 2012-07-28 16:28:36
summary: Adding removal of .done and static files.
affected #: 1 file
diff -r 1c770895089118dc74bf771378db81d15bd2157e -r 1bb783919ffbc45edddf415ebeab9dab266cfa46 Makefile
--- a/Makefile
+++ b/Makefile
@@ -41,6 +41,7 @@
fullclean:
-rm -rf $(BUILDDIR)/*
-rm -rf source/api/generated
+ -rm -f _temp/*.done source/cookbook/_static/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
https://bitbucket.org/yt_analysis/yt-doc/changeset/932f3bb2ea45/
changeset: 932f3bb2ea45
user: ngoldbaum
date: 2012-07-28 10:32:41
summary: Updating multi_width_image to use plot window.
affected #: 1 file
diff -r 1c770895089118dc74bf771378db81d15bd2157e -r 932f3bb2ea45386210a8f4c86367cdce727046f1 source/cookbook/multi_width_image.py
--- a/source/cookbook/multi_width_image.py
+++ b/source/cookbook/multi_width_image.py
@@ -1,32 +1,35 @@
from yt.mods import *
# Load the dataset.
-pf = load("Enzo_64/DD0043/data0043")
+pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
-# Create a plot collection for the dataset.
-# With no additional arguments, the center will be
-# the densest point in the box.
-pc = PlotCollection(pf)
+# Create a slice plot for the dataset. With no additional arguments,
+# the width will be the size of the domain and the center will be the
+# center of the simulation box
+slc = SlicePlot(pf,2,'Density')
# Create a list of a couple of widths and units.
-widths = [(2, "mpc"),
- (1000, 'kpc')]
-
-# Create some density slices.
-pc.add_slice("Density", "x")
-pc.add_slice("Density", "y")
+widths = [(1, 'mpc'),
+ (15, 'kpc')]
# Loop through the list of widths and units.
for width, unit in widths:
# Set the width.
- pc.set_width(width, unit)
+ slc.set_width(width, unit)
- # Get the min and max values within the image and
- # set the limits accordingly.
- vmin = min([p.norm.vmin for p in pc.plots])
- vmax = max([p.norm.vmax for p in pc.plots])
- pc.set_zlim(vmin,vmax)
-
# Write out the image with a unique name.
- pc.save("%s_%010d_%s" % (pf, width, unit))
+ slc.save("%s_%010d_%s" % (pf, width, unit))
+
+zoomFactors = [2,4,5]
+
+# recreate the original slice
+slc = SlicePlot(pf,2,'Density')
+
+for zoomFactor in zoomFactors:
+
+ # zoom in
+ slc.zoom(zoomFactor)
+
+ # Write out the image with a unique name.
+ slc.save("%s_%i" % (pf, zoomFactor))
https://bitbucket.org/yt_analysis/yt-doc/changeset/71c463a79869/
changeset: 71c463a79869
user: ngoldbaum
date: 2012-07-28 10:47:05
summary: Updating the contour example to show how different fields can be
contoured on the same image.
affected #: 1 file
diff -r 932f3bb2ea45386210a8f4c86367cdce727046f1 -r 71c463a79869c5f5f7b3045571280e79a172914f source/cookbook/contours_on_slice.py
--- a/source/cookbook/contours_on_slice.py
+++ b/source/cookbook/contours_on_slice.py
@@ -1,6 +1,13 @@
from yt.mods import * # set up our namespace
+# first add density contours on a density slice
+pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150") # load data
+p = SlicePlot(pf, "x", "Density")
+p.annotate_contour("Density")
+p.save()
+
+# then add temperature contours on the same densty slice
pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150") # load data
p = SlicePlot(pf, "x", "Density")
p.annotate_contour("Temperature")
-p.save()
+p.save(str(pf)+'_T_contour')
https://bitbucket.org/yt_analysis/yt-doc/changeset/f8feb5f45132/
changeset: f8feb5f45132
user: ngoldbaum
date: 2012-07-28 10:50:12
summary: Removing a comment that is no longer true
affected #: 1 file
diff -r 71c463a79869c5f5f7b3045571280e79a172914f -r f8feb5f45132982108f07a3c1e4a6b131b27882d source/cookbook/zoomin_frames.py
--- a/source/cookbook/zoomin_frames.py
+++ b/source/cookbook/zoomin_frames.py
@@ -11,9 +11,7 @@
frame_template = "frame_%05i" # Template for frame filenames
p = SlicePlot(pf, "z", "Density") # Add our slice, along z
-p.annotate_contour("Temperature") # We'll contour in temperature -- this kind
- # of modification can't be done on the command
- # line, so that's why we have the recipe!
+p.annotate_contour("Temperature") # We'll contour in temperature
# What we do now is a bit fun. "enumerate" returns a tuple for every item --
# the index of the item, and the item itself. This saves us having to write
https://bitbucket.org/yt_analysis/yt-doc/changeset/1b786acf8fb7/
changeset: 1b786acf8fb7
user: MatthewTurk
date: 2012-07-28 16:29:03
summary: Merge
affected #: 3 files
diff -r 1bb783919ffbc45edddf415ebeab9dab266cfa46 -r 1b786acf8fb79dda173c166a925f9caa963c6b3a source/cookbook/contours_on_slice.py
--- a/source/cookbook/contours_on_slice.py
+++ b/source/cookbook/contours_on_slice.py
@@ -1,6 +1,13 @@
from yt.mods import * # set up our namespace
+# first add density contours on a density slice
+pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150") # load data
+p = SlicePlot(pf, "x", "Density")
+p.annotate_contour("Density")
+p.save()
+
+# then add temperature contours on the same densty slice
pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150") # load data
p = SlicePlot(pf, "x", "Density")
p.annotate_contour("Temperature")
-p.save()
+p.save(str(pf)+'_T_contour')
diff -r 1bb783919ffbc45edddf415ebeab9dab266cfa46 -r 1b786acf8fb79dda173c166a925f9caa963c6b3a source/cookbook/multi_width_image.py
--- a/source/cookbook/multi_width_image.py
+++ b/source/cookbook/multi_width_image.py
@@ -1,32 +1,35 @@
from yt.mods import *
# Load the dataset.
-pf = load("Enzo_64/DD0043/data0043")
+pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
-# Create a plot collection for the dataset.
-# With no additional arguments, the center will be
-# the densest point in the box.
-pc = PlotCollection(pf)
+# Create a slice plot for the dataset. With no additional arguments,
+# the width will be the size of the domain and the center will be the
+# center of the simulation box
+slc = SlicePlot(pf,2,'Density')
# Create a list of a couple of widths and units.
-widths = [(2, "mpc"),
- (1000, 'kpc')]
-
-# Create some density slices.
-pc.add_slice("Density", "x")
-pc.add_slice("Density", "y")
+widths = [(1, 'mpc'),
+ (15, 'kpc')]
# Loop through the list of widths and units.
for width, unit in widths:
# Set the width.
- pc.set_width(width, unit)
+ slc.set_width(width, unit)
- # Get the min and max values within the image and
- # set the limits accordingly.
- vmin = min([p.norm.vmin for p in pc.plots])
- vmax = max([p.norm.vmax for p in pc.plots])
- pc.set_zlim(vmin,vmax)
-
# Write out the image with a unique name.
- pc.save("%s_%010d_%s" % (pf, width, unit))
+ slc.save("%s_%010d_%s" % (pf, width, unit))
+
+zoomFactors = [2,4,5]
+
+# recreate the original slice
+slc = SlicePlot(pf,2,'Density')
+
+for zoomFactor in zoomFactors:
+
+ # zoom in
+ slc.zoom(zoomFactor)
+
+ # Write out the image with a unique name.
+ slc.save("%s_%i" % (pf, zoomFactor))
diff -r 1bb783919ffbc45edddf415ebeab9dab266cfa46 -r 1b786acf8fb79dda173c166a925f9caa963c6b3a source/cookbook/zoomin_frames.py
--- a/source/cookbook/zoomin_frames.py
+++ b/source/cookbook/zoomin_frames.py
@@ -11,9 +11,7 @@
frame_template = "frame_%05i" # Template for frame filenames
p = SlicePlot(pf, "z", "Density") # Add our slice, along z
-p.annotate_contour("Temperature") # We'll contour in temperature -- this kind
- # of modification can't be done on the command
- # line, so that's why we have the recipe!
+p.annotate_contour("Temperature") # We'll contour in temperature
# What we do now is a bit fun. "enumerate" returns a tuple for every item --
# the index of the item, and the item itself. This saves us having to write
https://bitbucket.org/yt_analysis/yt-doc/changeset/add434c23cc4/
changeset: add434c23cc4
user: MatthewTurk
date: 2012-07-28 19:22:34
summary: Moving the recipe cleaning into "recipeclean". Fixing all compilation errors
that could be fixed. Cleaning up recipes and making a couple of them look at
lot nicer.
affected #: 21 files
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb Makefile
--- a/Makefile
+++ b/Makefile
@@ -41,6 +41,8 @@
fullclean:
-rm -rf $(BUILDDIR)/*
-rm -rf source/api/generated
+
+recipeclean:
-rm -f _temp/*.done source/cookbook/_static/*
html:
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/advanced/reason_architecture.rst
--- a/source/advanced/reason_architecture.rst
+++ b/source/advanced/reason_architecture.rst
@@ -69,6 +69,8 @@
like tie events together, execute commands in yt, and get references to
objects. These are described below in :ref:`adding_widgets`.
+.. _adding_widgets:
+
Adding a new Widget
-------------------
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/analysis_modules/halo_profiling.rst
--- a/source/analysis_modules/halo_profiling.rst
+++ b/source/analysis_modules/halo_profiling.rst
@@ -94,8 +94,7 @@
calculated (used for calculation of radial and tangential velocities. Valid
options are:
- ["bulk", "halo"] (Default): the velocity provided in the halo list
- - ["bulk", "sphere"]: the bulk velocity of the sphere centered on the halo
-center.
+ - ["bulk", "sphere"]: the bulk velocity of the sphere centered on the halo center.
- ["max", field]: the velocity of the cell that is the location of the maximum of the field specified.
* **filter_quantities** (*list*): quantities from the original halo list
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/analysis_modules/light_cone_generator.rst
--- a/source/analysis_modules/light_cone_generator.rst
+++ b/source/analysis_modules/light_cone_generator.rst
@@ -125,8 +125,8 @@
lc.restore_master_solution()
.. note:: All light cone solutions made with the above method will still use
-the same list of datasets. Only the shifting and projection axis will be
-different.
+ the same list of datasets. Only the shifting and projection axis will be
+ different.
Making a Light Cone Projection
------------------------------
@@ -207,4 +207,4 @@
dimensions of the final light cone image that can be used to mask out the
halos in the image. It is left as an exercise to the reader to find a use for
this functionality. This process is somewhat complicated, but not terribly.
-See the recipe in the cookbook for an example of this functionality.
\ No newline at end of file
+See the recipe in the cookbook for an example of this functionality.
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/analyzing/time_series_analysis.rst
--- a/source/analyzing/time_series_analysis.rst
+++ b/source/analyzing/time_series_analysis.rst
@@ -47,7 +47,7 @@
This will create a new time series, populated with the output files ``DD0030``
and ``DD0040``. This object, here called ``ts``, can now be analyzed in bulk.
-Alternately, you can specify a pattern that is supplied to :module:`glob`, and
+Alternately, you can specify a pattern that is supplied to :mod:`glob`, and
those filenames will be sorted and returned. Here is an example:
.. code-block:: python
@@ -74,7 +74,7 @@
see:
* :ref:`parallel-time-series-analysis`
- * The cookbook recipe for :ref:`time-series-analysis`
+ * The cookbook recipe for :ref:`cookbook-time-series-analysis`
* :class:`~yt.data_objects.time_series.TimeSeriesData`
Prepared Time Series Analysis
@@ -158,6 +158,8 @@
to time series data objects. Since ``TimeSeriesData`` objects iterate over
filenames in parallel by default, this allows for transparent parallelization.
+.. _analyzing-an-entire-simulation:
+
Analyzing an Entire Simulation
------------------------------
@@ -251,4 +253,4 @@
* **parallel** (*bool*/*int*): If True, the generated TimeSeriesData will
divide the work such that a single processor works on each dataset. If an
integer is supplied, the work will be divided into that number of jobs.
- Default: True.
\ No newline at end of file
+ Default: True.
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/api/api.rst
--- a/source/api/api.rst
+++ b/source/api/api.rst
@@ -374,7 +374,6 @@
~yt.visualization.plot_modifications.TitleCallback
~yt.visualization.plot_modifications.UnitBoundaryCallback
~yt.visualization.plot_modifications.VelocityCallback
- ~yt.visualization.plot_modifications.VobozCircleCallback
Function List
-------------
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/aligned_cutting_plane.py
--- a/source/cookbook/aligned_cutting_plane.py
+++ b/source/cookbook/aligned_cutting_plane.py
@@ -1,10 +1,12 @@
from yt.mods import *
# Load the dataset.
-pf = load("Enzo_64/DD0043/data0043")
+pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
-# Create a 5 Mpc radius sphere, centered on the max density.
-sp = pf.h.sphere("max", (5.0, "mpc"))
+# Create a 1 kpc radius sphere, centered on the max density. Note that this
+# sphere is very small compared to the size of our final plot, and it has a
+# non-axially aligned L vector.
+sp = pf.h.sphere("max", (1.0, "kpc"))
# Get the angular momentum vector for the sphere.
L = sp.quantities["AngularMomentumVector"]()
@@ -12,5 +14,5 @@
print "Angular momentum vector: %s" % (L)
# Create an OffAxisSlicePlot on the object with the L vector as its normal
-p = OffAxisSlicePlot(pf, L, "Density", sp.center, (25, "mpc"))
+p = OffAxisSlicePlot(pf, L, "Density", sp.center, (120, "kpc"))
p.save()
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/calculating_information.rst
--- a/source/cookbook/calculating_information.rst
+++ b/source/cookbook/calculating_information.rst
@@ -46,7 +46,8 @@
.. yt_cookbook:: simulation_analysis.py
-.. _time-series-analysis:
+
+.. _cookbook-time-series-analysis:
Time Series Analysis
~~~~~~~~~~~~~~~~~~~~
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/complex_plots.rst
--- a/source/cookbook/complex_plots.rst
+++ b/source/cookbook/complex_plots.rst
@@ -47,6 +47,8 @@
.. yt_cookbook:: multi_plot_3x2_FRB.py
+.. _cookbook-offaxis_projection::
+
Projecting Off-Axis
~~~~~~~~~~~~~~~~~~~
@@ -104,6 +106,8 @@
.. yt_cookbook:: radial_profile_styles.py
+.. _cookbook-camera_movement::
+
Moving a Volume Rendering Camera
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/constructing_data_objects.rst
--- a/source/cookbook/constructing_data_objects.rst
+++ b/source/cookbook/constructing_data_objects.rst
@@ -4,14 +4,15 @@
These recipes demonstrate a few uncommon methods of constructing data objects
from a simulation.
+.. _cookbook-find_clumps:
+
Identifying Clumps
~~~~~~~~~~~~~~~~~~
This is a recipe to show how to find topologically connected sets of cells
inside a dataset. It returns these clumps and they can be inspected or
visualized as would any other data object. More detail on this method can be
-found in `astro-ph/0806.1653`. For more information, see
-:ref:`methods-contours`.
+found in `astro-ph/0806.1653`.
.. yt_cookbook:: find_clumps.py
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/cosmological_analysis.rst
--- a/source/cookbook/cosmological_analysis.rst
+++ b/source/cookbook/cosmological_analysis.rst
@@ -4,6 +4,8 @@
These scripts demonstrate some basic and more advanced analysis that can be
performed on cosmological simulations.
+.. _cookbook-halo_finding:
+
Simple Halo Finding
~~~~~~~~~~~~~~~~~~~
This script shows how to create a halo catalog for a single dataset.
@@ -24,6 +26,8 @@
.. yt_cookbook:: halo_particle_plotting.py
+.. _cookbook-halo_mass_info:
+
Halo Information
~~~~~~~~~~~~~~~~
This recipe finds halos and then prints out information about them.
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/multi_plot_3x2.py
--- a/source/cookbook/multi_plot_3x2.py
+++ b/source/cookbook/multi_plot_3x2.py
@@ -28,8 +28,8 @@
# We do this again, but this time we take the 1-index column.
p = pc.add_slice("Temperature", ax, figure=fig, axes=axes[ax][1],
use_colorbar=False)
- p.set_zlim(1e3, 3e4) # Set this so it's the same for all.
p.set_cmap("hot") # a different colormap
+ p.set_zlim(1e3, 1e8) # Set this so it's the same for all.
# Each 'p' is a plot -- this is the Density plot and the Temperature plot.
# Each 'cax' is a colorbar-container, into which we'll put a colorbar.
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/multi_plot_3x2_FRB.py
--- a/source/cookbook/multi_plot_3x2_FRB.py
+++ b/source/cookbook/multi_plot_3x2_FRB.py
@@ -29,7 +29,7 @@
plots = []
for ax in range(3):
sli = pf.h.slice(ax, c[ax])
- frb = sli.to_frb(width, res, center=c)
+ frb = sli.to_frb(width, res)
den_axis = axes[ax][0]
temp_axis = axes[ax][1]
@@ -44,7 +44,7 @@
plots[-1].set_cmap("bds_highcontrast")
plots.append(temp_axis.imshow(frb['Temperature'], norm=LogNorm()))
- plots[-1].set_clim((1e3, 3e4))
+ plots[-1].set_clim((1e3, 1e8))
plots[-1].set_cmap("hot")
# Each 'cax' is a colorbar-container, into which we'll put a colorbar.
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/multi_plot_slice_and_proj.py
--- a/source/cookbook/multi_plot_slice_and_proj.py
+++ b/source/cookbook/multi_plot_slice_and_proj.py
@@ -40,8 +40,8 @@
dens_axes[1].imshow(proj_frb["Density"], origin='lower', norm=LogNorm()),
temp_axes[0].imshow(slc_frb["Temperature"], origin='lower'),
temp_axes[1].imshow(proj_frb["Temperature"], origin='lower'),
- vels_axes[0].imshow(slc_frb["VelocityMagnitude"], origin='lower'),
- vels_axes[1].imshow(proj_frb["VelocityMagnitude"], origin='lower')]
+ vels_axes[0].imshow(slc_frb["VelocityMagnitude"], origin='lower', norm=LogNorm()),
+ vels_axes[1].imshow(proj_frb["VelocityMagnitude"], origin='lower', norm=LogNorm())]
plots[0].set_clim((1.0e-27,1.0e-25))
plots[0].set_cmap("bds_highcontrast")
@@ -51,9 +51,9 @@
plots[2].set_cmap("hot")
plots[3].set_clim((1.0e7,1.0e8))
plots[3].set_cmap("hot")
-plots[4].set_clim((-1.5e7,1.5e7))
+plots[4].set_clim((1e6, 1e8))
plots[4].set_cmap("gist_rainbow")
-plots[5].set_clim((-1.5e7,1.5e7))
+plots[5].set_clim((1e6, 1e8))
plots[5].set_cmap("gist_rainbow")
titles=[r'$\mathrm{Density}\ (\mathrm{g\ cm^{-3}})$',
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/simple_pdf.py
--- a/source/cookbook/simple_pdf.py
+++ b/source/cookbook/simple_pdf.py
@@ -10,10 +10,11 @@
# This is identical to the simple profile, except we add the fractional keyword
# to divide the values in each bin by the sum of all bins. Note that 'unitary'
# is in units of the whole box.
-pc.add_phase_sphere(1.0, "unitary",
+p = pc.add_phase_sphere(1.0, "unitary",
["Density", "Temperature", "CellMassMsun"],
weight=None,
fractional=True)
+p.set_z_label(r"$\mathrm{Mass}\/\mathrm{fraction}$")
# Save the image.
# Optionally, give a string as an argument
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/simple_plots.rst
--- a/source/cookbook/simple_plots.rst
+++ b/source/cookbook/simple_plots.rst
@@ -69,7 +69,7 @@
Accessing and Modifying Plots Directly
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-While often the Plot Window, and its affiliated :ref:`plot-modifications` can
+While often the Plot Window, and its affiliated :ref:`callbacks` can
cover normal use cases, sometimes more direct access to the underlying
Matplotlib engine is necessary. This recipe shows how to modify the plot
window :class:`matplotlib.axes.Axes` object directly.
@@ -84,6 +84,8 @@
.. yt_cookbook:: aligned_cutting_plane.py
+.. _cookbook-simple_volume_rendering:
+
Simple Volume Rendering
~~~~~~~~~~~~~~~~~~~~~~~
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/simple_slice.py
--- a/source/cookbook/simple_slice.py
+++ b/source/cookbook/simple_slice.py
@@ -4,6 +4,6 @@
pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
# Create density slices in all three axes.
-SlicePlot(pf, 'x', "Density", width = (100.0, 'kpc')).save()
-SlicePlot(pf, 'y', "Density", width = (100.0, 'kpc')).save()
-SlicePlot(pf, 'z', "Density", width = (100.0, 'kpc')).save()
+SlicePlot(pf, 'x', "Density", width = (800.0, 'kpc')).save()
+SlicePlot(pf, 'y', "Density", width = (800.0, 'kpc')).save()
+SlicePlot(pf, 'z', "Density", width = (800.0, 'kpc')).save()
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/simple_slice_matplotlib_example.py
--- a/source/cookbook/simple_slice_matplotlib_example.py
+++ b/source/cookbook/simple_slice_matplotlib_example.py
@@ -4,7 +4,7 @@
pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
# Create a slice object
-slc = SlicePlot(pf,'x','Density',width=(100.0,'kpc'))
+slc = SlicePlot(pf,'x','Density',width=(800.0,'kpc'))
# Get a reference to the matplotlib axes object for the plot
ax = slc.plots['Density'].axes
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/simple_slice_with_multiple_fields.py
--- a/source/cookbook/simple_slice_with_multiple_fields.py
+++ b/source/cookbook/simple_slice_with_multiple_fields.py
@@ -5,4 +5,4 @@
# Create density slices of several fields along the x axis
SlicePlot(pf, 'x', ['Density','Temperature','Pressure','VorticitySquared'],
- width = (100.0, 'kpc')).save()
+ width = (800.0, 'kpc')).save()
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/cookbook/simple_volume_rendering.py
--- a/source/cookbook/simple_volume_rendering.py
+++ b/source/cookbook/simple_volume_rendering.py
@@ -11,12 +11,13 @@
mi, ma = dd.quantities["Extrema"]("Density")[0]
# Create a transfer function to map field values to colors.
-tf = ColorTransferFunction((na.log10(mi), na.log10(ma)))
+# We bump up our minimum to cut out some of the background fluid
+tf = ColorTransferFunction((na.log10(mi)+2.0, na.log10(ma)))
-# Add six guassians, evenly spaced between the min and
+# Add three guassians, evenly spaced between the min and
# max specified above with widths of 0.02 and using the
# gist_stern colormap.
-tf.add_layers(6, w=0.02, colormap="gist_stern")
+tf.add_layers(3, w=0.02, colormap="gist_stern")
# Choose a center for the render.
c = [0.5, 0.5, 0.5]
@@ -39,10 +40,8 @@
cam = pf.h.camera(c, L, W, Npixels, tf)
# Create a snapshot.
-# Here, snapshot is an array representing the image.
-image = cam.snapshot()
-
-# Write out the final image and give it a name
-# relating to what our dataset is called.
-write_bitmap(image, "%s_volume_rendered.png" % pf)
-
+# The return value of this function could also be accepted, modified (or saved
+# for later manipulation) and then put written out using write_bitmap.
+# clip_ratio applies a maximum to the function, which is set to that value
+# times the .std() of the array.
+cam.snapshot("%s_volume_rendered.png" % pf, clip_ratio=8.0)
diff -r 1b786acf8fb79dda173c166a925f9caa963c6b3a -r add434c23cc417c3fb41da04bdf605d9e5f383fb source/orientation/making_plots.rst
--- a/source/orientation/making_plots.rst
+++ b/source/orientation/making_plots.rst
@@ -16,7 +16,7 @@
simulation box in a simulation dataset we've opened and stored in the parameter
file object ``pf``. This can be accomplished with the following command:
-.. clode-block:: python
+.. code-block:: python
>>> slc = SlicePlot(pf, 'z', 'Density')
>>> slc.save()
@@ -27,7 +27,7 @@
automatically generated filename. If you don't want the slice object to stick
around, you can accomplish the same thing in one line:
-.. clode-block:: python
+.. code-block:: python
>>> SlicePlot(pf, 'z', 'Density').save()
@@ -99,14 +99,14 @@
arguments as s ``SlicePlot``. For example, one can also adjust the width of
the plot, either after creating the projection plot:
-.. clode-block:: python
+.. code-block:: python
>>> prj = ProjectionPlot(pf, 'z', 'Density')
>>> prj.set_width((10,'kpc'))
or while creating the projection in the first place:
-.. clode-block:: python
+.. code-block:: python
>>> ProjectionPlot(pf, 'z', 'Density', width=(10,'kpc'))
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