[yt-svn] commit/yt: 5 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Jul 29 01:09:56 PDT 2014


5 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/9fd5d784a270/
Changeset:   9fd5d784a270
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-07-25 21:26:35
Summary:     Adding a custom ProfilePlot recipe.
Affected #:  3 files

diff -r 94e36ce4fab5dbeacf3d8b774d252c473abb6910 -r 9fd5d784a270251dfacee906d013e57a0ba37390 doc/source/cookbook/complex_plots.rst
--- a/doc/source/cookbook/complex_plots.rst
+++ b/doc/source/cookbook/complex_plots.rst
@@ -145,6 +145,18 @@
 
 .. _cookbook-camera_movement:
 
+Customized Profile Plot
+~~~~~~~~~~~~~~~~~~~~~~~
+
+This recipe demonstrates how to create a fully customized profile object using
+the :meth:`~yt.data_objects.profiles.create_profile` function and then create
+a :class:`~yt.visualization.profile_plotter.ProfilePlot` using the customized
+profile.  This illustrates how ``ProfilePlot`` inherits the properties of the
+profile it is created from.
+
+.. yt_cookbook:: customized_profile_plot.py
+
+
 Moving a Volume Rendering Camera
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

diff -r 94e36ce4fab5dbeacf3d8b774d252c473abb6910 -r 9fd5d784a270251dfacee906d013e57a0ba37390 doc/source/cookbook/customized_profile_plot.py
--- /dev/null
+++ b/doc/source/cookbook/customized_profile_plot.py
@@ -0,0 +1,30 @@
+import yt
+import yt.units as u
+
+ds = yt.load('HiresIsolatedGalaxy/DD0044/DD0044')
+
+center = [0.53, 0.53, 0.53]
+normal = [0,0,1]
+radius = 40*u.kpc
+height = 5*u.kpc
+
+disk = ds.disk(center, [0,0,1], radius, height)
+
+profile = yt.create_profile(
+    data_source=disk,
+    bin_fields=["radius"],
+    fields=["cylindrical_tangential_velocity_absolute"],
+    n_bins=256,
+    units=dict(radius="kpc",
+               cylindrical_tangential_velocity_absolute="km/s"),
+    logs=dict(radius=False),
+    weight_field='cell_mass',
+    extrema=dict(radius=(0,40)),
+    )
+
+plot = yt.ProfilePlot.from_profiles(profile)
+
+plot.set_log('cylindrical_tangential_velocity_absolute', False)
+plot.set_ylim('cylindrical_tangential_velocity_absolute', 60, 160)
+
+plot.save()

diff -r 94e36ce4fab5dbeacf3d8b774d252c473abb6910 -r 9fd5d784a270251dfacee906d013e57a0ba37390 yt/data_objects/profiles.py
--- a/yt/data_objects/profiles.py
+++ b/yt/data_objects/profiles.py
@@ -1248,7 +1248,7 @@
         List of the binning fields for profiling.
     fields : list of strings
         The fields to be profiled.
-    n : int or list of ints
+    n_bins : int or list of ints
         The number of bins in each dimension.  If None, 64 bins for
         each bin are used for each bin field.
         Default: 64.
@@ -1263,7 +1263,7 @@
         attribute of the field.
     units : dict of strings
         The units of the fields in the profiles, including the bin_fields.
-    weight_field : str
+    weight_field : str or tuple field identifier
         The weight field for computing weighted average for the profile
         values.  If None, the profile values are sums of the data in
         each bin.


https://bitbucket.org/yt_analysis/yt/commits/0baa0d818721/
Changeset:   0baa0d818721
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-07-25 22:11:42
Summary:     Adding a recipe for calculating the SFR of a galaxy simulation using filters.
Affected #:  3 files

diff -r 9fd5d784a270251dfacee906d013e57a0ba37390 -r 0baa0d818721c5e0d1930a1e4991f0aa63f7d310 doc/source/cookbook/calculating_information.rst
--- a/doc/source/cookbook/calculating_information.rst
+++ b/doc/source/cookbook/calculating_information.rst
@@ -78,3 +78,12 @@
 fields.
 
 .. yt_cookbook:: hse_field.py
+
+Using Particle Filters to Calculate Star Formation Rates
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This recipe demonstrates how to use a particle filter to calculate the star
+formation rate in a galaxy evolution simulation.
+
+.. yt_cookbook:: particle_filter_sfr.py
+

diff -r 9fd5d784a270251dfacee906d013e57a0ba37390 -r 0baa0d818721c5e0d1930a1e4991f0aa63f7d310 doc/source/cookbook/complex_plots.rst
--- a/doc/source/cookbook/complex_plots.rst
+++ b/doc/source/cookbook/complex_plots.rst
@@ -156,7 +156,6 @@
 
 .. yt_cookbook:: customized_profile_plot.py
 
-
 Moving a Volume Rendering Camera
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

diff -r 9fd5d784a270251dfacee906d013e57a0ba37390 -r 0baa0d818721c5e0d1930a1e4991f0aa63f7d310 doc/source/cookbook/particle_filter_sfr.py
--- /dev/null
+++ b/doc/source/cookbook/particle_filter_sfr.py
@@ -0,0 +1,34 @@
+import yt
+import numpy as np
+from yt.data_objects.particle_filters import add_particle_filter
+from matplotlib import pyplot as plt
+
+def formed_star(pfilter, data):
+    filter = data["all", "creation_time"] > 0
+    return filter
+
+add_particle_filter("formed_star", function=formed_star, filtered_type='all',
+                    requires=["creation_time"])
+
+filename = "IsolatedGalaxy/galaxy0030/galaxy0030"
+
+ds = yt.load(filename)
+ds.add_particle_filter('formed_star')
+ad = ds.all_data()
+masses = ad['formed_star', 'particle_mass'].in_units('Msun')
+formation_time = ad['formed_star', 'creation_time'].in_units('yr')
+
+time_range = [0, 5e8] # years
+n_bins = 1000
+hist, bins = np.histogram(formation_time, bins=n_bins, range=time_range,)
+inds = np.digitize(formation_time, bins=bins)
+time = (bins[:-1] + bins[1:])/2
+
+sfr = np.array([masses[inds == j].sum()/(bins[j+1]-bins[j])
+                for j in range(len(time))])
+sfr[sfr == 0] = np.nan
+
+plt.plot(time/1e6, sfr)
+plt.xlabel('Time  [Myr]')
+plt.ylabel('SFR  [M$_\odot$ yr$^{-1}$]')
+plt.savefig("filter_sfr.png")


https://bitbucket.org/yt_analysis/yt/commits/8407e2bcd4ee/
Changeset:   8407e2bcd4ee
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-07-25 22:40:00
Summary:     Adding customized phase plot recipe.
Affected #:  2 files

diff -r 0baa0d818721c5e0d1930a1e4991f0aa63f7d310 -r 8407e2bcd4ee35ddd66ce562c7223737e6ded4a7 doc/source/cookbook/complex_plots.rst
--- a/doc/source/cookbook/complex_plots.rst
+++ b/doc/source/cookbook/complex_plots.rst
@@ -148,14 +148,26 @@
 Customized Profile Plot
 ~~~~~~~~~~~~~~~~~~~~~~~
 
-This recipe demonstrates how to create a fully customized profile object using
-the :meth:`~yt.data_objects.profiles.create_profile` function and then create
-a :class:`~yt.visualization.profile_plotter.ProfilePlot` using the customized
-profile.  This illustrates how ``ProfilePlot`` inherits the properties of the
-profile it is created from.
+This recipe demonstrates how to create a fully customized 1D profile object
+using the :meth:`~yt.data_objects.profiles.create_profile` function and then
+create a :class:`~yt.visualization.profile_plotter.ProfilePlot` using the
+customized profile.  This illustrates how a ``ProfilePlot`` created this way
+inherits the properties of the profile it is constructed from.
 
 .. yt_cookbook:: customized_profile_plot.py
 
+Customized Phase Plot
+~~~~~~~~~~~~~~~~~~~~~
+
+Similar to the recipe above, this demonstrates how to create a fully customized
+2D profile object using the :meth:`~yt.data_objects.profiles.create_profile`
+function and then create a :class:`~yt.visualization.profile_plotter.PhasePlot`
+using the customized profile object.  This illustrates how a ``PhasePlot``
+created this way inherits the properties of the profile object it is constructed
+from.
+
+.. yt_cookbook:: customized_phase_plot.py
+
 Moving a Volume Rendering Camera
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

diff -r 0baa0d818721c5e0d1930a1e4991f0aa63f7d310 -r 8407e2bcd4ee35ddd66ce562c7223737e6ded4a7 doc/source/cookbook/customized_phase_plot.py
--- /dev/null
+++ b/doc/source/cookbook/customized_phase_plot.py
@@ -0,0 +1,31 @@
+import yt
+import yt.units as u
+
+ds = yt.load('HiresIsolatedGalaxy/DD0044/DD0044')
+
+center = [0.53, 0.53, 0.53]
+normal = [0,0,1]
+radius = 40*u.kpc
+height = 2*u.kpc
+
+disk = ds.disk(center, [0,0,1], radius, height)
+
+profile = yt.create_profile(
+    data_source=disk,
+    bin_fields=["radius", "cylindrical_tangential_velocity"],
+    fields=["cell_mass"],
+    n_bins=256,
+    units=dict(radius="kpc",
+               cylindrical_tangential_velocity="km/s",
+               cell_mass="Msun"),
+    logs=dict(radius=False,
+              cylindrical_tangential_velocity=False),
+    weight_field=None,
+    extrema=dict(radius=(0,40),
+                 cylindrical_tangential_velocity=(-250, 250)),
+    )
+
+plot = yt.PhasePlot.from_profile(profile)
+plot.set_cmap("cell_mass", "YlOrRd")
+
+plot.save()


https://bitbucket.org/yt_analysis/yt/commits/488f99ec424f/
Changeset:   488f99ec424f
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-07-28 23:53:22
Summary:     Mering with tip.
Affected #:  9 files

diff -r 8407e2bcd4ee35ddd66ce562c7223737e6ded4a7 -r 488f99ec424f6382b2ad54ddb464a02a19dcae05 doc/source/analyzing/fields.rst
--- a/doc/source/analyzing/fields.rst
+++ b/doc/source/analyzing/fields.rst
@@ -1,19 +1,190 @@
+Fields in yt
+============
+
+The fundamental way to query data in yt is to access a field, either in its raw
+form (by examining a data container) or a processed form (derived quantities,
+projections, and so on).  "Field" is something of a loaded word, as it can
+refer to quantities that are defined everywhere, which we refer to as "mesh" or
+"fluid" fields, or discrete points that populate the domain, traditionally
+thought of as "particle" fields.  The word "particle" here is gradually falling
+out of favor, as these discrete fields can be any type of sparsely populated
+data.
+
+In previous versions of yt, there was a single mechanism of accessing fields on
+a data container -- by their name, which was mandated to be a single string,
+and which often varied between different code frontends.  yt 3.0 allows
+for datasets containing multiple different types of fluid fields, mesh fields,
+particles (with overlapping or disjoint lists of fields).  To enable accessing
+these fields in a meaningful, simple way, the mechanism for accessing them has
+changed to take an optional *field type* in addition to the *field name*.
+
+As an example, we may be in a situation where have multiple types of particles
+which possess the ``particle_position`` field.  In the case where a data
+container, here called ``ad`` (short for "all data") contains a field, we can
+specify which particular particle type we want to query:
+
+.. code-block:: python
+
+   print ad["humans", "particle_position"]
+   print ad["dogs", "particle_position"]
+   print ad["dinosaurs", "particle_position"]
+
+Each of these three fields may have different sizes.  In order to enable
+falling back on asking only for a field by the name, yt will use the most
+recently requested field type for subsequent queries.  (By default, if no field
+has been queried, it will look for the special field ``all``, which
+concatenates all particle types.)  For example, if I were to then query for the
+velocity:
+
+.. code-block:: python
+
+   print ad["particle_velocity"]
+
+it would select ``dinosaurs`` as the field type.
+
+The same operations work for fluid and mesh fields.  As an example, in some
+cosmology simulations, we may want to examine the mass of particles in a region
+versus the mass of gas.  We can do so by examining the special "deposit" field
+types (described below) versus the gas fields:
+
+.. code-block:: python
+
+   print ad["deposit", "dark_matter_density"] / ad["gas", "density"]
+
+The ``deposit`` field type is a mesh field, so it will have the same shape as
+the gas density.  If we weren't using ``deposit``, and instead directly
+querying a particle field, this *wouldn't* work, as they are different shapes.
+This is the primary difference, in practice, between mesh and particle fields
+-- they will be different shapes and so cannot be directly compared without
+translating one to the other, typically through a "deposition" or "smoothing"
+step.
+
+How are fields implemented?
++++++++++++++++++++++++++++
+
+There are two classes of fields in yt.  The first are those fields that exist
+external to yt, which are immutable and can be queried -- most commonly, these
+are fields that exist on disk.  These will often be returned in units that are
+not in a known, external unit system (except possibly by design, on the part of
+the code that wrote the data), and yt will take every effort possible to use
+the names by which they are referred to by the data producer.  The default
+field type for mesh fields that are "on-disk" is the name of the code frontend.
+(For example, ``art``, ``enzo``, ``pyne``, and so on.) The default name for
+particle fields, if they do not have a particle type affiliated with them, is
+``io``.
+
+The second class of field is the "derived field."  These are fields that are
+functionally defined, either *ab initio* or as a transformation or combination
+of other fields.  For example, when dealing with simulation codes, often the
+fields that are evolved and output to disk are not the fields that are the most
+relevant to researchers.  Rather than examining the internal gas energy, it is
+more convenient to think of the temperature.  By applying one or multiple
+functions to on-disk quantities, yt can construct new derived fields from them.
+Derived fields do not always have to relate to the data found on disk; special
+fields such as ``x``, ``y``, ``phi`` and ``dz`` all relate exclusively to the
+geometry of the mesh, and provide information about the mesh that can be used
+elsewhere for further transformations.
+
+For more information, see :ref:`creating-derived-fields`.
+
+There is a third, borderline class of field in yt, as well.  This is the
+"alias" type, where a field on disk (for example, ``Density``) is aliased into
+an internal yt-name (for example, ``density``).  The aliasing process allows
+universally-defined derived fields to take advantage of internal names, and it
+also provides an easy way to address what units something should be returned
+in.  If an aliased field is requested (and aliased fields will always be
+lowercase, with underscores separating words) it will be returned in CGS units
+(future versions will enable global defaults to be set for MKS and other unit
+systems), whereas if the underlying field is requested, it will not undergo any
+unit conversions from its natural units.  (This rule is occasionally violated
+for fields which are mesh-dependent, specifically particle masses in some
+cosmology codes.)
+
+Field types known to yt
++++++++++++++++++++++++
+
+yt knows of a few different field types, by default.
+
+ * ``index`` - this field type refers to characteristics of the mesh, whether
+   that mesh is defined by the simulation or internally by an octree indexing
+   of particle data.  A few handy fields are ``x``, ``y``, ``z``, ``theta``,
+   ``phi``, ``radius``, ``dx``, ``dy``, ``dz`` and so on.
+ * ``gas`` - this is the usual default for simulation frontends for fluid
+   types.
+ * ``all`` - this is a special particle field type that represents a
+   concatenation of all particle field types.
+ * ``deposit`` - this field type refers to the deposition of particles
+   (discrete data) onto a mesh, typically to compute smoothing kernels, local
+   density estimates, counts, and the like.
+ * ``io`` - if a data frontend does not have a set of particle types, this will
+   be the default for particle types.
+ * frontend-name - mesh or fluid fields that exist on-disk default to having
+   the name of the frontend as their type name. (i.e., ``enzo``, ``flash``,
+   ``pyne`` and so on.)
+ * particle type - if the particle types in the file are affiliated with names
+   (rather than just ``io``) they will be available as field types.
+   Additionally, any particle unions or filters will be accessible as field
+   types.
+
+Field Plugins
++++++++++++++
+
+Derived fields are organized via plugins.  Inside yt are a number of field
+plugins, which take information about fields in a dataset and then construct
+derived fields on top of them.  This allows them to take into account
+variations in naming system, units, data representations, and most importantly,
+allows only the fields that are relevant to be added.  This system will be
+expanded in future versions to enable much deeper semantic awareness of the
+data types being analyzed by yt.
+
+The field plugin system works in this order:
+
+ * Available, inherent fields are identified by yt
+ * The list of enabled field plugins is iterated over.  Each is called, and new
+   derived fields are added as relevant.
+ * Any fields which are not available, or which throw errors, are discarded.
+ * Remaining fields are added to the list of derived fields available for a
+   dataset
+ * Dependencies for every derived field are identified, to enable data
+   preloading
+
+Field plugins can be loaded dynamically, although at present this is not
+particularly useful.  Plans for extending field plugins to dynamically load, to
+enable simple definition of common types (gradient, divergence, etc), and to
+more verbosely describe available fields, have been put in place for future
+versions.
+
+The field plugins currently available include:
+
+ * Angular momentum fields for particles and fluids
+ * Astrophysical fields, such as those related to cosmology
+ * Vector fields for fluid fields, such as gradients and divergences
+ * Particle vector fields
+ * Magnetic field-related fields
+ * Species fields, such as for chemistry species (yt can recognize the entire
+   periodic table in field names and construct ionization fields as need be)
+
+What fields are available?
+++++++++++++++++++++++++++
+
+.. include reference here once it's done
+
 Particle Fields
-===============
+---------------
 
 Naturally, particle fields contain properties of particles rather than
 grid cells.  Many of these fields have corresponding grid fields that
 can be populated by "depositing" the particle values onto a yt grid.
 
 General Particle Fields
------------------------
++++++++++++++++++++++++
 
 Every particle will contain both a ``particle_position`` and ``particle_velocity``
 that tracks the position and velocity (respectively) in code units.
 
 
 SPH Fields
-----------
+++++++++++
 
 For gas particles from SPH simulations, each particle will typically carry
 a field for the smoothing length ``h``, which is roughly equivalent to 

diff -r 8407e2bcd4ee35ddd66ce562c7223737e6ded4a7 -r 488f99ec424f6382b2ad54ddb464a02a19dcae05 doc/source/analyzing/index.rst
--- a/doc/source/analyzing/index.rst
+++ b/doc/source/analyzing/index.rst
@@ -8,7 +8,7 @@
 
    objects
    units/index
-   particles
+   fields
    creating_derived_fields
    filtering
    generating_processed_data

diff -r 8407e2bcd4ee35ddd66ce562c7223737e6ded4a7 -r 488f99ec424f6382b2ad54ddb464a02a19dcae05 doc/source/analyzing/objects.rst
--- a/doc/source/analyzing/objects.rst
+++ b/doc/source/analyzing/objects.rst
@@ -127,6 +127,37 @@
 
 .. include:: _obj_docstrings.inc
 
+.. _arbitrary-grid:
+
+Arbitrary Grids
+---------------
+
+The covering grid and smoothed covering grid objects mandate that they be
+exactly aligned with the mesh.  This is a
+holdover from the time when yt was used exclusively for data that came in
+regularly structured grid patches, and does not necessarily work as well for
+data that is composed of discrete objects like particles.  To augment this, the
+:class:`~yt.data_objects.data_containers.YTArbitraryGridBase` object was
+created, which enables construction of meshes (onto which particles can be
+deposited or smoothed) in arbitrary regions.  This eliminates any assumptions
+on yt's part about how the data is organized, and will allow for more
+fine-grained control over visualizations.
+
+An example of creating an arbitrary grid would be to construct one, then query
+the deposited particle density, like so:
+
+.. code-block:: python
+
+   import yt
+   ds = yt.load("snapshot_010.hdf5")
+
+   obj = ds.arbitrary_grid([0.0, 0.0, 0.0], [0.99, 0.99, 0.99],
+                          dims=[128, 128, 128])
+   print obj["deposit", "all_density"]
+
+While these cannot yet be used as input to projections or slices, slices and
+projections can be taken of the data in them and visualized by hand.
+
 .. _boolean_data_objects:
 
 Combining Objects: Boolean Data Objects

diff -r 8407e2bcd4ee35ddd66ce562c7223737e6ded4a7 -r 488f99ec424f6382b2ad54ddb464a02a19dcae05 doc/source/cookbook/calculating_information.rst
--- a/doc/source/cookbook/calculating_information.rst
+++ b/doc/source/cookbook/calculating_information.rst
@@ -68,17 +68,6 @@
 
 .. yt_cookbook:: derived_field.py
 
-.. _cookbook-complex-derived-fields:
-
-Complex Derived Fields
-~~~~~~~~~~~~~~~~~~~~~~
-
-This recipe estimates the ratio of gravitational and pressure forces in a galaxy
-cluster simulation.  This shows how to create and work with vector derived 
-fields.
-
-.. yt_cookbook:: hse_field.py
-
 Using Particle Filters to Calculate Star Formation Rates
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -86,4 +75,3 @@
 formation rate in a galaxy evolution simulation.
 
 .. yt_cookbook:: particle_filter_sfr.py
-

diff -r 8407e2bcd4ee35ddd66ce562c7223737e6ded4a7 -r 488f99ec424f6382b2ad54ddb464a02a19dcae05 doc/source/cookbook/find_clumps.py
--- a/doc/source/cookbook/find_clumps.py
+++ b/doc/source/cookbook/find_clumps.py
@@ -6,7 +6,7 @@
 ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
 
 data_source = ds.disk([0.5, 0.5, 0.5], [0., 0., 1.], 
-                      (1, 'kpc'), (1, 'kpc'))
+                      (8, 'kpc'), (1, 'kpc'))
 
 # the field to be used for contouring
 field = ("gas", "density")

diff -r 8407e2bcd4ee35ddd66ce562c7223737e6ded4a7 -r 488f99ec424f6382b2ad54ddb464a02a19dcae05 doc/source/help/index.rst
--- a/doc/source/help/index.rst
+++ b/doc/source/help/index.rst
@@ -141,7 +141,7 @@
 
  * Identify which version of the code you’re using. 
 
-   * ``$ yt instinfo`` - provides version information, including changeset hash
+   * ``$ yt version`` - provides version information, including changeset hash
 
 It may be that through the mere process of doing this, you end up solving 
 the problem!

diff -r 8407e2bcd4ee35ddd66ce562c7223737e6ded4a7 -r 488f99ec424f6382b2ad54ddb464a02a19dcae05 doc/source/installing.rst
--- a/doc/source/installing.rst
+++ b/doc/source/installing.rst
@@ -11,6 +11,19 @@
 In this document we describe several methods for installing yt. The method that
 will work best for you depends on your precise situation:
 
+* If you do not have root access on your computer, are not comfortable managing
+  python packages, or are working on a supercomputer or cluster computer, you
+  will probably want to use the bash installation script.  This builds python,
+  numpy, matplotlib, and yt from source to set up an isolated scientific python
+  environment inside of a single folder in your home directory. See
+  :ref:`install-script` for more details.
+
+* If you use the `Anaconda <https://store.continuum.io/cshop/anaconda/>`_ python
+  distribution see :ref:`anaconda-installation` for details on how to install
+  yt using the ``conda`` package manager.  Source-based installation from the
+  mercurial repository or via ``pip`` should also work under Anaconda. Note that
+  this is currently the only supported installation mechanism on Windows.
+
 * If you already have a scientific python software stack installed on your
   computer and are comfortable installing python packages,
   :ref:`source-installation` will probably be the best choice. If you have set
@@ -21,136 +34,6 @@
   have the the necessary compilers installed (e.g. the ``build-essentials``
   package on debian and ubuntu).
 
-* If you use the `Anaconda <https://store.continuum.io/cshop/anaconda/>`_ python
-  distribution see :ref:`anaconda-installation` for details on how to install
-  yt using the ``conda`` package manager.  Source-based installation from the
-  mercurial repository or via ``pip`` should also work under Anaconda. Note that
-  this is currently the only supported installation mechanism on Windows.
-
-* If you do not have root access on your computer, are not comfortable managing
-  python packages, or are working on a supercomputer or cluster computer, you
-  will probably want to use the bash installation script.  This builds python,
-  numpy, matplotlib, and yt from source to set up an isolated scientific python
-  environment inside of a single folder in your home directory. See
-  :ref:`install-script` for more details.
-
-.. _source-installation:
-
-Installing yt Using pip or from Source
-++++++++++++++++++++++++++++++++++++++
-
-To install yt from source, you must make sure you have yt's dependencies
-installed on your system.  These include: a C compiler, ``HDF5``, ``python``,
-``Cython``, ``NumPy``, ``matplotlib``, ``sympy``, and ``h5py``. From here, you
-can use ``pip`` (which comes with ``Python``) to install the latest stable
-version of yt:
-
-.. code-block:: bash
-
-  $ pip install yt
-
-The source code for yt may be found at the Bitbucket project site and can also
-be utilized for installation. If you prefer to install the development version
-of yt instead of the latest stable release, you will need ``mercurial`` to clone
-the official repo:
-
-.. code-block:: bash
-
-  hg clone https://bitbucket.org/yt_analysis/yt
-  cd yt
-  hg update yt
-  python setup.py install --user
-
-This will install yt into ``$HOME/.local/lib64/python2.7/site-packages``. 
-Please refer to ``setuptools`` documentation for the additional options.
-
-If you will be modifying yt, you can also make the clone of the yt mercurial
-repository the "active" installed copy:
-
-..code-block:: bash
-
-  hg clone https://bitbucket.org/yt_analysis/yt
-  cd yt
-  hg update yt
-  python setup.py develop  
-
-If you choose this installation method, you do not need to run any activation
-script since this will install yt into your global python environment.
-
-Keeping yt Updated via Mercurial
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-If you want to maintain your yt installation via updates straight from the
-Bitbucket repository or if you want to do some development on your own, we
-suggest you check out some of the :ref:`development docs <contributing-code>`,
-especially the sections on :ref:`Mercurial <mercurial-with-yt>` and
-:ref:`building yt from source <building-yt>`.
-
-You can also make use of the following command to keep yt up to date from the
-command line:
-
-.. code-block:: bash
-
-  yt update
-
-This will detect that you have installed yt from the mercurial repository, pull
-any changes from bitbucket, and then recompile yt if necessary.
-
-.. _anaconda-installation:
-
-Installing yt Using Anaconda
-++++++++++++++++++++++++++++
-
-Perhaps the quickest way to get yt up and running is to install it using the
-`Anaconda Python Distribution <https://store.continuum.io/cshop/anaconda/>`_,
-which will provide you with a easy-to-use environment for installing Python
-packages.
-
-If you do not want to install the full anaconda python distribution, you can
-install a bare-bones Python installation using miniconda.  To install miniconda,
-visit http://repo.continuum.io/miniconda/ and download a recent version of the
-``Miniconda-x.y.z`` script (corresponding to Python 2.7) for your platform and
-system architecture. Next, run the script, e.g.:
-
-.. code-block:: bash
-
-  bash Miniconda-3.3.0-Linux-x86_64.sh
-
-Make sure that the Anaconda ``bin`` directory is in your path, and then issue:
-
-.. code-block:: bash
-
-  conda install yt
-
-which will install yt along with all of its dependencies.
-
-Recipes to build conda packages for yt are available at
-https://github.com/conda/conda-recipes.  To build the yt conda recipe, first
-clone the conda-recipes repository
-
-.. code-block:: bash
-
-  git clone https://github.com/conda/conda-recipes
-
-Then navigate to the repository root and invoke `conda build`:
-
-.. code-block:: bash
-
-  cd conda-recipes
-  conda build ./yt/
-
-Note that building a yt conda package requires a C compiler.
-
-.. _windows-installation:
-
-Installing yt on Windows
-^^^^^^^^^^^^^^^^^^^^^^^^
-
-Installation on Microsoft Windows is only supported for Windows XP Service Pack
-3 and higher (both 32-bit and 64-bit) using Anaconda, see
-:ref:`anaconda-installation`.  Also see :ref:`windows-developing` for details on
-how to build yt from source in Windows.
-
 .. _install-script:
 
 All-in-one installation script
@@ -265,6 +148,168 @@
 code, this is a last defense for solving: remove and then fully
 :ref:`re-install <installing-yt>` from the install script again.
 
+.. _anaconda-installation:
+
+Installing yt Using Anaconda
+++++++++++++++++++++++++++++
+
+Perhaps the quickest way to get yt up and running is to install it using the
+`Anaconda Python Distribution <https://store.continuum.io/cshop/anaconda/>`_,
+which will provide you with a easy-to-use environment for installing Python
+packages.
+
+If you do not want to install the full anaconda python distribution, you can
+install a bare-bones Python installation using miniconda.  To install miniconda,
+visit http://repo.continuum.io/miniconda/ and download a recent version of the
+``Miniconda-x.y.z`` script (corresponding to Python 2.7) for your platform and
+system architecture. Next, run the script, e.g.:
+
+.. code-block:: bash
+
+  bash Miniconda-3.3.0-Linux-x86_64.sh
+
+Make sure that the Anaconda ``bin`` directory is in your path, and then issue:
+
+.. code-block:: bash
+
+  conda install yt
+
+which will install yt along with all of its dependencies.
+
+Recipes to build conda packages for yt are available at
+https://github.com/conda/conda-recipes.  To build the yt conda recipe, first
+clone the conda-recipes repository
+
+.. code-block:: bash
+
+  git clone https://github.com/conda/conda-recipes
+
+Then navigate to the repository root and invoke `conda build`:
+
+.. code-block:: bash
+
+  cd conda-recipes
+  conda build ./yt/
+
+Note that building a yt conda package requires a C compiler.
+
+.. _windows-installation:
+
+Installing yt on Windows
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Installation on Microsoft Windows is only supported for Windows XP Service Pack
+3 and higher (both 32-bit and 64-bit) using Anaconda, see
+:ref:`anaconda-installation`.  Also see :ref:`windows-developing` for details on
+how to build yt from source in Windows.
+
+.. _source-installation:
+
+Installing yt Using pip or from Source
+++++++++++++++++++++++++++++++++++++++
+
+To install yt from source, you must make sure you have yt's dependencies
+installed on your system.  These include: a C compiler, ``HDF5``, ``python``,
+``Cython``, ``NumPy``, ``matplotlib``, ``sympy``, and ``h5py``. From here, you
+can use ``pip`` (which comes with ``Python``) to install the latest stable
+version of yt:
+
+.. code-block:: bash
+
+  $ pip install yt
+
+The source code for yt may be found at the Bitbucket project site and can also
+be utilized for installation. If you prefer to install the development version
+of yt instead of the latest stable release, you will need ``mercurial`` to clone
+the official repo:
+
+.. code-block:: bash
+
+  hg clone https://bitbucket.org/yt_analysis/yt
+  cd yt
+  hg update yt
+  python setup.py install --user
+
+.. note::
+
+  If you maintain your own python installation separate from the OS-level python
+  installation, you can leave off ``--user --prefix=``, although you might need
+  ``sudo`` depending on where python is installed. See _`This StackOverflow
+  discussion
+  <http://stackoverflow.com/questions/4495120/combine-user-with-prefix-error-with-setup-py-install>`
+  if you are curious why ``--prefix=`` is neccessary on systems.
+
+This will install yt into a folder in your home directory
+(``$HOME/.local/lib64/python2.7/site-packages`` on Linux,
+``$HOME/Library/Python/2.7/lib/python/site-packages/`` on OSX) Please refer to
+the ``setuptools`` documentation for the additional options.
+
+If you choose this installation method, you do not need to run any activation
+script since this will install yt into your global python environment.
+
+If you will be modifying yt, you can also make the clone of the yt mercurial
+repository the "active" installed copy:
+
+.. code-block:: bash
+
+  hg clone https://bitbucket.org/yt_analysis/yt
+  cd yt
+  hg update yt
+  python setup.py develop --user
+
+As above, you can leave off ``--user`` if you want to install yt into the default
+package install path.  If you do not have write access for this location, you
+might need to use ``sudo``.
+
+Switching to yt 2.x
+^^^^^^^^^^^^^^^^^^^
+
+With the release of version 3.0 of yt, development of the legacy yt 2.x series
+has been relegated to bugfixes.  That said, we will continue supporting the 2.x
+series for the forseeable future.  This makes it easy to use scripts written
+for older versions of yt without substantially updating them to support the
+new field naming or unit systems in yt version 3.
+
+Currently, the yt-2.x codebase is contained in a named branch in the yt
+mercurial repository.  First, remove any extant installations of yt on your
+system:
+
+.. code-block:: bash
+
+  pip uninstall yt
+
+To switch to yt-2.x, you will need to clone the mercurial repository as
+described in :ref:`source-installation`.  Next, you will need to navigate to the
+mercurial repository, update to the `yt-2.x` branch, and recompile:
+
+.. code-block:: bash
+
+  cd yt
+  hg update yt-2.x
+  python setup.py develop --user
+
+You can check which version of yt you have installed by invoking ``yt version``
+at the command line.
+
+Keeping yt Updated via Mercurial
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If you want to maintain your yt installation via updates straight from the
+Bitbucket repository or if you want to do some development on your own, we
+suggest you check out some of the :ref:`development docs <contributing-code>`,
+especially the sections on :ref:`Mercurial <mercurial-with-yt>` and
+:ref:`building yt from source <building-yt>`.
+
+You can also make use of the following command to keep yt up to date from the
+command line:
+
+.. code-block:: bash
+
+  yt update
+
+This will detect that you have installed yt from the mercurial repository, pull
+any changes from bitbucket, and then recompile yt if necessary.
+
 .. _testing-installation:
 
 Testing Your Installation

diff -r 8407e2bcd4ee35ddd66ce562c7223737e6ded4a7 -r 488f99ec424f6382b2ad54ddb464a02a19dcae05 doc/source/reference/command-line.rst
--- a/doc/source/reference/command-line.rst
+++ b/doc/source/reference/command-line.rst
@@ -64,7 +64,8 @@
                         (http://hub.yt-project.org/), creating a BitBucket
                         repo in the process if necessary.
     instinfo            Get some information about the yt installation
-    version             Get some information about the yt installation
+    version             Get some information about the yt installation (this
+                        is an alias for instinfo).
     load                Load a single dataset into an IPython instance
     pastebin            Post a script to an anonymous pastebin
     pastebin_grab       Print an online pastebin to STDOUT for local use.

diff -r 8407e2bcd4ee35ddd66ce562c7223737e6ded4a7 -r 488f99ec424f6382b2ad54ddb464a02a19dcae05 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -543,7 +543,7 @@
               min_val, mx, my, mz)
         return min_val, self.arr([mx, my, mz], 'code_length', dtype="float64")
 
-    def find_field_values_at_point(self, fields, coord):
+    def find_field_values_at_point(self, fields, coords):
         """
         Returns the values [field1, field2,...] of the fields at the given
         coordinates. Returns a list of field values in the same order as 


https://bitbucket.org/yt_analysis/yt/commits/9311591c5804/
Changeset:   9311591c5804
Branch:      yt-3.0
User:        xarthisius
Date:        2014-07-29 10:09:49
Summary:     Merged in ngoldbaum/yt/yt-3.0 (pull request #1079)

Adding three new cookbook recipes.
Affected #:  6 files

diff -r 95c532180d1182130daea6a6f95de32bfbcee0ce -r 9311591c58044d4e84efa1e91a6b4b3ea5a48197 doc/source/cookbook/calculating_information.rst
--- a/doc/source/cookbook/calculating_information.rst
+++ b/doc/source/cookbook/calculating_information.rst
@@ -68,4 +68,10 @@
 
 .. yt_cookbook:: derived_field.py
 
-.. _cookbook-complex-derived-fields:
+Using Particle Filters to Calculate Star Formation Rates
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This recipe demonstrates how to use a particle filter to calculate the star
+formation rate in a galaxy evolution simulation.
+
+.. yt_cookbook:: particle_filter_sfr.py

diff -r 95c532180d1182130daea6a6f95de32bfbcee0ce -r 9311591c58044d4e84efa1e91a6b4b3ea5a48197 doc/source/cookbook/complex_plots.rst
--- a/doc/source/cookbook/complex_plots.rst
+++ b/doc/source/cookbook/complex_plots.rst
@@ -145,6 +145,29 @@
 
 .. _cookbook-camera_movement:
 
+Customized Profile Plot
+~~~~~~~~~~~~~~~~~~~~~~~
+
+This recipe demonstrates how to create a fully customized 1D profile object
+using the :meth:`~yt.data_objects.profiles.create_profile` function and then
+create a :class:`~yt.visualization.profile_plotter.ProfilePlot` using the
+customized profile.  This illustrates how a ``ProfilePlot`` created this way
+inherits the properties of the profile it is constructed from.
+
+.. yt_cookbook:: customized_profile_plot.py
+
+Customized Phase Plot
+~~~~~~~~~~~~~~~~~~~~~
+
+Similar to the recipe above, this demonstrates how to create a fully customized
+2D profile object using the :meth:`~yt.data_objects.profiles.create_profile`
+function and then create a :class:`~yt.visualization.profile_plotter.PhasePlot`
+using the customized profile object.  This illustrates how a ``PhasePlot``
+created this way inherits the properties of the profile object it is constructed
+from.
+
+.. yt_cookbook:: customized_phase_plot.py
+
 Moving a Volume Rendering Camera
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

diff -r 95c532180d1182130daea6a6f95de32bfbcee0ce -r 9311591c58044d4e84efa1e91a6b4b3ea5a48197 doc/source/cookbook/customized_phase_plot.py
--- /dev/null
+++ b/doc/source/cookbook/customized_phase_plot.py
@@ -0,0 +1,31 @@
+import yt
+import yt.units as u
+
+ds = yt.load('HiresIsolatedGalaxy/DD0044/DD0044')
+
+center = [0.53, 0.53, 0.53]
+normal = [0,0,1]
+radius = 40*u.kpc
+height = 2*u.kpc
+
+disk = ds.disk(center, [0,0,1], radius, height)
+
+profile = yt.create_profile(
+    data_source=disk,
+    bin_fields=["radius", "cylindrical_tangential_velocity"],
+    fields=["cell_mass"],
+    n_bins=256,
+    units=dict(radius="kpc",
+               cylindrical_tangential_velocity="km/s",
+               cell_mass="Msun"),
+    logs=dict(radius=False,
+              cylindrical_tangential_velocity=False),
+    weight_field=None,
+    extrema=dict(radius=(0,40),
+                 cylindrical_tangential_velocity=(-250, 250)),
+    )
+
+plot = yt.PhasePlot.from_profile(profile)
+plot.set_cmap("cell_mass", "YlOrRd")
+
+plot.save()

diff -r 95c532180d1182130daea6a6f95de32bfbcee0ce -r 9311591c58044d4e84efa1e91a6b4b3ea5a48197 doc/source/cookbook/customized_profile_plot.py
--- /dev/null
+++ b/doc/source/cookbook/customized_profile_plot.py
@@ -0,0 +1,30 @@
+import yt
+import yt.units as u
+
+ds = yt.load('HiresIsolatedGalaxy/DD0044/DD0044')
+
+center = [0.53, 0.53, 0.53]
+normal = [0,0,1]
+radius = 40*u.kpc
+height = 5*u.kpc
+
+disk = ds.disk(center, [0,0,1], radius, height)
+
+profile = yt.create_profile(
+    data_source=disk,
+    bin_fields=["radius"],
+    fields=["cylindrical_tangential_velocity_absolute"],
+    n_bins=256,
+    units=dict(radius="kpc",
+               cylindrical_tangential_velocity_absolute="km/s"),
+    logs=dict(radius=False),
+    weight_field='cell_mass',
+    extrema=dict(radius=(0,40)),
+    )
+
+plot = yt.ProfilePlot.from_profiles(profile)
+
+plot.set_log('cylindrical_tangential_velocity_absolute', False)
+plot.set_ylim('cylindrical_tangential_velocity_absolute', 60, 160)
+
+plot.save()

diff -r 95c532180d1182130daea6a6f95de32bfbcee0ce -r 9311591c58044d4e84efa1e91a6b4b3ea5a48197 doc/source/cookbook/particle_filter_sfr.py
--- /dev/null
+++ b/doc/source/cookbook/particle_filter_sfr.py
@@ -0,0 +1,34 @@
+import yt
+import numpy as np
+from yt.data_objects.particle_filters import add_particle_filter
+from matplotlib import pyplot as plt
+
+def formed_star(pfilter, data):
+    filter = data["all", "creation_time"] > 0
+    return filter
+
+add_particle_filter("formed_star", function=formed_star, filtered_type='all',
+                    requires=["creation_time"])
+
+filename = "IsolatedGalaxy/galaxy0030/galaxy0030"
+
+ds = yt.load(filename)
+ds.add_particle_filter('formed_star')
+ad = ds.all_data()
+masses = ad['formed_star', 'particle_mass'].in_units('Msun')
+formation_time = ad['formed_star', 'creation_time'].in_units('yr')
+
+time_range = [0, 5e8] # years
+n_bins = 1000
+hist, bins = np.histogram(formation_time, bins=n_bins, range=time_range,)
+inds = np.digitize(formation_time, bins=bins)
+time = (bins[:-1] + bins[1:])/2
+
+sfr = np.array([masses[inds == j].sum()/(bins[j+1]-bins[j])
+                for j in range(len(time))])
+sfr[sfr == 0] = np.nan
+
+plt.plot(time/1e6, sfr)
+plt.xlabel('Time  [Myr]')
+plt.ylabel('SFR  [M$_\odot$ yr$^{-1}$]')
+plt.savefig("filter_sfr.png")

diff -r 95c532180d1182130daea6a6f95de32bfbcee0ce -r 9311591c58044d4e84efa1e91a6b4b3ea5a48197 yt/data_objects/profiles.py
--- a/yt/data_objects/profiles.py
+++ b/yt/data_objects/profiles.py
@@ -1248,7 +1248,7 @@
         List of the binning fields for profiling.
     fields : list of strings
         The fields to be profiled.
-    n : int or list of ints
+    n_bins : int or list of ints
         The number of bins in each dimension.  If None, 64 bins for
         each bin are used for each bin field.
         Default: 64.
@@ -1263,7 +1263,7 @@
         attribute of the field.
     units : dict of strings
         The units of the fields in the profiles, including the bin_fields.
-    weight_field : str
+    weight_field : str or tuple field identifier
         The weight field for computing weighted average for the profile
         values.  If None, the profile values are sums of the data in
         each bin.

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

--

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