Commits

Matthew Turk committed a27de1d Merge

Merging in PR #72.

Comments (0)

Files changed (18)

 \settowidth{\MyLen}{\texttt{multicol} }
 \texttt{slc = SlicePlot(pf, {\it axis}, {\it field}, {\it center=}, {\it width=}, {\it weight\_field=}, {\it additional parameters})} \textemdash\ Make a slice plot
 perpendicular to {\it axis} of {\it field} weighted by {\it weight\_field} at (code-units) {\it center} with 
-{\it width} in code units or a (value, unit) tuple. Hint: try {\it SlicePlot?} to see additional parameters.\\
+{\it width} in code units or a (value, unit) tuple. Hint: try {\it SlicePlot?} in IPython to see additional parameters.\\
 \texttt{slc.save({\it file\_prefix})} \textemdash\ Save the slice to a png with name prefix {\it file\_prefix}.
 \texttt{.save()} works similarly for the commands below.\\
 
 
 \subsection{Plot Annotations}
 \settowidth{\MyLen}{\texttt{multicol} }
-Plot callbacks are functions itemized in a registry that is attached to every plot object. They can be accessed and then called like \texttt{ prj.modify["velocity"](factor=16,normalize=False)}. Most callbacks also accept a {\it plot\_args} dict that is fed to matplotlib annotator. \\
+Plot callbacks are functions itemized in a registry that is attached to every plot object. They can be accessed and then called like \texttt{ prj.modify["velocity"](factor=16, normalize=False)}. Most callbacks also accept a {\it plot\_args} dict that is fed to matplotlib annotator. \\
 \texttt{velocity({\it factor=},{\it scale=},{\it scale\_units=}, {\it normalize=})} \textemdash\ Uses field "x-velocity" to draw quivers\\
 \texttt{magnetic\_field({\it factor=},{\it scale=},{\it scale\_units=}, {\it normalize=})} \textemdash\ Uses field "Bx" to draw quivers\\
 \texttt{quiver({\it field\_x},{\it field\_y},{\it factor=},{\it scale=},{\it scale\_units=}, {\it normalize=})} \\
 
 \end{multicols}
 
-\end{document}
+\end{document}

source/advanced/index.rst

    external_analysis
    developing
    testing
+   creating_frontend
    reason_architecture

source/advanced/parallel_computation.rst

 Currently, YT is able to
 perform the following actions in parallel:
 
- * Projections (:ref:`how-to-make-projections`)
- * Slices (:ref:`how-to-make-slices`)
- * Cutting planes (oblique slices) (:ref:`how-to-make-oblique-slices`)
+ * Projections (:ref:`projection-plots`)
+ * Slices (:ref:`slice-plots`)
+ * Cutting planes (oblique slices) (:ref:`off-axis-slices`)
  * Derived Quantities (total mass, angular momentum, etc) (:ref:`creating_derived_quantities`,
    :ref:`derived-quantities`)
  * 1-, 2-, and 3-D profiles (:ref:`generating-profiles-and-histograms`)
  * Merger tree (:ref:`merger_tree`)
  * Two point functions (:ref:`two_point_functions`)
  * Volume rendering (:ref:`volume_rendering`)
- * Radial column density
- * Isocontours & flux calculations
+ * Radial column density (:ref: `radial-column-density`)
+ * Isocontours & flux calculations (:ref: `extracting-isocontour-information`)
 
 This list covers just about every action YT can take!  Additionally, almost all
 scripts will benefit from parallelization without any modification.  The goal
 
 Will execute the finding of the maximum density and the projection in parallel
 if launched in parallel.
-Note that the usual "from yt.mods import *" has been replaced by 
-"from yt.pmods import *".
+Note that the usual ``from yt.mods import *`` has been replaced by 
+``from yt.pmods import *``.
 The pmods option gives the same result as reglar mods, but it can speed up
 the initialization process when running in parallel.
 To do so, at the command line you would execute

source/analysis_modules/index.rst

    planning_cosmology_simulations
    absorption_spectrum
    star_analysis
+   simulated_observations
    halo_mass_function
    two_point_functions
    merger_tree

source/analysis_modules/simulated_observations.rst

+.. _simulated_observations:
+
+Generating Simulated Observations
+=================================
+
+yt has several facilities for generating simulated observations.  Each of these
+comes with several caveats, and none should be expected to produce a completely
+finished product.  You should investigate each option carefully and determine
+which, if any, will deliver the type of observation you are interested in.
+
+
+
+X-ray Observations
+++++++++++++++++++
+
+Under the assumption of optically thin gas, projections can be made
+using emissivity to generated simulated observations.  yt includes a
+method for handling output from CLOUDY in the ROCO (Smith et al 2008)
+format, and generating integrated emissivity over given energy ranges.
+
+Caveats: The ROCO format for input requires some non-trivial handling
+of CLOUDY output.
+
+= SED Generation and Deposition =
+
+Using BC03 models for stellar population synthesis, star particles in
+a given calculation can be assigned an integrated flux for a specific
+bandpass.  These fluxes can then be combined using either projections
+or volume rendering.  This can use CIC interpolation to deposit a
+total flux into each cell (which should be flux-conserving, modulo a
+multiplicative factor not currently included) which is then either
+projected or volume rendered.
+
+Caveats: The deposition method produces far too washed out and murky
+results.  The multiplicative factor is not currently set correctly
+universally.
+
+= Thermal Gas Emission =
+
+Applying a black body spectrum to the thermal content of the gas, we
+can volume render the domain and apply absorption based on broad
+arguments of scattering.  One could theoretically include star
+particles as point sources in this, using recent changes to the volume
+renderer.
+
+Caveats: Scattering that results in re-emission is completely
+neglected, such as Halpha emission.  Scattering that results in just
+attenuating the emission is set in an ad hoc fashion.  Emission from
+point sources, if included at all, is included in a non-conservative
+fashion.
+
+= Export to Sunrise =
+
+Data can be exported to Sunrise for simulated observation generation.
+
+Caveats: This process is poorly documented.
+
+= SZ Compton y and SZ Kinetic Maps =
+
+Future Directions
+-----------------
+
+* ALMA maps
+* 21cm observations
+* Applying PSFs
+* 

source/analyzing/loading_data.rst

 .. loading-amr-data:
 
 Generic AMR Data
----------------
+----------------
 
 It is possible to create native ``yt`` parameter file from Python's dictionary
 that describes set of rectangular patches of data of possibly varying

source/api/api.rst

 .. autosummary::
    :toctree: generated/
 
-   ~yt.analysis_modules.light_cone.light_cone.LightCone
+   ~yt.analysis_modules.cosmological_observation.light_cone.light_cone.LightCone
 
 Volume Rendering
 ^^^^^^^^^^^^^^^^
 Image Panning and Scanning
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-See also :ref:`image-panner`.
-
-
 .. autosummary::
    :toctree: generated/
 

source/changelog.rst

  * Multi-band image writing (see :ref:`image_writer`)
  * Parallel halo merger tree (see :ref:`merger_tree`)
  * Parallel structure function generator (see :ref:`two_point_functions`)
- * Image pan and zoom object and display widget (see :ref:`image-panner`)
+ * Image pan and zoom object and display widget.
  * Parallel volume rendering (see :ref:`volume_rendering`)
  * Multivariate volume rendering, allowing for multiple forms of emission and
    absorption, including approximate scattering and Planck emissions. (see

source/cookbook/index.rst

    complex_plots
    cosmological_analysis
    constructing_data_objects
-   advanced

source/cookbook/offaxis_projection_colorbar.py

File contents unchanged.

source/cookbook/simple_off_axis_projection.py

+from yt.mods import *
+
+# Load the dataset.
+pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
+
+# 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", (15.0, "kpc"))
+
+# Get the angular momentum vector for the sphere.
+L = sp.quantities["AngularMomentumVector"]()
+
+print "Angular momentum vector: %s" % (L)
+
+# Create an OffAxisSlicePlot on the object with the L vector as its normal
+p = OffAxisProjectionPlot(pf, L, "Density", [0.5,0.5,0.5], (25, "kpc"))
+p.save()

source/cookbook/simple_plots.rst

 
 .. yt_cookbook:: aligned_cutting_plane.py
 
+.. _cookbook-simple-off-axis-projection:
+
+Off-Axis Projection
+~~~~~~~~~~~~~~~~~~~
+
+Here we see how to make a off axis projection through a dataset.
+
+.. yt_cookbook:: simple_off_axis_projection.py
+
 .. _cookbook-simple_volume_rendering:
 
 Simple Volume Rendering

source/getting_involved/index.rst

 -----------------------
 
 Contributing code is another excellent way to participate -- whether it's
-bug fixes, new features, analysis modules, or a new code frontend.
+bug fixes, new features, analysis modules, or a new code frontend.  See 
+:ref:`creating_frontend` for more details.
 
 The process is pretty simple: fork on BitBucket, make changes, issue a pull
 request.  We can then go back and forth with comments in the pull request, but

source/visualizing/index.rst

    manual_plotting
    volume_rendering
    streamlines
-

source/visualizing/plots.rst

 :class:`~yt.visualization.plot_window.PlotWindow` interface is useful for
 taking a quick look at simulation outputs.  The ``PlotCollection`` interface
 was previously used to generate all types of plots, but is now primarily left
-as a mechanism for easily generating profile and phase plots.
+as a mechanism for generating profile and phase plots.
 
 .. _simple-inspection:
 
-Simple Data Inspection
-----------------------
+Visual Inspection
+-----------------
 
 If you need to take a quick look at a single simulation output, ``yt``
 provides the ``PlotWindow`` interface for generating annotated 2D
 is requested of it -- for instance, when the width or field is changed
 -- this high-resolution data is then pixelized and placed in a buffer
 of fixed size. This is accomplished behind the scenes using
-:class:`yt.visualization.fixed_resolution.FixedResolutionBuffer`.
-``PlotWindow`` plots expose the underlying matplotlib ``figure`` and
-``axes`` objects, making it easy to add new annotations.
+:class:`yt.visualization.fixed_resolution.FixedResolutionBuffer``
+``PlotWindow`` expose the underlying matplotlib ``figure`` and
+``axes`` objects, making it easy to customize your plots and 
+add new annotations.
 
 .. _slice-plots:
 
 
    from yt.mods import *
    pf = load("RedshiftOutput0005")
-   slc = SlicePlot(pf, 'z', 'Density',[0.2,0.3,0.8],(20,'kpc'))
+   slc = SlicePlot(pf, 'z', 'Density', [0.2,0.3,0.8], (20,'kpc'))
    slc.save()
 
 The above example will display an annotated plot of a slice of the
 :class:`~yt.visualization.plot_window.SlicePlot` for the full class
 description.
 
+.. _projection-plots:
+
 Projection Plots
 ~~~~~~~~~~~~~~~~
 
 Using a fast adaptive projection, ``yt`` is able to quickly project
-simulation data along the coordinate axes.  Off-axis projections are
-also available, although only as a raw image file (see
-:ref:`cookbook-offaxis_projection`).
+simulation data along the coordinate axes.
 
 Projection plots are created by instantiating a
 :class:`~yt.visualization.plot_window.ProjectionPlot` object.  For
 :class:`~yt.visualization.plot_window.ProjectionPlot` for the full
 class description.
 
+.. _off-axis-slices:
+
 Off Axis Slices
 ~~~~~~~~~~~~~~~
 
 :class:`~yt.visualization.plot_window.OffAxisSlicePlot` for the full
 class description.
 
-In-Depth Data Visualization
----------------------------
+.. _off-axis-projections:
+
+Off Axis Projections
+~~~~~~~~~~~~~~~~~~~~
+
+Off axis projection plots .  Internally, off axis projections are
+created using :ref:`the-camera-interface` by applying the
+:class:`~yt.visualization.volume_rendering.transfer_functions.ProjectionTransferFunction`.
+In this use case, the volume renderer casts a set of plane
+parallel rays, one for each pixel in the image.  The data values
+along each ray are summed, creating the final image buffer.
+
+.. _off-axis-projection-function:
+
+To avoid manually creating a camera and setting the transfer
+function, yt provides the :func:`~yt.visualization.volume_rendering.camera.off-axis-projection`
+function, which wraps the camera interface to create an off axis
+projection image buffer.  These images can be saved to disk or
+used in custom plots.  This snippet creates an off axis
+projection through a simulation.
+
+.. code-block:: python
+
+   from yt.mods import *
+   pf = load("RedshiftOutput0005")
+   L = [1,1,0] # vector normal to cutting plane
+   north_vector = [1,-1,0]
+   W = [0.2, 0.2, 0.2]
+   N = 512
+   image = off_axis_projection(pf, c, L, W, N, "Density")
+   write_image(na.log10(image), "%s_offaxis_projection.png" % pf)
+
+Here, ``W`` is the width of the projection in the x, y, *and* z
+directions.
+
+One can also generate generate annotated off axis projections
+using
+:class:`~yt.visualization.plot_window.OffAxisProjectionPlot`. These
+plots can be created in much the same way as an
+``OffAxisSlicePlot``, requiring only an open dataset, a direction
+to project along, and a field to project.  For example:
+
+.. code-block:: python
+
+   from yt.mods import *
+   pf = load("RedshiftOutput0005")
+   L = [1,1,0] # vector normal to cutting plane
+   north_vector = [1,-1,0]
+   prj = OffAxisProjectionPlot(pf,L,'Density',north_vector=north_vector)
+   prj.save()
+
+OffAxisProjectionPlots can also be created with a number of
+keyword arguments, as described in the `api reference`__ for the
+class initializer.
+
+__ :class:`~yt.visualization.plot_window.OffAxisProjectionPlot`
+
+Quantative Analysis and Visualization
+-------------------------------------
 
 The second plotting interface, based on the
 :class:`~yt.visualization.plot_collection.PlotCollection` class, is

source/visualizing/simulated_observations.rst

-Generating Simulated Observations
-=================================
-
-yt has several facilities for generating simulated observations.  Each of these
-comes with several caveats, and none should be expected to produce a completely
-finished product.  You should investigate each option carefully and determine
-which, if any, will deliver the type of observation you are interested in.
-
-
-
-X-ray Observations
-++++++++++++++++++
-
-Under the assumption of optically thin gas, projections can be made
-using emissivity to generated simulated observations.  yt includes a
-method for handling output from CLOUDY in the ROCO (Smith et al 2008)
-format, and generating integrated emissivity over given energy ranges.
-
-Caveats: The ROCO format for input requires some non-trivial handling
-of CLOUDY output.
-
-= SED Generation and Deposition =
-
-Using BC03 models for stellar population synthesis, star particles in
-a given calculation can be assigned an integrated flux for a specific
-bandpass.  These fluxes can then be combined using either projections
-or volume rendering.  This can use CIC interpolation to deposit a
-total flux into each cell (which should be flux-conserving, modulo a
-multiplicative factor not currently included) which is then either
-projected or volume rendered.
-
-Caveats: The deposition method produces far too washed out and murky
-results.  The multiplicative factor is not currently set correctly
-universally.
-
-= Thermal Gas Emission =
-
-Applying a black body spectrum to the thermal content of the gas, we
-can volume render the domain and apply absorption based on broad
-arguments of scattering.  One could theoretically include star
-particles as point sources in this, using recent changes to the volume
-renderer.
-
-Caveats: Scattering that results in re-emission is completely
-neglected, such as Halpha emission.  Scattering that results in just
-attenuating the emission is set in an ad hoc fashion.  Emission from
-point sources, if included at all, is included in a non-conservative
-fashion.
-
-= Export to Sunrise =
-
-Data can be exported to Sunrise for simulated observation generation.
-
-Caveats: This process is poorly documented.
-
-= SZ Compton y and SZ Kinetic Maps =
-
-Future Directions
------------------
-
-* ALMA maps
-* 21cm observations
-* Applying PSFs
-* 

source/visualizing/volume_rendering.rst

     # To add the grid outlines to the image:
     cam.draw_grids(im)
     write_bitmap(im, 'test_rendering_with_grids.png')
+
 Method
 ------
 
 .. image:: _images/vr_sample.jpg
    :width: 512
 
-.. _the_camera_interface:
+.. _the-camera-interface:
 
 The Camera Interface
 --------------------
 
 The Simple Volume Rendering Interface
 -------------------------------------
-.. warning:: This has been removed in yt-2.3.  Please use :ref:`the_camera_interface`.
+.. warning:: This has been removed in yt-2.3.  Please use :ref:`the-camera-interface`.
 
 

source/welcome/objects.rst

      fetches what is necessary--from code, physical, and reduced
      objects as necessary.
 
+.. _intro_to_projections:
+
 Flexible Projections: an Example of Reusable Data Reduction
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++