[yt-svn] commit/yt-doc: MatthewTurk: Adding field_cuts
Bitbucket
commits-noreply at bitbucket.org
Tue Jul 3 05:26:21 PDT 2012
1 new commit in yt-doc:
https://bitbucket.org/yt_analysis/yt-doc/changeset/ef2eece30027/
changeset: ef2eece30027
user: MatthewTurk
date: 2012-06-29 17:18:55
summary: Adding field_cuts
affected #: 2 files
diff -r 227dded5947a1b6a819d743f6decb57a7ab9bebd -r ef2eece30027172a6799c4832726d3e5353b4beb source/analyzing/objects.rst
--- a/source/analyzing/objects.rst
+++ b/source/analyzing/objects.rst
@@ -182,7 +182,7 @@
.. _derived-quantities:
-Derived Quantities
+Processing Objects
------------------
Derived quantities are a way of operating on a collection of cells and
@@ -231,10 +231,56 @@
particle and the baryon mass, so we have two total values passed from the main
function into the collator.
+.. _field_cuts:
+
+Querying and Subselecting Objects
+---------------------------------
+
+Often when analyzing astrophysical objects, only regions that posess certain
+properties are of interest. For instance, in a global galactic disk
+simulation, perhaps you want to examine only the cold gas, or only the hot gas.
+These criteria can be applied to selections of data in yt using one of two
+mechanisms: the "field cuts" mechanism or the "extract region" mechanism.
+"Field cuts" are more suited to specifying extractions based on easily
+described properties of the gas, whereas "extracted regions" are usually suited
+for when the gas properties of interest require explicit examination.
+
+Objects can be selected using field cuts by specifying one or more criteria to
+the ``cut_field`` method on a data object. These criteria should be of the
+form ``grid["FieldName"] < SOMETHING`` or similar; they will be evaluated with
+respect to a grid. The operation will then supply a new objects composed of
+all the cells that satisfy this. For instance, if I wanted to take a sphere
+and only examine inflowing gas:
+
+.. code-block:: python
+
+ sp = pf.h.sphere("max", (100.0, 'au'))
+ inflow = sp.cut_region( [ "grid['RadialVelocity'] < 0" ])
+
+The new returned object, ``inflow``, can be analyzed as any other data object.
+For instance we could examine its angular momentum vector:
+
+.. code-block:: python
+
+ L = inflow.quantities["AngularMomentumVector"]()
+
+There are two things to note about the arguments to ``cut_region``: they are a
+list, where each argument is an independent criterion for inclusion, and they
+are evaluated on each grid object. Only the cells where all arguments are
+evaluated as ``True`` will be included in the resulting object. For instance,
+to select only dense, cold gas:
+
+.. code-block:: python
+
+ dense = sp.cut_region([ "grid['dens'] > 1e5", "grid['temp'] < 200" ])
+
+Each of the criteria will be evaluted independently and the resulting
+intersection will be returned.
+
.. _extracting-connected-sets:
-Extracting Connected Sets
--------------------------
+Connected Sets
+--------------
The underlying machinery used in :ref:`clump_finding` is accessible from any
data object. This includes the ability to obtain and examine topologically
diff -r 227dded5947a1b6a819d743f6decb57a7ab9bebd -r ef2eece30027172a6799c4832726d3e5353b4beb source/index.rst
--- a/source/index.rst
+++ b/source/index.rst
@@ -89,9 +89,9 @@
Analyzing Data</a><br><span class="linkdescr">
An overview of different ways to handle and process data: loading
- data, using and manipulating objects and fields, examining and
- manipulating particles, derived fields, generating processed data,
- time series analysis.
+ data, using and manipulating objects and fields, examining and
+ manipulating particles, derived fields, generating processed data,
+ time series analysis.
</span></p></td><td width="50%">
@@ -101,7 +101,7 @@
<span class="linkdescr">
An overview of different ways to visualize data: making projections,
slices, phase plots, streamlines, and volume rendering; modifying
- plots; the fixed resolution buffer.
+ plots; the fixed resolution buffer.
</span></p></td></tr><tr valign="top">
@@ -121,10 +121,10 @@
<span class="linkdescr">
Discussions of some provided procedures for astrophysical analysis
like halo finding and synthetic spectra. Halo finding, analyzing
- cosmology simulations, halo mass functions, halo profiling, light
- cone generator, making absorption spectrums, star particle
- analysis, two-point functions, halo merger trees, clump finding,
- radial column density, exporting to sunrise.
+ cosmology simulations, halo mass functions, halo profiling, light
+ cone generator, making absorption spectrums, star particle
+ analysis, two-point functions, halo merger trees, clump finding,
+ radial column density, exporting to sunrise.
</span></p></td></tr></table>
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