[yt-svn] commit/yt-doc: 5 new changesets
Bitbucket
commits-noreply at bitbucket.org
Fri Jul 6 15:36:04 PDT 2012
5 new commits in yt-doc:
https://bitbucket.org/yt_analysis/yt-doc/changeset/32a1ab8ea1e7/
changeset: 32a1ab8ea1e7
user: MatthewTurk
date: 2012-07-06 16:45:00
summary: Removing unused files and updating conf.py to have a wider doc display.
affected #: 3 files
diff -r 229f95233b378accc062284b5061184ff65ce316 -r 32a1ab8ea1e73f1fd0c9d89817e9b461059c28bd source/conf.py
--- a/source/conf.py
+++ b/source/conf.py
@@ -44,16 +44,16 @@
# General information about the project.
project = u'yt'
-copyright = u'2011, the yt Project'
+copyright = u'2012, the yt Project'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '2.3'
+version = '2.4'
# The full version, including alpha/beta/rc tags.
-release = '2.3'
+release = '2.4'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -101,8 +101,8 @@
# documentation.
html_theme_options = dict(
bodyfont = 'Droid Sans',
- pagewidth = '960px',
- documentwidth = '760px',
+ pagewidth = '1080px',
+ documentwidth = '880px',
sidebarwidth = '200px',
headerfont = 'Crimson Text',
diff -r 229f95233b378accc062284b5061184ff65ce316 -r 32a1ab8ea1e73f1fd0c9d89817e9b461059c28bd source/interacting/interacting_with_yt.rst
--- a/source/interacting/interacting_with_yt.rst
+++ /dev/null
@@ -1,622 +0,0 @@
-.. _interacting_with_yt:
-
-Ways of Interacting with yt
-===========================
-
-There are several entry points to yt, and each carries its own strengths and
-weaknesses. We cover a few of those here.
-
-.. contents::
- :depth: 1
- :local:
- :backlinks: none
-
-.. _scripting-yt:
-
-Scripts
--------
-
-The mechanism by which most people primarily interact with yt is by writing,
-then executing, a script. This is covered somewhat in the :ref:`orientation`,
-but here we describe it again. There are several advantages to scripts as
-opposed to interactivity:
-
- * Repeatability of experiments
- * Easier MPI-parallelism
- * Versioned control of changes to a script
- * Simpler declaration and usage of subroutines and loops
-
-Running scripts is pretty easy. It's a three step process.
-
- #. Edit script in a text editor (vim, emacs, textmate -- as long as it's not
- pico or edlin!)
- #. Run script, invoking it with either the python version installed with yt or
- the alias ``pyyt``.
- #. Edit, and repeat!
-
-To encourage easy submission to the `yt Hub <http://hub.yt-project.org/>`_, we
-suggest you place your scripts in an isolated subdirectory and name each one
-individually. For instance:
-
-.. code-block:: bash
-
- mkdir turbulence_paper
- cd turbulence_paper
- vim calculate_power_spectra.py
- pyyt calculate_power_spectra.py
-
-You will have to reference the datasets you want to analyze with either
-relative or absolute paths, but when you have completed your work, you can use
-the command (see :ref:`command-line`) ``hubsubmit`` to (if necessary) create a
-repository and submit to the `yt Hub <http://hub.yt-project.org/>`_.
-
-.. _interactive-prompt:
-
-Interactive Prompt
-------------------
-
-The interactive prompt offers a number of excellent opportunities for
-exploration of data. While there are challenges for repeatability, and some
-operations will be more challenging to operate in parallel, interactive prompts
-can be exceptionally useful for debugging, exploring, and tweaking plots.
-
-There are several different ways to get an interactive prompt for yt, the most
-easy of which is simply to type:
-
-.. code-block:: bash
-
- pyyt
-
-This will start up the python interpreter. You can now execute yt commands as
-normal (once you've imported yt!) and examine your data. There are two other
-handy commands, however, which put you into the IPython interactive shell.
-
-.. warning:: IPython has changed their API substantially in recent versions.
- yt does not support IPython versions newer than 0.10.
-
-You can start up an empty shell, with a handful of useful yt utilities (such as
-tab-completion and pre-imported modules) by executing:
-
-.. code-block:: bash
-
- iyt
-
-The other option, which is shorthand for "iyt plus dataset loading" is to use
-the command-line tool (see :ref:`command-line`) with the ``load`` subcommand
-and to specify a parameter file. For instance:
-
-.. code-block:: bash
-
- yt load cosmoSim_coolhdf5_chk_0026
-
-or
-
-.. code-block:: bash
-
- yt load DD0030/DD0030
-
-This will spawn ``iyt``, but the parameter file given on the command line will
-already be in the namespace as ``pf``. With interactive mode, you can use the
-``pylab`` module to interactively plot, and there is also the object
-``PlotCollectionInteractive`` which can handle setting up draw mode and
-updating plots interactively.
-
-.. _command-line:
-
-Command-line Functions
-----------------------
-
-The developers of yt realize that there is a lot more to analyzing code
-than just making pretty pictures. That is why we included several easy-to-call
-functions that could be executed from a command-line prompt for sharing code
-and images with others, using our GUI Reason, manipulating your data
-google-maps style, updating yt's codebase and more. To get a quick list of
-what is available, just type:
-
-.. code-block:: bash
-
- yt -h
-
-This yields all of the subcommands. To execute any subcommand, simply run:
-
-.. code-block:: bash
-
- yt <subcommand>
-
-Let's go through each subcommand.
-
-.. code-block:: bash
-
- bootstrap_dev Bootstrap a yt development environment
- bugreport Report a bug in yt
- halos Run HaloProfiler on one dataset
- help (?, h) give detailed help on a specific sub-command
- hop Run HOP on one or more datasets
- hubsubmit Submit a mercurial repository to the yt Hub (http://h...
- instinfo Get some information about the yt installation
- load Load a single dataset into an IPython instance
- mapserver Serve a plot in a GMaps-style interface
- pastebin Post a script to an anonymous pastebin
- pastebin_grab Print an online pastebin to STDOUT for local use. Pas...
- pasteboard Place a file into your pasteboard.
- pasteboard_grab Download from your or another user's pasteboard
- plot Create a set of images
- rpdb Connect to a currently running (on localhost) rpd ses...
- serve Run the Web GUI Reason
- stats Print stats and maximum density for one or more datasets
- update Update the yt installation to the most recent version
- upload_image Upload an image to imgur.com. Must be PNG.
-
-bootstrap_dev
-+++++++++++++
-
-After you have installed yt and you want to do some development, there may
-be a few more steps to complete. This function automates building a
-development environment for you by setting up your hg preferences correctly,
-creating/linking to a bitbucket account for hosting and sharing your code,
-and setting up a pasteboard for your code snippets. A full description of
-how this works can be found in :ref:`bootstrap-dev`.
-
-bugreport
-+++++++++
-
-Encountering a bug in your own code can be a big hassle, but it can be
-exponentially worse to find it in someone else's. That's why we tried to
-make it as easy as possible for users to report bugs they find in yt.
-After you go through the necessary channels to make sure you're not just
-making a mistake (see :ref:`asking-for-help`), you can submit bug
-reports using this nice utility.
-
-halos
-+++++
-
-You can easily run the HaloProfiler utility on a single dataset, in order
-to analyze and visualize multiple halos in a simulation simultaneously and
-homogeneously. For more information about the HaloProfiler see
-:ref:`halo_profiling`; for its command line flags, use the help command
-with the halos keyword.
-
-help
-++++
-
-Help behaves as you expect that it might. You can use it with any other
-command-line option to find out more details or if it has any flags:
-
-.. code-block:: bash
-
- yt help <subcommand>
-
-hop
-+++
-
-This lets you run the HOP algorithm as a halo-finder on one or more
-datasets. It nominally reproduces the behavior of enzohop from the
-enzo suite. There are several flags you can use in order to specify
-your threshold, input names, output names, and whether you want to use
-dark matter or all particles. To view these flags run help with the
-hop subcommand.
-
-hubsubmit
-+++++++++
-
-We in the yt camp believe firmly in the ideals of open-source coding. To
-further those ends, we have made a location for people to share their
-nifty and useful codes with other scientists who might be able to use
-them: the `yt hub <http://hub.yt-project.org/>`_. Did you make a cool
-code for generating a movie from your simulation outputs? Submit it to
-the hub. Did you create a perl script that automates something and saves
-you some time while on a supercomputer. Submit it to the hub. And
-using the hubsubmit command, you can do this really easily. If you
-create a mercurial repository for the code you want to submit, just
-run the hubsubmit command from within its directory structure, and we'll
-take care of the rest, by putting it on bitbucket and finally submitting
-it to the hub to share with the rest of the yt community. Check out
-what people have already put up on the
-`yt hub <http://hub.yt-project.org/>`_, and see :ref:`share-your-scripts`
-for more details about sharing your work on the hub.
-
-instinfo
-++++++++
-
-This gives very similar behavior to the update command, in that it
-will automatically update your yt version to the latest in whichever
-repository you're in (stable, development, etc.). It can also provide
-you with the hash of the version you're using.
-
-load
-++++
-
-This will start the iyt interactive environment with your specified
-dataset already loaded. See :ref:`interactive-prompt` for more details.
-
-mapserver
-+++++++++
-
-Ever wanted to interact with your data using the
-`google maps <http://maps.google.com/>`_ interface? Now you can by using the
-yt mapserver. See :ref:`mapserver` for more details.
-
-pastebin and pastebin_grab
-++++++++++++++++++++++++++
-
-The `pastebin <http://paste.yt-project.org/>`_ is an online location where
-you can anonymously post code snippets and error messages to share with
-other users in a quick, informal way. It is often useful for debugging
-code or co-developing. By running the ``pastebin`` subcommand with a
-text file, you send the contents of that file to an anonymous pastebin;
-
-.. code-block:: bash
-
- yt pastebin my_script.py
-
-By running the ``pastebin_grab`` subcommand with a pastebin number
-(e.g. 1768), it will grab the contents of that pastebin and send it to
-STDOUT for local use. For more details see the :ref:`pastebin` section.
-
-.. code-block:: bash
-
- yt pastebin_grab 1768
-
-pasteboard and pasteboard_grab
-++++++++++++++++++++++++++++++
-
-The pasteboard is very similar to the pastebin, except that it is not
-anonymous. It is a place you can put more polished code that you'd like
-to share with others. It might be code that is a step down from what you
-might share on the `yt hub <http://hub.yt-project.org/>`_. Of course,
-you will only have a pasteboard if you've created a development environment
-using the bootstrap-dev subcommand.
-
-plot
-++++
-
-This command generates one or many simple plots for a single dataset.
-By specifying the axis, center, width, etc. (run ``yt help plot`` for
-details), you can create slices and projections easily at the
-command-line.
-
-rpdb
-++++
-
-Connect to a currently running (on localhost) rpd session.
-
-serve
-+++++
-
-The ``serve`` subcommand initiates the Web GUI Reason. See :ref:`reason`.
-
-stats
-+++++
-
-This subcommand provides you with some basic statistics on a given dataset.
-It provides you with the number of grids and cells in each level, the time
-of the dataset, the resolution, and the maximum density in a variety of units.
-It is tantamount to performing the ``print_stats()`` inside of yt.
-
-update
-++++++
-
-This subcommand updates the yt installation to the most recent version for
-your repository (e.g. stable, 2.0, development, etc.). See
-:ref:`automated-update` for more details.
-
-.. _upload-image:
-
-upload_image
-++++++++++++
-
-Images are often worth a thousand words, so when you're trying to
-share a piece of code that generates an image, or you're trying to
-debug image-generation scripts, it can be useful to send your
-co-authors a link to the image. This subcommand makes such sharing
-a breeze. By specifying the image to share, ``upload_image`` automatically
-uploads it anonymously to the website `imgur.com <http://imgur.com/>`_ and
-provides you with a link to share with your collaborators. Note that the
-image *must* be in the PNG format in order to use this function.
-
-.. _reason:
-
-The GUI Reason
---------------
-
-.. warning:: Current versions of Reason may not work quite as expected with
- Firefox. They have all been tested under Chrome, and if you run
- into any bugs with either, please `report them
- <https://bitbucket.org/yt_analysis/yt/issues/new>`_!
-
-Demo
-++++
-
-Cameron created a short screencast of what Reason is, how it works, and how you
-can use it. It's best viewed in full-screen, so click the little X in the
-bottom right.
-
-.. raw:: html
-
- <iframe src="http://player.vimeo.com/video/28506477" width="640"
- height="320" frameborder="0"></iframe>
-
-
-What is Reason?
-+++++++++++++++
-
-Reason is a web-based GUI for yt. It's still currently a BETA sequence, but we
-are working very hard to improve it and ensure it's productive. It's designed
-to act as a very simple web-notebook -- it's not a replacement for something
-like the much more complex IPython web notebook, or the SAGE notebook, but
-rather a means of exploring simulation data easily, safely, and without
-requiring the overhead of additional dependencies.
-
-Everything you need to run reason comes right with the yt install script -- if
-you have installed yt another way, you may need to separately obtain the ExtJS
-packages.
-
-The idea behind reason is to spawn a web server on a shared resource system,
-and connect to that web server from your desktop, tunnelling over SSH. Reason
-is not designed to be run over unencrypted wires; you should either be running
-fully locally or through an SSH tunnel. Reasonable steps have been taken to
-ensure that your connections are safe: each connection occurs only on a random
-port (which is potentially identifiable on a shared user system) and with a
-UUID prefixed into each URL (which should be difficult if not impossible to
-identify without root authority.
-
-Starting Reason
-+++++++++++++++
-
-Reason can be started very easily from the command line:
-
-.. code-block:: bash
-
- $ yt serve
-
-If you are running on your local machine, you can also execute:
-
-.. code-block:: bash
-
- $ yt serve -o
-
-to open up a local web browser window. If you want Reason to search for
-(currently only Enzo) parameter files under your current directory, you can
-execute:
-
-.. code-block:: bash
-
- $ yt serve -o -f
-
-yt will print out something like:
-
-.. code-block:: bash
-
- =============================================================================
- =============================================================================
- Greetings, and welcome to Reason!
- Your private token is c2dcd1dc-d40f-11e0-8f6b-bc305ba67797 .
- DO NOT SHARE THIS TOKEN.
-
- Please direct your browser to:
-
- http://localhost:51707/c2dcd1dc-d40f-11e0-8f6b-bc305ba67797/
-
- =============================================================================
-
- If you are currently ssh'd into a remote machine, you should be able
- to create a new SSH tunnel by typing or copy/pasting this text
- verbatim, while waiting to see the 'ssh>' prompt after the first line.
-
- ~C
- -L51707:localhost:51707
-
- and then pointing a web browser on your local machine to the above URL.
-
- =============================================================================
- =============================================================================
-
-If you are on a remote machine, you will need to execute the one additional
-step that yt mentions in order to be able to connect. Press ~C (that's tilde,
-then C) which should bring up a prompt that looks like ``ssh>`` . At that
-prompt, type what you are told to, which will open up a port over which you can
-tunnel to talk to the server:
-
-.. code-block:: bash
-
- ssh>-L51707:localhost:51707
-
-Now you can open the URL printed out.
-
-What is Within Reason?
-++++++++++++++++++++++
-
-Once you start up reason, for the first time, you will see something like:
-
-.. image:: _images/rs1_welcome.png
- :target: _images/rs1_welcome.png
- :scale: 50%
-
-This is the basic layout. There are three primary components:
-
- * (top, left) *Object List*: The list of parameter files and objects. Every
- time you load a parameter file or create a (persistent) data object, it will
- appear here.
- * (top, right) *Interaction Area*: this is where the notebook and any
- widgets will appear.
- * (bottom) *Log Area*: The messages normally spit out to the log will be put
- here.
-
-The main mechanism of interacting with reason is through the notebook. You can
-type commands in. When you either click the down-arrow on the right or press
-Shift-Enter, these commands will be sent and execute on the far side. This
-should be thought of more like a series of mini-scripts, rather than individual
-lines: you can send multiple lines of input, including for loops, conditionals,
-and so on, very easily. If you want to access any object, you can drag it from
-the object list, as demonstrated here, where I have drug in the parameter file
-and called ``print_stats`` on its hierarchy:
-
-.. image:: _images/rs2_printstats.png
- :target: _images/rs2_printstats.png
- :scale: 50%
-
-Any command can be executed here, and the output will appear in an output cell
-below. The output cells have two sets of arrows on them. The leftmost (blue)
-arrow will upload the contents of that cell to the yt `pastebin
-<http://paste.yt-project.org/>`_. The rightmost (green) set of double arrows
-will put the contents of that cell up top, in the execution zone -- this is
-useful if you are iterating on a command.
-
-You can also right-click on a parameter file to create slices, projections and
-to view grid information. *(There is also an experimental WebGL component that
-is currently disabled!)* If you right click on a parameter file, you can
-choose to project the dataset. Progress bars have been added, so you should be
-mapserver.png
-able to view progress as normal:
-
-.. image:: _images/rs3_proj.png
- :target: _images/rs3_proj.png
- :scale: 50%
-
-Once the projecting is done, a new tab for the plot widget should be opened.
-This will include the image, a colorbar, a metadata window, and a couple
-buttons to press:
-
-.. image:: _images/rs4_widget.png
- :target: _images/rs4_widget.png
- :scale: 50%
-
-You can ctrl-click on the image (this is broken in Firefox, but works in
-Chrome! We're working to fix it!) to re-center on a given location. The
-scroll bar at the bottom controls zooming, and you can dynamically change the
-field that is displayed. There are zoom controls as well as panning controls,
-and the option to upload the image to `imgur.com <http://imgur.com/>`_, a
-simple image sharing service on the web.
-
-There are also phase plot widgets, slice widgets, and we're working on a few
-other fun WebGL widgets.
-
-What Special Things Can Reason Do?
-++++++++++++++++++++++++++++++++++
-
-There are several special commands that Reason builds in, that make a few
-common operations easy.
-
- * ``load_script(filename)`` will load a script from the file system and insert
- it into the currently-active input area.
- * ``deliver_image(filename)`` can accept a filename (PNG-only), a string of
- binary PNG data, or a file-like object full of PNG data. This data will
- then be delivered to the browser, in the next active cell. This is the
- mechanism by which most image display occurs in Reason.
-
-Plot collections have been instrumented to work with Reason. This means that
-if you create a plot collection like normal, as soon as you run ``pc.save()``
-the images that are saved out will be displayed in the active cell output.
-
-Pylab has also been modified to work with Reason, and Reason imports it before
-it starts up. You can run any normal pylab command:
-
-.. code-block:: python
-
- pylab.plot([1, 2, 3, 4, 5], [10, 210, 503, 1, 42.1])
-
-and the output should appear in the active cell.
-
-You may notice that there is a menu above the object list:
-
-.. image:: _images/rs5_menu.png
- :scale: 50%
- :target: _images/rs5_menu.png
-
-There are a number of options here:
-
- * ``Open`` and ``Open Directory`` -- currently disabled while we implement
- this functionality.
- * ``Save Script`` -- Save the concatenated set of executed cells to a file on
- the server. This script should be directly executable, including all widget
- interactions.
- * ``Download Script`` -- Download the concatenated set of executed cells to a
- file on your local machine.
- * ``Pastebin Script`` -- Upload the concatenated set of executed cells to the
- `yt pastebin <http://paste.yt-project.org/>`.
- * ``Help`` -- A quick little help file.
- * ``yt Chat`` -- Open up the Web portal to IRC, for live chatting with other
- yt users and developers.
-
-Please feel free to share with us your thoughts and experiences -- good and
-bad! -- with Reason.
-
-I Want To Add A Widget!
-+++++++++++++++++++++++
-
-Adding a new widget is pretty straightforward, but you might need some guidance
-along the way. It might be a good idea to stop by the yt-dev mailing list (see
-:ref:`getting-involved`) but you can also explore how widgets are made in the
-directory ``yt/gui/reason/html/js/`` and take a look at the specific python
-code in ``yt/gui/reason/extdirect_repl.py``.
-
-But seriously, if you have the desire to play with or update or extend or
-prettify reason, we'd be really excited to work with you.
-
-.. _mapserver:
-
-Mapserver
----------
-
-The mapserver is a new, experimental feature. It's based on `Leaflet
-<http://leaflet.cloudmade.com/>`, a library written to create zoomable,
-map-tile interfaces. (Similar to Google Maps.) yt provides everything you
-need to start up a web server that will interactively re-pixelize an adaptive
-image. This means you can explore your datasets in a fully pan-n-zoom
-interface.
-
-To start up the mapserver, you can use the command ``yt`` (see
-:ref:`command-line`) with the ``mapserver`` subcommand. It takes several of
-the same options and arguments as the ``plot`` subcommand. For instance:
-
-.. code-block:: bash
-
- yt mapserver DD0050/DD0050
-
-That will take a slice along the x axis at the center of the domain. The
-field, projection, weight and axis can all be specified on the command line.
-
-When you do this, it will spawn a micro-webserver on your localhost, and output
-the URL to connect to to standard output. You can connect to it (or create an
-SSH tunnel to connect to it) and explore your data. Double-clicking zooms, and
-dragging drags.
-
-.. image:: _images/mapserver.png
- :scale: 50%
-
-This is also functional on touch-capable devices such as Android Tablets and
-iPads/iPhones. In future versions, we hope to add halo-overlays and
-markers-of-interest to this.
-
-.. _paraview:
-
-ParaView
---------
-
-.. note:: As of 2.2 the ParaView-yt interoperability is still a work in
- progress. Much can be done, but the setup still requires a bit of work.
-
-ParaView support for yt is still preliminary, but is possible. Future versions
-of ParaView will include the necessary components. For now, however, to enable
-yt as a plugin in ParaView you will have to build from source and use the
-branches ``AMR-Refactor`` in both VTK and ParaView. When building, you must
-also link against the Python with which yt was installed.
-
-Finally, to enable the yt ParaView plugin, you must also install the yt plugin,
-available in the `yt-paraview
-<https://gitorious.org/yt-paraview/paraview-plugins>`_ git repository. (You
-should be able to use ``pip install hg-git`` to install hg-git, which enables
-checking out git repos via mercurial.)
-
-Jorge Poco has created a YouTube video of `ParaView using yt as a plugin
-<http://www.youtube.com/watch?v=cOv4Ob2q1fM>`_:
-
-.. youtube:: cOv4Ob2q1fM
- width: 600
- height: 400
-
-
-For more information, there are also two blog posts about this:
-
- * http://blog.yt-project.org/a-movie-of-yt-in-paraview
- * http://blog.yt-project.org/paraview-and-yt
diff -r 229f95233b378accc062284b5061184ff65ce316 -r 32a1ab8ea1e73f1fd0c9d89817e9b461059c28bd source/reference/funding.rst
--- a/source/reference/funding.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-What Has Funded yt
-==================
-
-yt has enjoyed the support of a number of agencies and institutions over the
-years. Here is a short list of the various grants that have supported it, as
-well as institutions where its development has enjoyed hospitality.
https://bitbucket.org/yt_analysis/yt-doc/changeset/18b55a05b6fb/
changeset: 18b55a05b6fb
user: MatthewTurk
date: 2012-07-06 17:05:25
summary: Moving to a flatter structure for the reference documents
affected #: 9 files
diff -r 32a1ab8ea1e73f1fd0c9d89817e9b461059c28bd -r 18b55a05b6fbff3a3b8eb8f20ff19d34d8ef53cc source/api.rst
--- /dev/null
+++ b/source/api.rst
@@ -0,0 +1,434 @@
+Plots and the Plotting Interface
+================================
+
+.. py:module:: yt.visualization
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.visualization.plot_collection.PlotCollection
+ ~yt.visualization.plot_collection.PlotCollectionInteractive
+ ~yt.visualization.plot_types.SlicePlot
+ ~yt.visualization.plot_types.ProjectionPlot
+ ~yt.visualization.plot_types.PhasePlot
+ ~yt.visualization.plot_types.Profile1DPlot
+ ~yt.visualization.fixed_resolution.FixedResolutionBuffer
+ ~yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer
+ ~yt.visualization.profile_plotter.PhasePlotter
+ ~yt.visualization.plot_collection.get_multi_plot
+
+Data Sources
+============
+
+.. py:module:: yt.data_objects
+
+.. _physical-object-api:
+
+Physical Objects
+----------------
+
+These are the objects that act as physical selections of data, describing a
+region in space. These are not typically addressed directly; see
+:ref:`available-objects` for more information.
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.data_objects.data_containers.AMRData
+ ~yt.data_objects.data_containers.AMR1DData
+ ~yt.data_objects.data_containers.AMR2DData
+ ~yt.data_objects.data_containers.AMR3DData
+ ~yt.data_objects.data_containers.AMRCoveringGridBase
+ ~yt.data_objects.data_containers.AMRCuttingPlaneBase
+ ~yt.data_objects.data_containers.AMRCylinderBase
+ ~yt.data_objects.data_containers.AMRGridCollectionBase
+ ~yt.data_objects.data_containers.AMRRayBase
+ ~yt.data_objects.data_containers.AMROrthoRayBase
+ ~yt.data_objects.data_containers.AMRStreamlineBase
+ ~yt.data_objects.data_containers.AMRProjBase
+ ~yt.data_objects.data_containers.AMRRegionBase
+ ~yt.data_objects.data_containers.AMRSliceBase
+ ~yt.data_objects.data_containers.AMRSmoothedCoveringGridBase
+ ~yt.data_objects.data_containers.AMRSphereBase
+
+Time Series Objects
+-------------------
+
+These are objects that either contain and represent or operate on series of
+datasets.
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.data_objects.time_series.TimeSeriesData
+ ~yt.data_objects.time_series.TimeSeriesDataObject
+ ~yt.data_objects.time_series.TimeSeriesQuantitiesContainer
+ ~yt.data_objects.time_series.AnalysisTaskProxy
+
+Frontends
+---------
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.data_objects.grid_patch.AMRGridPatch
+ ~yt.data_objects.hierarchy.AMRHierarchy
+ ~yt.data_objects.static_output.StaticOutput
+
+Enzo
+++++
+
+.. py:module:: yt.frontends.enzo
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.frontends.enzo.data_structures.EnzoGrid
+ ~yt.frontends.enzo.data_structures.EnzoHierarchy
+ ~yt.frontends.enzo.data_structures.EnzoStaticOutput
+
+Orion
++++++
+
+.. py:module:: yt.frontends.orion
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.frontends.orion.data_structures.OrionGrid
+ ~yt.frontends.orion.data_structures.OrionHierarchy
+ ~yt.frontends.orion.data_structures.OrionStaticOutput
+
+FLASH
++++++
+
+.. py:module:: yt.frontends.flash
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.frontends.flash.data_structures.FLASHGrid
+ ~yt.frontends.flash.data_structures.FLASHHierarchy
+ ~yt.frontends.flash.data_structures.FLASHStaticOutput
+
+Chombo
+++++++
+
+.. py:module:: yt.frontends.chombo
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.frontends.chombo.data_structures.ChomboGrid
+ ~yt.frontends.chombo.data_structures.ChomboHierarchy
+ ~yt.frontends.chombo.data_structures.ChomboStaticOutput
+
+RAMSES
+++++++
+
+.. py:module:: yt.frontends.ramses
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.frontends.ramses.data_structures.RAMSESGrid
+ ~yt.frontends.ramses.data_structures.RAMSESHierarchy
+ ~yt.frontends.ramses.data_structures.RAMSESStaticOutput
+
+Derived Datatypes
+=================
+
+Profiles and Histograms
+-----------------------
+
+These types are used to sum data up and either return that sum or return an
+average. Typically they are more easily used through the
+`yt.visualization.plot_collection` interface.
+
+.. py:module:: yt.data_objects
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.data_objects.profiles.BinnedProfile1D
+ ~yt.data_objects.profiles.BinnedProfile2D
+ ~yt.data_objects.profiles.BinnedProfile3D
+
+Halo Finding and Particle Functions
+-----------------------------------
+
+Halo finding can be executed using these types.
+
+.. py:module:: yt.analysis_modules.halo_finding
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.analysis_modules.halo_finding.halo_objects.FOFHaloFinder
+ ~yt.analysis_modules.halo_finding.halo_objects.HOPHaloFinder
+ ~yt.analysis_modules.halo_finding.halo_objects.Halo
+ ~yt.analysis_modules.halo_finding.halo_objects.HaloList
+
+Two Point Functions
+-------------------
+
+These functions are designed to create correlations or other results of
+operations acting on two spatially-distinct points in a data source. See also
+:ref:`two_point_functions`.
+
+.. py:module:: yt.analysis_modules.two_point_functions
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.analysis_modules.api.TwoPointFunctions
+ ~yt.analysis_modules.api.FcnSet
+
+Field Types
+===========
+
+.. py:module:: yt.data_objects
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.data_objects.field_info_container.DerivedField
+ ~yt.data_objects.field_info_container.FieldInfoContainer
+ ~yt.data_objects.field_info_container.ValidateDataField
+ ~yt.data_objects.field_info_container.ValidateGridType
+ ~yt.data_objects.field_info_container.ValidateParameter
+ ~yt.data_objects.field_info_container.ValidateProperty
+ ~yt.data_objects.field_info_container.ValidateSpatial
+
+Extension Types
+===============
+
+Coordinate Transformations
+--------------------------
+
+.. py:module:: yt.analysis_modules.coordinate_transformation
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.analysis_modules.coordinate_transformation.transforms.arbitrary_regrid
+ ~yt.analysis_modules.coordinate_transformation.transforms.spherical_regrid
+
+Cosmology and Star Particle Analysis
+------------------------------------
+
+For the generation of stellar SEDs. (See also :ref:`star_analysis`.)
+
+.. py:module:: yt.analysis_modules.star_analysis
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.analysis_modules.star_analysis.sfr_spectrum.StarFormationRate
+ ~yt.analysis_modules.star_analysis.sfr_spectrum.SpectrumBuilder
+
+Light cone generation and simulation analysis. (See also
+:ref:`light-cone-generator`.)
+
+.. py:module:: yt.analysis_modules.light_cone
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.analysis_modules.light_cone.light_cone.LightCone
+
+Volume Rendering
+----------------
+
+See also :ref:`volume_rendering`.
+
+.. py:module:: yt.visualization.volume_rendering
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.visualization.volume_rendering.camera.Camera
+ ~yt.visualization.volume_rendering.camera.off_axis_projection
+ ~yt.visualization.volume_rendering.transfer_functions.ColorTransferFunction
+ ~yt.visualization.volume_rendering.grid_partitioner.HomogenizedVolume
+ ~yt.visualization.volume_rendering.transfer_functions.MultiVariateTransferFunction
+ ~yt.utilities.amr_utils.PartitionedGrid
+ ~yt.utilities.amr_kdtree.amr_kdtree.AMRKDTree
+ ~yt.visualization.volume_rendering.camera.PerspectiveCamera
+ ~yt.visualization.volume_rendering.transfer_functions.PlanckTransferFunction
+ ~yt.visualization.volume_rendering.transfer_functions.ProjectionTransferFunction
+ ~yt.visualization.volume_rendering.camera.StereoPairCamera
+ ~yt.visualization.volume_rendering.transfer_functions.TransferFunction
+
+.. _image_writer:
+
+Streamlining
+------------
+
+See also :ref:`streamlines`.
+
+.. py:module:: yt.visualization.streamlines
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.visualization.streamlines.Streamlines
+
+Image Writing
+-------------
+
+These functions are all used for fast writing of images directly to disk,
+without calling matplotlib. This can be very useful for high-cadence outputs
+where colorbars are unnecessary or for volume rendering.
+
+.. py:module:: yt.visualization
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.visualization.image_writer.multi_image_composite
+ ~yt.visualization.image_writer.write_bitmap
+ ~yt.visualization.image_writer.write_image
+ ~yt.visualization.image_writer.map_to_colors
+ ~yt.visualization.image_writer.strip_colormap_data
+ ~yt.visualization.image_writer.splat_points
+ ~yt.visualization.image_writer.annotate_image
+
+We also provide a module that is very good for generating EPS figures,
+particularly with complicated layouts.
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.visualization.eps_writer.DualEPS
+ ~yt.visualization.eps_writer.single_plot
+ ~yt.visualization.eps_writer.multiplot
+ ~yt.visualization.eps_writer.multiplot_yt
+ ~yt.visualization.eps_writer.return_cmap
+
+.. _image-panner-api:
+
+Image Panning and Scanning
+--------------------------
+
+See also :ref:`image-panner`.
+
+.. py:module:: yt.visualization.image_panner
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.visualization.image_panner.vm_panner.VariableMeshPanner
+ ~yt.visualization.image_panner.vm_panner.WindowedVariableMeshPanner
+ ~yt.visualization.image_panner.vm_panner.MultipleWindowVariableMeshPanner
+ ~yt.visualization.image_panner.vm_panner.ImageSaver
+
+Derived Quantities
+==================
+
+See :ref:`derived-quantities`.
+
+.. py:module:: yt.data_objects
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.data_objects.derived_quantities._AngularMomentumVector
+ ~yt.data_objects.derived_quantities._BaryonSpinParameter
+ ~yt.data_objects.derived_quantities._BulkVelocity
+ ~yt.data_objects.derived_quantities._CenterOfMass
+ ~yt.data_objects.derived_quantities._Extrema
+ ~yt.data_objects.derived_quantities._IsBound
+ ~yt.data_objects.derived_quantities._MaxLocation
+ ~yt.data_objects.derived_quantities._ParticleSpinParameter
+ ~yt.data_objects.derived_quantities._TotalMass
+ ~yt.data_objects.derived_quantities._TotalQuantity
+ ~yt.data_objects.derived_quantities._WeightedAverageQuantity
+
+.. _callback-api:
+
+Callback List
+=============
+
+.. py:module:: yt.visualization
+
+See also :ref:`callbacks`.
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.visualization.plot_modifications.ArrowCallback
+ ~yt.visualization.plot_modifications.ClumpContourCallback
+ ~yt.visualization.plot_modifications.ContourCallback
+ ~yt.visualization.plot_modifications.CoordAxesCallback
+ ~yt.visualization.plot_modifications.CuttingQuiverCallback
+ ~yt.visualization.plot_modifications.GridBoundaryCallback
+ ~yt.visualization.plot_modifications.HopCircleCallback
+ ~yt.visualization.plot_modifications.HopParticleCallback
+ ~yt.visualization.plot_modifications.LabelCallback
+ ~yt.visualization.plot_modifications.LinePlotCallback
+ ~yt.visualization.plot_modifications.MarkerAnnotateCallback
+ ~yt.visualization.plot_modifications.ParticleCallback
+ ~yt.visualization.plot_modifications.PointAnnotateCallback
+ ~yt.visualization.plot_modifications.QuiverCallback
+ ~yt.visualization.plot_modifications.SphereCallback
+ ~yt.visualization.plot_modifications.TextLabelCallback
+ ~yt.visualization.plot_modifications.TitleCallback
+ ~yt.visualization.plot_modifications.UnitBoundaryCallback
+ ~yt.visualization.plot_modifications.VelocityCallback
+ ~yt.visualization.plot_modifications.VobozCircleCallback
+
+Function List
+=============
+
+.. py:module:: yt.funcs
+.. py:module:: yt.analysis_modules.level_sets
+.. py:module:: yt.utilities
+.. py:module:: yt.utilities.parallel_tools
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.convenience.load
+ ~yt.funcs.deprecate
+ ~yt.funcs.ensure_list
+ ~yt.funcs.get_pbar
+ ~yt.funcs.humanize_time
+ ~yt.funcs.insert_ipython
+ ~yt.funcs.iterable
+ ~yt.funcs.just_one
+ ~yt.funcs.only_on_root
+ ~yt.funcs.paste_traceback
+ ~yt.funcs.pdb_run
+ ~yt.funcs.print_tb
+ ~yt.funcs.rootonly
+ ~yt.funcs.time_execution
+ ~yt.analysis_modules.level_sets.contour_finder.identify_contours
+ ~yt.utilities.parallel_tools.parallel_analysis_interface.parallel_blocking_call
+ ~yt.utilities.parallel_tools.parallel_analysis_interface.parallel_passthrough
+ ~yt.utilities.parallel_tools.parallel_analysis_interface.parallel_root_only
+ ~yt.utilities.parallel_tools.parallel_analysis_interface.parallel_simple_proxy
+ ~yt.utilities.parallel_tools.parallel_analysis_interface.parallel_splitter
+
+Miscellaneous Types
+===================
+
+.. py:module:: yt.config
+.. py:module:: yt.analysis_modules.hierarchy_subset
+.. py:module:: yt.analysis_modules.spectral_integrator
+.. py:module:: yt.utilities
+.. py:module:: yt.analysis_modules.level_sets
+.. py:module:: yt.utilities.parallel_tools
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.config.YTConfigParser
+ ~yt.analysis_modules.hierarchy_subset.hierarchy_subset.ConstructedRootGrid
+ ~yt.analysis_modules.hierarchy_subset.hierarchy_subset.ExtractedHierarchy
+ ~yt.analysis_modules.spectral_integrator.spectral_frequency_integrator.SpectralFrequencyIntegrator
+ ~yt.utilities.parameter_file_storage.ParameterFileStore
+ ~yt.data_objects.data_containers.FakeGridForParticles
+ ~yt.utilities.parallel_tools.parallel_analysis_interface.ObjectIterator
+ ~yt.utilities.parallel_tools.parallel_analysis_interface.ParallelAnalysisInterface
+ ~yt.utilities.parallel_tools.parallel_analysis_interface.ParallelObjectIterator
diff -r 32a1ab8ea1e73f1fd0c9d89817e9b461059c28bd -r 18b55a05b6fbff3a3b8eb8f20ff19d34d8ef53cc source/changelog.rst
--- /dev/null
+++ b/source/changelog.rst
@@ -0,0 +1,199 @@
+.. _changelog:
+
+ChangeLog
+=========
+
+This is a non-comprehensive log of changes to the code.
+
+Version 2.3
+-----------
+
+ * Multi-level parallelism
+ * Real, extensive answer tests
+ * Boolean data regions (see :ref:`boolean_data_objects`)
+ * Isocontours / flux calculations (see :ref:`extracting-isocontour-information`)
+ * Field reorganization (see :ref:`types_of_fields`)
+ * PHOP memory improvements
+ * Bug fixes for tests
+ * Parallel data loading for RAMSES, along with other speedups and improvements
+ there
+ * WebGL interface for isocontours and a pannable map widget added to Reason
+ (see :ref:`within-reason`)
+ * Performance improvements for volume rendering
+ * Adaptive HEALpix support (see :ref:`adaptive_healpix_volume_rendering`)
+ * Column density calculations (see :ref:`radial_column_density`)
+ * Massive speedup for 1D profiles
+ * Lots more, bug fixes etc.
+ * Substantial improvements to the documentation, including
+ :ref:`manual-plotting` and a revamped :ref:`orientation`.
+
+Version 2.2
+-----------
+
+ * Command-line submission to the yt Hub (http://hub.yt-project.org/)
+ * Initial release of the web-based GUI Reason, designed for efficient remote
+ usage over SSH tunnels (see :ref:`reason`)
+ * Absorption line spectrum generator for cosmological simulations (see
+ :ref:`absorption_spectrum`)
+ * Interoperability with ParaView for volume rendering, slicing, and so forth
+ * Support for the Nyx code
+ * An order of magnitude speed improvement in the RAMSES support
+ * Quad-tree projections, speeding up the process of projecting by up to an
+ order of magnitude and providing better load balancing
+ * “mapserver” for in-browser, Google Maps-style slice and projection
+ visualization (see :ref:`mapserver`)
+ * Many bug fixes and performance improvements
+ * Halo loader (see :ref:`load_haloes`)
+
+Version 2.1
+-----------
+
+ * HEALpix-based volume rendering for 4pi, allsky volume rendering
+ * libconfig is now included
+ * SQLite3 and Forthon now included by default in the install script
+ * Development guide has been lengthened substantially and a development
+ bootstrap script (:ref:`bootstrap-dev`) is now included.
+ * Installation script now installs Python 2.7 and HDF5 1.8.6
+ * iyt now tab-completes field names
+ * Halos can now be stored on-disk much more easily between HaloFinding runs.
+ * Halos found inline in Enzo can be loaded and merger trees calculated
+ * Support for CASTRO particles has been added
+ * Chombo support updated and fixed
+ * New code contributions
+ * Contour finder has been sped up by a factor of a few
+ * Constrained two-point functions are now possible, for LOS power spectra
+ * Time series analysis (:ref:`time-series-analysis`) now much easier
+ * Stream Lines now a supported 1D data type (:class:`AMRStreamlineBase`)
+ * Stream Lines now able to be calculated and plotted (:ref:`streamlines`)
+ * In situ Enzo visualization now much faster
+ * "gui" source directory reorganized and cleaned up
+ * Cython now a compile-time dependency, reducing the size of source tree
+ updates substantially
+ * ``yt-supplemental`` repository now checked out by default, containing
+ cookbook, documentation, handy mercurial extensions, and advanced plotting
+ examples and helper scripts.
+ * Pasteboards now supported and available
+ * Parallel yt efficiency improved by removal of barriers and improvement of
+ collective operations
+
+Version 2.0
+-----------
+
+ * Major reorganization of the codebase for speed, ease of modification, and maintainability
+ * Re-organization of documentation and addition of Orientation Session
+ * Support for FLASH code
+ * Preliminary support for MAESTRO, CASTRO, ART, and RAMSES (contributions welcome!)
+ * Perspective projection for volume rendering
+ * Exporting to Sunrise
+ * Preliminary particle rendering in volume rendering visualization
+ * Drastically improved parallel volume rendering, via kD-tree decomposition
+ * Simple merger tree calculation for FOF catalogs
+ * New and greatly expanded documentation, with a "source" button
+
+Version 1.7
+-----------
+
+ * Direct writing of PNGs (see :ref:`image_writer`)
+ * 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`)
+ * 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
+ :ref:`volume_rendering`)
+ * Added Camera interface to volume rendering (See :ref:`volume_rendering`)
+ * Off-axis projection (See :ref:`volume_rendering`)
+ * Stereo (toe-in) volume rendering (See :ref:`volume_rendering`)
+ * DualEPS extension for better EPS construction
+ * yt now uses Distribute instead of SetupTools
+ * Better ``iyt`` initialization for GUI support
+ * Rewritten, memory conservative and speed-improved contour finding algorithm
+ * Speed improvements to volume rendering
+ * Preliminary support for the Tiger code
+ * Default colormap is now ``algae``
+ * Lightweight projection loading with ``projload``
+ * Improvements to `yt.data_objects.time_series`
+ * Improvements to :class:`yt.extensions.EnzoSimulation` (See
+ :ref:`analyzing-an-entire-simulation`)
+ * Removed ``direct_ray_cast``
+ * Fixed bug causing double data-read in projections
+ * Added Cylinder support to ParticleIO
+ * Fixes for 1- and 2-D Enzo datasets
+ * Preliminary, largely non-functional Gadget support
+ * Speed improvements to basic HOP
+ * Added physical constants module
+ * Beginning to standardize and enforce docstring requirements, changing to
+ ``autosummary``-based API documentation.
+
+Version 1.6.1
+-------------
+
+ * Critical fixes to ParticleIO
+ * Halo mass function fixes for comoving coordinates
+ * Fixes to halo finding
+ * Fixes to the installation script
+ * "yt instinfo" command to report current installation information as well as
+ auto-update some types of installations
+ * Optimizations to the volume renderer (2x-26x reported speedups)
+
+Version 1.6
+-----------
+
+Version 1.6 is a point release, primarily notable for the new parallel halo
+finder (see :ref:`halo_finding`)
+
+ * (New) Parallel HOP ( http://arxiv.org/abs/1001.3411 , :ref:`halo_finding` )
+ * (Beta) Software ray casting and volume rendering
+ (see :ref:`volume_rendering`)
+ * Rewritten, faster and better contouring engine for clump identification
+ * Spectral Energy Distribution calculation for stellar populations
+ (see :ref:`synthetic_spectrum`)
+ * Optimized data structures such as the hierarchy
+ * Star particle analysis routines
+ (see :ref:`star_analysis`)
+ * Halo mass function routines (see :ref:`hmf_howto`)
+ * Completely rewritten, massively faster and more memory efficient Particle IO
+ * Fixes for plots, including normalized phase plots
+ * Better collective communication in parallel routines
+ * Consolidation of optimized C routines into ``amr_utils``
+ * Many bug fixes and minor optimizations
+
+Version 1.5
+-----------
+
+Version 1.5 features many new improvements, most prominently that of the
+addition of parallel computing abilities (see :ref:`parallel-computation`) and
+generalization for multiple AMR data formats, specifically both Enzo and Orion.
+
+ * Rewritten documentation
+ * Fully parallel slices, projections, cutting planes, profiles,
+ quantities
+ * Parallel HOP
+ * Friends-of-friends halo finder
+ * Object storage and serialization
+ * Major performance improvements to the clump finder (factor of five)
+ * Generalized domain sizes
+ * Generalized field info containers
+ * Dark Matter-only simulations
+ * 1D and 2D simulations
+ * Better IO for HDF5 sets
+ * Support for the Orion AMR code
+ * Spherical re-gridding
+ * Halo profiler
+ * Disk image stacker
+ * Light cone generator
+ * Callback interface improved
+ * Several new callbacks
+ * New data objects -- ortho and non-ortho rays, limited ray-tracing
+ * Fixed resolution buffers
+ * Spectral integrator for CLOUDY data
+ * Substantially better interactive interface
+ * Performance improvements *everywhere*
+ * Command-line interface to *many* common tasks
+ * Isolated plot handling, independent of PlotCollections
+
+Version 1.0
+-----------
+
+ * Initial release!
diff -r 32a1ab8ea1e73f1fd0c9d89817e9b461059c28bd -r 18b55a05b6fbff3a3b8eb8f20ff19d34d8ef53cc source/conf.py
--- a/source/conf.py
+++ b/source/conf.py
@@ -241,4 +241,4 @@
'http://matplotlib.sourceforge.net/': None,
}
-autosummary_generate = glob.glob("reference/api/*.rst")
+autosummary_generate = glob.glob("api.rst")
diff -r 32a1ab8ea1e73f1fd0c9d89817e9b461059c28bd -r 18b55a05b6fbff3a3b8eb8f20ff19d34d8ef53cc source/configuration.rst
--- /dev/null
+++ b/source/configuration.rst
@@ -0,0 +1,75 @@
+.. _configuration-file:
+
+Configuration File
+==================
+
+yt will look for and recognize the file ``$HOME/.yt/config`` as a configuration
+file, containing several options that can be modified and adjusted to control
+runtime behavior. For example, a sample ``$HOME/.yt/config`` file could look
+like:
+
+.. code-block:: none
+
+ [yt]
+ loglevel = 1
+ maximumstoredpfs = 10000
+
+This configuration file would set the logging threshold much lower, enabling
+much more voluminous output from yt. Additionally, it increases the number of
+parameter files tracked between instantiations of yt.
+
+In addition to setting parameters in the configuration file itself, you can set
+them at runtime.
+
+.. warning:: Several parameters are only accessed when yt starts up: therefore,
+ if you want to modify any configuration parameters at runtime, you should
+ execute the appropriate commands at the *very top* of your script!
+
+This involves importing the configuration object and then setting a given
+parameter to be equal to a specific string. Note that even for items that
+accept integers, floating points and other non-string types, you *must* set
+them to be a string or else the configuration object will consider them broken.
+
+Here is an example script, where we adjust the logging at startup:
+
+.. code-block:: python
+
+ from yt.config import ytcfg
+ ytcfg["yt", "loglevel"] = "1"
+
+ from yt.mods import *
+ pf = load("my_data0001")
+ pf.h.print_stats()
+
+This has the same effect as setting ``loglevel = 1`` in the configuration file.
+
+The following parameters are available.
+
+* ``__parallel`` (default: ``'False'``): Internal parameter governing whether this
+ run is being executed in parallel or not. Can be read from.
+* ``__parallel_rank`` (default: ``'0'``): Internal parameter governing the rank of
+ the current processor. Can be read from.
+* ``__parallel_size`` (default: ``'1'``): Internal parameter governing the size of
+ the parallel job. Can be read from.
+* ``coloredlogs`` (default: ``'False'``): Should logs be colored?
+* ``inline`` (default: ``'False'``): Internal parameter indicating whether this
+ session is being called from within a running simulation code.
+* ``loadfieldplugins`` (default: ``'True'``): Do we want to load the plugin file?
+* ``logfile`` (default: ``'False'``): Should we output to a log file in the
+ filesystem?
+* ``loglevel`` (default: ``'20'``): What is the threshold (0 to 50) for outputing
+ log files?
+* ``maximumstoredpfs`` (default: ``'500'``): How many parameter files should be
+ tracked between sessions?
+* ``onlydeserialize`` (default: ``'False'``): If true, only pull from .yt files,
+ never add to them.
+* ``parameterfilestore`` (default: ``'parameter_files.csv'``): The name of the file
+ in ``$HOME/.yt/`` in which parameter files will be tracked.
+* ``pluginfilename`` (default ``'my_plugins.py'``) The name of our plugin file.
+* ``serialize`` (default: ``'True'``): Are we allowed to write to the ``.yt`` file?
+* ``storeparameterfiles`` (default: ``'False'``): Should we track parameter files
+ between sessions?
+* ``suppressStreamLogging`` (default: ``'False'``): If true, execution mode will be
+ quiet.
+* ``timefunctions`` (default: ``'False'``): Should (some) functions report their
+ runtime?
diff -r 32a1ab8ea1e73f1fd0c9d89817e9b461059c28bd -r 18b55a05b6fbff3a3b8eb8f20ff19d34d8ef53cc source/field_list.rst
--- /dev/null
+++ b/source/field_list.rst
@@ -0,0 +1,5178 @@
+.. _field-list:
+
+Field List
+==========
+
+This is a list of all fields available in ``yt``. It has been organized by the
+type of code that each field is supported by. "Universal" fields are available
+everywhere, "Enzo" fields in Enzo datasets, "Orion" fields in Orion datasets,
+and so on.
+
+.. note:: Universal fields will be overridden by a code-specific field.
+
+.. rubric:: Table of Contents
+
+.. contents::
+ :depth: 2
+ :local:
+ :backlinks: none
+
+Universal Field List
+--------------------
+
+AbsDivV
++++++++
+
+ * Units: :math:`\rm{s}^{-1}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _AbsDivV(field, data):
+ return na.abs(data['DivV'])
+
+
+**Convert Function Source**
+
+No source available.
+
+AngularMomentum
++++++++++++++++
+
+ * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _AngularMomentum(field, data):
+ return data["CellMass"] * data["SpecificAngularMomentum"]
+
+
+**Convert Function Source**
+
+No source available.
+
+AngularMomentumMSUNKMSMPC
++++++++++++++++++++++++++
+
+ * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _AngularMomentum(field, data):
+ return data["CellMass"] * data["SpecificAngularMomentum"]
+
+
+**Convert Function Source**
+
+No source available.
+
+AngularMomentumX
+++++++++++++++++
+
+ * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _AngularMomentumX(field, data):
+ return data["CellMass"] * data["SpecificAngularMomentumX"]
+
+
+**Convert Function Source**
+
+No source available.
+
+AngularMomentumY
+++++++++++++++++
+
+ * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _AngularMomentumY(field, data):
+ return data["CellMass"] * data["SpecificAngularMomentumY"]
+
+
+**Convert Function Source**
+
+No source available.
+
+AngularMomentumZ
+++++++++++++++++
+
+ * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _AngularMomentumZ(field, data):
+ return data["CellMass"] * data["SpecificAngularMomentumZ"]
+
+
+**Convert Function Source**
+
+No source available.
+
+AveragedDensity
++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _AveragedDensity(field, data):
+ nx, ny, nz = data["Density"].shape
+ new_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')
+ weight_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')
+ i_i, j_i, k_i = na.mgrid[0:3,0:3,0:3]
+ for i,j,k in zip(i_i.ravel(),j_i.ravel(),k_i.ravel()):
+ sl = [slice(i,nx-(2-i)),slice(j,ny-(2-j)),slice(k,nz-(2-k))]
+ new_field += data["Density"][sl] * data["CellMass"][sl]
+ weight_field += data["CellMass"][sl]
+ # Now some fancy footwork
+ new_field2 = na.zeros((nx,ny,nz))
+ new_field2[1:-1,1:-1,1:-1] = new_field/weight_field
+ return new_field2
+
+
+**Convert Function Source**
+
+No source available.
+
+Baryon_Overdensity
+++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Baryon_Overdensity(field, data):
+ if data.pf.has_key('omega_baryon_now'):
+ omega_baryon_now = data.pf['omega_baryon_now']
+ else:
+ omega_baryon_now = 0.0441
+ return data['Density'] / (omega_baryon_now * rho_crit_now *
+ (data.pf['CosmologyHubbleConstantNow']**2) *
+ ((1+data.pf['CosmologyCurrentRedshift'])**3))
+
+
+**Convert Function Source**
+
+No source available.
+
+CellMass
+++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _CellMass(field, data):
+ return data["Density"] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+CellMassCode
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _CellMassCode(field, data):
+ return data["Density"] * data["CellVolumeCode"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertCellMassCode(data):
+ return 1.0/data.convert("Density")
+
+
+CellMassMsun
+++++++++++++
+
+ * Units: :math:`M_{\odot}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _CellMass(field, data):
+ return data["Density"] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertCellMassMsun(data):
+ return 5.027854e-34 # g^-1
+
+
+CellVolume
+++++++++++
+
+ * Units: :math:`\rm{cm}^3`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _CellVolume(field, data):
+ if data['dx'].size == 1:
+ try:
+ return data['dx']*data['dy']*data['dx']*\
+ na.ones(data.ActiveDimensions, dtype='float64')
+ except AttributeError:
+ return data['dx']*data['dy']*data['dx']
+ return data["dx"]*data["dy"]*data["dz"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertCellVolumeCGS(data):
+ return data.convert("cm")**3.0
+
+
+CellVolumeCode
+++++++++++++++
+
+ * Units: :math:`\rm{BoxVolume}^3`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _CellVolume(field, data):
+ if data['dx'].size == 1:
+ try:
+ return data['dx']*data['dy']*data['dx']*\
+ na.ones(data.ActiveDimensions, dtype='float64')
+ except AttributeError:
+ return data['dx']*data['dy']*data['dx']
+ return data["dx"]*data["dy"]*data["dz"]
+
+
+**Convert Function Source**
+
+No source available.
+
+CellVolumeMpc
++++++++++++++
+
+ * Units: :math:`\rm{Mpc}^3`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _CellVolume(field, data):
+ if data['dx'].size == 1:
+ try:
+ return data['dx']*data['dy']*data['dx']*\
+ na.ones(data.ActiveDimensions, dtype='float64')
+ except AttributeError:
+ return data['dx']*data['dy']*data['dx']
+ return data["dx"]*data["dy"]*data["dz"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertCellVolumeMpc(data):
+ return data.convert("mpc")**3.0
+
+
+CellsPerBin
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Ones(field, data):
+ return na.ones(data.ActiveDimensions, dtype='float64')
+
+
+**Convert Function Source**
+
+No source available.
+
+ComovingDensity
++++++++++++++++
+
+ * Units: :math:`\rm{g}/\rm{cm}^3`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ComovingDensity(field, data):
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data["Density"]/ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Contours
+++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Contours(field, data):
+ return na.ones(data["Density"].shape)*-1
+
+
+**Convert Function Source**
+
+No source available.
+
+CourantTimeStep
++++++++++++++++
+
+ * Units: :math:`$\rm{s}$`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _CourantTimeStep(field, data):
+ t1 = data['dx'] / (
+ data["SoundSpeed"] + \
+ abs(data["x-velocity"]))
+ t2 = data['dy'] / (
+ data["SoundSpeed"] + \
+ abs(data["y-velocity"]))
+ t3 = data['dz'] / (
+ data["SoundSpeed"] + \
+ abs(data["z-velocity"]))
+ return na.minimum(na.minimum(t1,t2),t3)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertCourantTimeStep(data):
+ # SoundSpeed and z-velocity are in cm/s, dx is in code
+ return data.convert("cm")
+
+
+CuttingPlaneVelocityX
++++++++++++++++++++++
+
+ * Units: :math:`\rm{km}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _CuttingPlaneVelocityX(field, data):
+ x_vec, y_vec, z_vec = [data.get_field_parameter("cp_%s_vec" % (ax))
+ for ax in 'xyz']
+ bulk_velocity = data.get_field_parameter("bulk_velocity")
+ if bulk_velocity == None:
+ bulk_velocity = na.zeros(3)
+ v_vec = na.array([data["%s-velocity" % ax] for ax in 'xyz']) \
+ - bulk_velocity[...,na.newaxis]
+ return na.dot(x_vec, v_vec)
+
+
+**Convert Function Source**
+
+No source available.
+
+CuttingPlaneVelocityY
++++++++++++++++++++++
+
+ * Units: :math:`\rm{km}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _CuttingPlaneVelocityY(field, data):
+ x_vec, y_vec, z_vec = [data.get_field_parameter("cp_%s_vec" % (ax))
+ for ax in 'xyz']
+ bulk_velocity = data.get_field_parameter("bulk_velocity")
+ if bulk_velocity == None:
+ bulk_velocity = na.zeros(3)
+ v_vec = na.array([data["%s-velocity" % ax] for ax in 'xyz']) \
+ - bulk_velocity[...,na.newaxis]
+ return na.dot(y_vec, v_vec)
+
+
+**Convert Function Source**
+
+No source available.
+
+DensityPerturbation
++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _DensityPerturbation(field, data):
+ rho_bar = rho_crit_now * data.pf.omega_matter * \
+ data.pf.hubble_constant**2 * \
+ (1.0 + data.pf.current_redshift)**3
+ return ((data['Matter_Density'] - rho_bar) / rho_bar)
+
+
+**Convert Function Source**
+
+No source available.
+
+DiskAngle
++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _DiskAngle(field, data):
+ # We make both r_vec and h_vec into unit vectors
+ center = data.get_field_parameter("center")
+ r_vec = na.array([data["x"] - center[0],
+ data["y"] - center[1],
+ data["z"] - center[2]])
+ r_vec = r_vec/na.sqrt((r_vec**2.0).sum(axis=0))
+ h_vec = na.array(data.get_field_parameter("height_vector"))
+ dp = r_vec[0,:] * h_vec[0] \
+ + r_vec[1,:] * h_vec[1] \
+ + r_vec[2,:] * h_vec[2]
+ return na.arccos(dp)
+
+
+**Convert Function Source**
+
+No source available.
+
+DivV
+++++
+
+ * Units: :math:`\rm{s}^{-1}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _DivV(field, data):
+ # We need to set up stencils
+ if data.pf["HydroMethod"] == 2:
+ sl_left = slice(None,-2,None)
+ sl_right = slice(1,-1,None)
+ div_fac = 1.0
+ else:
+ sl_left = slice(None,-2,None)
+ sl_right = slice(2,None,None)
+ div_fac = 2.0
+ ds = div_fac * data['dx'].flat[0]
+ f = data["x-velocity"][sl_right,1:-1,1:-1]/ds
+ f -= data["x-velocity"][sl_left ,1:-1,1:-1]/ds
+ if data.pf.dimensionality > 1:
+ ds = div_fac * data['dy'].flat[0]
+ f += data["y-velocity"][1:-1,sl_right,1:-1]/ds
+ f -= data["y-velocity"][1:-1,sl_left ,1:-1]/ds
+ if data.pf.dimensionality > 2:
+ ds = div_fac * data['dz'].flat[0]
+ f += data["z-velocity"][1:-1,1:-1,sl_right]/ds
+ f -= data["z-velocity"][1:-1,1:-1,sl_left ]/ds
+ new_field = na.zeros(data["x-velocity"].shape, dtype='float64')
+ new_field[1:-1,1:-1,1:-1] = f
+ return new_field
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertDivV(data):
+ return data.convert("cm")**-1.0
+
+
+DynamicalTime
++++++++++++++
+
+ * Units: :math:`\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _DynamicalTime(field, data):
+ """
+ The formulation for the dynamical time is:
+ M{sqrt(3pi/(16*G*rho))} or M{sqrt(3pi/(16G))*rho^-(1/2)}
+ Note that we return in our natural units already
+ """
+ return (3.0*na.pi/(16*G*data["Density"]))**(1./2.)
+
+
+**Convert Function Source**
+
+No source available.
+
+Entropy
++++++++
+
+ * Units: :math:`\rm{ergs}\ \rm{cm}^{2}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Entropy(field, data):
+ return kboltz * data["Temperature"] / \
+ (data["NumberDensity"]**(data.pf["Gamma"] - 1.0))
+
+
+**Convert Function Source**
+
+No source available.
+
+GridIndices
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _GridIndices(field, data):
+ return na.ones(data["Ones"].shape)*(data.id-data._id_offset)
+
+
+**Convert Function Source**
+
+No source available.
+
+GridLevel
++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _GridLevel(field, data):
+ return na.ones(data.ActiveDimensions)*(data.Level)
+
+
+**Convert Function Source**
+
+No source available.
+
+Height
+++++++
+
+ * Units: :math:`cm`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Height(field, data):
+ # We take the dot product of the radius vector with the height-vector
+ center = data.get_field_parameter("center")
+ r_vec = na.array([data["x"] - center[0],
+ data["y"] - center[1],
+ data["z"] - center[2]])
+ h_vec = na.array(data.get_field_parameter("height_vector"))
+ h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
+ h_vec[1]**2.0+
+ h_vec[2]**2.0)
+ height = r_vec[0,:] * h_vec[0] \
+ + r_vec[1,:] * h_vec[1] \
+ + r_vec[2,:] * h_vec[2]
+ return na.abs(height)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertHeight(data):
+ return data.convert("cm")
+
+
+HeightAU
+++++++++
+
+ * Units: :math:`AU`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Height(field, data):
+ # We take the dot product of the radius vector with the height-vector
+ center = data.get_field_parameter("center")
+ r_vec = na.array([data["x"] - center[0],
+ data["y"] - center[1],
+ data["z"] - center[2]])
+ h_vec = na.array(data.get_field_parameter("height_vector"))
+ h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
+ h_vec[1]**2.0+
+ h_vec[2]**2.0)
+ height = r_vec[0,:] * h_vec[0] \
+ + r_vec[1,:] * h_vec[1] \
+ + r_vec[2,:] * h_vec[2]
+ return na.abs(height)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertHeightAU(data):
+ return data.convert("au")
+
+
+JeansMassMsun
++++++++++++++
+
+ * Units: :math:`\rm{M_{\odot}}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _JeansMassMsun(field,data):
+ MJ_constant = (((5*kboltz)/(G*mh))**(1.5)) * \
+ (3/(4*3.1415926535897931))**(0.5) / 1.989e33
+
+ return (MJ_constant *
+ ((data["Temperature"]/data["MeanMolecularWeight"])**(1.5)) *
+ (data["Density"]**(-0.5)))
+
+
+**Convert Function Source**
+
+No source available.
+
+MachNumber
+++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _MachNumber(field, data):
+ """M{|v|/t_sound}"""
+ return data["VelocityMagnitude"] / data["SoundSpeed"]
+
+
+**Convert Function Source**
+
+No source available.
+
+MagneticEnergy
+++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _MagneticEnergy(field,data):
+ """This assumes that your front end has provided Bx, By, Bz in
+ units of Gauss. If you use MKS, make sure to write your own
+ MagneticEnergy field to deal with non-unitary \mu_0.
+ """
+ return (data["Bx"]**2 + data["By"]**2 + data["Bz"]**2)/2.
+
+
+**Convert Function Source**
+
+No source available.
+
+Matter_Density
+++++++++++++++
+
+ * Units: :math:`\rm{g}/\rm{cm^3}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Matter_Density(field,data):
+ return (data['Density'] + data['Dark_Matter_Density'])
+
+
+**Convert Function Source**
+
+No source available.
+
+MeanMolecularWeight
++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _MeanMolecularWeight(field,data):
+ return (data["Density"] / (mh *data["NumberDensity"]))
+
+
+**Convert Function Source**
+
+No source available.
+
+Ones
+++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Ones(field, data):
+ return na.ones(data.ActiveDimensions, dtype='float64')
+
+
+**Convert Function Source**
+
+No source available.
+
+OnesOverDx
+++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _OnesOverDx(field, data):
+ return na.ones(data["Ones"].shape,
+ dtype=data["Density"].dtype)/data['dx']
+
+
+**Convert Function Source**
+
+No source available.
+
+Overdensity
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Matter_Density(field,data):
+ return (data['Density'] + data['Dark_Matter_Density'])
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _Convert_Overdensity(data):
+ return 1 / (rho_crit_now * data.pf.hubble_constant**2 *
+ (1+data.pf.current_redshift)**3)
+
+
+ParticleAngularMomentum
++++++++++++++++++++++++
+
+ * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleAngularMomentum(field, data):
+ return data["ParticleMass"] * data["ParticleSpecificAngularMomentum"]
+
+
+**Convert Function Source**
+
+No source available.
+
+ParticleAngularMomentumMSUNKMSMPC
++++++++++++++++++++++++++++++++++
+
+ * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleAngularMomentumMSUNKMSMPC(field, data):
+ return data["ParticleMass"] * data["ParticleSpecificAngularMomentumKMSMPC"]
+
+
+**Convert Function Source**
+
+No source available.
+
+ParticleAngularMomentumX
+++++++++++++++++++++++++
+
+ * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleAngularMomentumX(field, data):
+ return data["CellMass"] * data["ParticleSpecificAngularMomentumX"]
+
+
+**Convert Function Source**
+
+No source available.
+
+ParticleAngularMomentumY
+++++++++++++++++++++++++
+
+ * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleAngularMomentumY(field, data):
+ return data["CellMass"] * data["ParticleSpecificAngularMomentumY"]
+
+
+**Convert Function Source**
+
+No source available.
+
+ParticleAngularMomentumZ
+++++++++++++++++++++++++
+
+ * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleAngularMomentumZ(field, data):
+ return data["CellMass"] * data["ParticleSpecificAngularMomentumZ"]
+
+
+**Convert Function Source**
+
+No source available.
+
+ParticleRadius
+++++++++++++++
+
+ * Units: :math:`\rm{cm}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiusCGS(data):
+ return data.convert("cm")
+
+
+ParticleRadiusAU
+++++++++++++++++
+
+ * Units: :math:`\rm{AU}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiusAU(data):
+ return data.convert("au")
+
+
+ParticleRadiusCode
+++++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+No source available.
+
+ParticleRadiusMpc
++++++++++++++++++
+
+ * Units: :math:`\rm{Mpc}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiusMpc(data):
+ return data.convert("mpc")
+
+
+ParticleRadiuskpc
++++++++++++++++++
+
+ * Units: :math:`\rm{kpc}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiuskpc(data):
+ return data.convert("kpc")
+
+
+ParticleRadiuskpch
+++++++++++++++++++
+
+ * Units: :math:`\rm{kpc}/\rm{h}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiuskpch(data):
+ return data.convert("kpch")
+
+
+ParticleRadiuspc
+++++++++++++++++
+
+ * Units: :math:`\rm{pc}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleRadius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data["particle_position_%s" % ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiuspc(data):
+ return data.convert("pc")
+
+
+ParticleSpecificAngularMomentum
++++++++++++++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}^2/\rm{s}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleSpecificAngularMomentum(field, data):
+ """
+ Calculate the angular of a particle velocity. Returns a vector for each
+ particle.
+ """
+ if data.has_field_parameter("bulk_velocity"):
+ bv = data.get_field_parameter("bulk_velocity")
+ else: bv = na.zeros(3, dtype='float64')
+ xv = data["particle_velocity_x"] - bv[0]
+ yv = data["particle_velocity_y"] - bv[1]
+ zv = data["particle_velocity_z"] - bv[2]
+ center = data.get_field_parameter('center')
+ coords = na.array([data['particle_position_x'],
+ data['particle_position_y'],
+ data['particle_position_z']], dtype='float64')
+ new_shape = tuple([3] + [1]*(len(coords.shape)-1))
+ r_vec = coords - na.reshape(center,new_shape)
+ v_vec = na.array([xv,yv,zv], dtype='float64')
+ return na.cross(r_vec, v_vec, axis=0)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSpecificAngularMomentum(data):
+ return data.convert("cm")
+
+
+ParticleSpecificAngularMomentumKMSMPC
++++++++++++++++++++++++++++++++++++++
+
+ * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleSpecificAngularMomentum(field, data):
+ """
+ Calculate the angular of a particle velocity. Returns a vector for each
+ particle.
+ """
+ if data.has_field_parameter("bulk_velocity"):
+ bv = data.get_field_parameter("bulk_velocity")
+ else: bv = na.zeros(3, dtype='float64')
+ xv = data["particle_velocity_x"] - bv[0]
+ yv = data["particle_velocity_y"] - bv[1]
+ zv = data["particle_velocity_z"] - bv[2]
+ center = data.get_field_parameter('center')
+ coords = na.array([data['particle_position_x'],
+ data['particle_position_y'],
+ data['particle_position_z']], dtype='float64')
+ new_shape = tuple([3] + [1]*(len(coords.shape)-1))
+ r_vec = coords - na.reshape(center,new_shape)
+ v_vec = na.array([xv,yv,zv], dtype='float64')
+ return na.cross(r_vec, v_vec, axis=0)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSpecificAngularMomentumKMSMPC(data):
+ return data.convert("mpc")/1e5
+
+
+ParticleSpecificAngularMomentumX
+++++++++++++++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}^2/\rm{s}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleSpecificAngularMomentumX(field, data):
+ if data.has_field_parameter("bulk_velocity"):
+ bv = data.get_field_parameter("bulk_velocity")
+ else: bv = na.zeros(3, dtype='float64')
+ center = data.get_field_parameter('center')
+ y = data["particle_position_y"] - center[1]
+ z = data["particle_position_z"] - center[2]
+ yv = data["particle_velocity_y"] - bv[1]
+ zv = data["particle_velocity_z"] - bv[2]
+ return yv*z - zv*y
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSpecificAngularMomentum(data):
+ return data.convert("cm")
+
+
+ParticleSpecificAngularMomentumY
+++++++++++++++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}^2/\rm{s}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleSpecificAngularMomentumY(field, data):
+ if data.has_field_parameter("bulk_velocity"):
+ bv = data.get_field_parameter("bulk_velocity")
+ else: bv = na.zeros(3, dtype='float64')
+ center = data.get_field_parameter('center')
+ x = data["particle_position_x"] - center[0]
+ z = data["particle_position_z"] - center[2]
+ xv = data["particle_velocity_x"] - bv[0]
+ zv = data["particle_velocity_z"] - bv[2]
+ return -(xv*z - zv*x)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSpecificAngularMomentum(data):
+ return data.convert("cm")
+
+
+ParticleSpecificAngularMomentumZ
+++++++++++++++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}^2/\rm{s}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleSpecificAngularMomentumZ(field, data):
+ if data.has_field_parameter("bulk_velocity"):
+ bv = data.get_field_parameter("bulk_velocity")
+ else: bv = na.zeros(3, dtype='float64')
+ center = data.get_field_parameter('center')
+ x = data["particle_position_x"] - center[0]
+ y = data["particle_position_y"] - center[1]
+ xv = data["particle_velocity_x"] - bv[0]
+ yv = data["particle_velocity_y"] - bv[1]
+ return xv*y - yv*x
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSpecificAngularMomentum(data):
+ return data.convert("cm")
+
+
+ParticleVelocityMagnitude
++++++++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleVelocityMagnitude(field, data):
+ """M{|v|}"""
+ bulk_velocity = data.get_field_parameter("bulk_velocity")
+ if bulk_velocity == None:
+ bulk_velocity = na.zeros(3)
+ return ( (data["particle_velocity_x"]-bulk_velocity[0])**2.0 + \
+ (data["particle_velocity_y"]-bulk_velocity[1])**2.0 + \
+ (data["particle_velocity_z"]-bulk_velocity[2])**2.0 )**(1.0/2.0)
+
+
+**Convert Function Source**
+
+No source available.
+
+Pressure
+++++++++
+
+ * Units: :math:`\rm{dyne}/\rm{cm}^{2}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Pressure(field, data):
+ """M{(Gamma-1.0)*rho*E}"""
+ return (data.pf["Gamma"] - 1.0) * \
+ data["Density"] * data["ThermalEnergy"]
+
+
+**Convert Function Source**
+
+No source available.
+
+RadialMachNumber
+++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _RadialMachNumber(field, data):
+ """M{|v|/t_sound}"""
+ return na.abs(data["RadialVelocity"]) / data["SoundSpeed"]
+
+
+**Convert Function Source**
+
+No source available.
+
+RadialVelocity
+++++++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _RadialVelocity(field, data):
+ center = data.get_field_parameter("center")
+ bulk_velocity = data.get_field_parameter("bulk_velocity")
+ if bulk_velocity == None:
+ bulk_velocity = na.zeros(3)
+ new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
+ + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
+ + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
+ )/data["RadiusCode"]
+ if na.any(na.isnan(new_field)): # to fix center = point
+ new_field[na.isnan(new_field)] = 0.0
+ return new_field
+
+
+**Convert Function Source**
+
+No source available.
+
+RadialVelocityABS
++++++++++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _RadialVelocityABS(field, data):
+ return na.abs(_RadialVelocity(field, data))
+
+
+**Convert Function Source**
+
+No source available.
+
+RadialVelocityKMS
++++++++++++++++++
+
+ * Units: :math:`\rm{km}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _RadialVelocity(field, data):
+ center = data.get_field_parameter("center")
+ bulk_velocity = data.get_field_parameter("bulk_velocity")
+ if bulk_velocity == None:
+ bulk_velocity = na.zeros(3)
+ new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
+ + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
+ + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
+ )/data["RadiusCode"]
+ if na.any(na.isnan(new_field)): # to fix center = point
+ new_field[na.isnan(new_field)] = 0.0
+ return new_field
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadialVelocityKMS(data):
+ return 1e-5
+
+
+RadialVelocityKMSABS
+++++++++++++++++++++
+
+ * Units: :math:`\rm{km}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _RadialVelocityABS(field, data):
+ return na.abs(_RadialVelocity(field, data))
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadialVelocityKMS(data):
+ return 1e-5
+
+
+Radius
+++++++
+
+ * Units: :math:`\rm{cm}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Radius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data[ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiusCGS(data):
+ return data.convert("cm")
+
+
+RadiusAU
+++++++++
+
+ * Units: :math:`\rm{AU}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Radius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data[ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiusAU(data):
+ return data.convert("au")
+
+
+RadiusCode
+++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Radius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data[ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+No source available.
+
+RadiusMpc
++++++++++
+
+ * Units: :math:`\rm{Mpc}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Radius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data[ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiusMpc(data):
+ return data.convert("mpc")
+
+
+Radiuskpc
++++++++++
+
+ * Units: :math:`\rm{kpc}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Radius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data[ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiuskpc(data):
+ return data.convert("kpc")
+
+
+Radiuspc
+++++++++
+
+ * Units: :math:`\rm{pc}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Radius(field, data):
+ center = data.get_field_parameter("center")
+ DW = data.pf.domain_right_edge - data.pf.domain_left_edge
+ radius = na.zeros(data["x"].shape, dtype='float64')
+ for i, ax in enumerate('xyz'):
+ r = na.abs(data[ax] - center[i])
+ radius += na.minimum(r, na.abs(DW[i]-r))**2.0
+ na.sqrt(radius, radius)
+ return radius
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertRadiuspc(data):
+ return data.convert("pc")
+
+
+SZKinetic
++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SZKinetic(field, data):
+ vel_axis = data.get_field_parameter('axis')
+ if vel_axis > 2:
+ raise NeedsParameter(['axis'])
+ vel = data["%s-velocity" % ({0:'x',1:'y',2:'z'}[vel_axis])]
+ return (vel*data["Density"])
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSZKinetic(data):
+ return 0.88*((sigma_thompson/mh)/clight)
+
+
+SZY
++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SZY(field, data):
+ return (data["Density"]*data["Temperature"])
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSZY(data):
+ conv = (0.88/mh) * (kboltz)/(me * clight*clight) * sigma_thompson
+ return conv
+
+
+SoundSpeed
+++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SoundSpeed(field, data):
+ if data.pf["EOSType"] == 1:
+ return na.ones(data["Density"].shape, dtype='float64') * \
+ data.pf["EOSSoundSpeed"]
+ return ( data.pf["Gamma"]*data["Pressure"] / \
+ data["Density"] )**(1.0/2.0)
+
+
+**Convert Function Source**
+
+No source available.
+
+SpecificAngularMomentum
++++++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}^2/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpecificAngularMomentum(field, data):
+ """
+ Calculate the angular velocity. Returns a vector for each cell.
+ """
+ r_vec = obtain_rvec(data)
+ xv, yv, zv = obtain_velocities(data)
+ v_vec = na.array([xv,yv,zv], dtype='float64')
+ return na.cross(r_vec, v_vec, axis=0)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSpecificAngularMomentum(data):
+ return data.convert("cm")
+
+
+SpecificAngularMomentumKMSMPC
++++++++++++++++++++++++++++++
+
+ * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpecificAngularMomentum(field, data):
+ """
+ Calculate the angular velocity. Returns a vector for each cell.
+ """
+ r_vec = obtain_rvec(data)
+ xv, yv, zv = obtain_velocities(data)
+ v_vec = na.array([xv,yv,zv], dtype='float64')
+ return na.cross(r_vec, v_vec, axis=0)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSpecificAngularMomentumKMSMPC(data):
+ return data.convert("mpc")/1e5
+
+
+SpecificAngularMomentumX
+++++++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}^2/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpecificAngularMomentumX(field, data):
+ xv, yv, zv = obtain_velocities(data)
+ rv = obtain_rvec(data)
+ return yv*rv[2,:] - zv*rv[1,:]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSpecificAngularMomentum(data):
+ return data.convert("cm")
+
+
+SpecificAngularMomentumY
+++++++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}^2/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpecificAngularMomentumY(field, data):
+ xv, yv, zv = obtain_velocities(data)
+ rv = obtain_rvec(data)
+ return -(xv*rv[2,:] - zv*rv[0,:])
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSpecificAngularMomentum(data):
+ return data.convert("cm")
+
+
+SpecificAngularMomentumZ
+++++++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}^2/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpecificAngularMomentumZ(field, data):
+ xv, yv, zv = obtain_velocities(data)
+ rv = obtain_rvec(data)
+ return xv*rv[1,:] - yv*rv[0,:]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertSpecificAngularMomentum(data):
+ return data.convert("cm")
+
+
+StarMassMsun
+++++++++++++
+
+ * Units: :math:`M_{\odot}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _StarMass(field,data):
+ return data["star_density"] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertCellMassMsun(data):
+ return 5.027854e-34 # g^-1
+
+
+TangentialOverVelocityMagnitude
++++++++++++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TangentialOverVelocityMagnitude(field, data):
+ return na.abs(data["TangentialVelocity"])/na.abs(data["VelocityMagnitude"])
+
+
+**Convert Function Source**
+
+No source available.
+
+TangentialVelocity
+++++++++++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TangentialVelocity(field, data):
+ return na.sqrt(data["VelocityMagnitude"]**2.0
+ - data["RadialVelocity"]**2.0)
+
+
+**Convert Function Source**
+
+No source available.
+
+TotalMass
++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TotalMass(field,data):
+ return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+TotalMassMsun
++++++++++++++
+
+ * Units: :math:`M_{\odot}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TotalMass(field,data):
+ return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertCellMassMsun(data):
+ return 5.027854e-34 # g^-1
+
+
+VelocityMagnitude
++++++++++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _VelocityMagnitude(field, data):
+ """M{|v|}"""
+ bulk_velocity = data.get_field_parameter("bulk_velocity")
+ if bulk_velocity == None:
+ bulk_velocity = na.zeros(3)
+ return ( (data["x-velocity"]-bulk_velocity[0])**2.0 + \
+ (data["y-velocity"]-bulk_velocity[1])**2.0 + \
+ (data["z-velocity"]-bulk_velocity[2])**2.0 )**(1.0/2.0)
+
+
+**Convert Function Source**
+
+No source available.
+
+VorticitySquared
+++++++++++++++++
+
+ * Units: :math:`\rm{s}^{-2}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _VorticitySquared(field, data):
+ mylog.debug("Generating vorticity on %s", data)
+ # We need to set up stencils
+ if data.pf["HydroMethod"] == 2:
+ sl_left = slice(None,-2,None)
+ sl_right = slice(1,-1,None)
+ div_fac = 1.0
+ else:
+ sl_left = slice(None,-2,None)
+ sl_right = slice(2,None,None)
+ div_fac = 2.0
+ new_field = na.zeros(data["x-velocity"].shape)
+ dvzdy = (data["z-velocity"][1:-1,sl_right,1:-1] -
+ data["z-velocity"][1:-1,sl_left,1:-1]) \
+ / (div_fac*data["dy"].flat[0])
+ dvydz = (data["y-velocity"][1:-1,1:-1,sl_right] -
+ data["y-velocity"][1:-1,1:-1,sl_left]) \
+ / (div_fac*data["dz"].flat[0])
+ new_field[1:-1,1:-1,1:-1] += (dvzdy - dvydz)**2.0
+ del dvzdy, dvydz
+ dvxdz = (data["x-velocity"][1:-1,1:-1,sl_right] -
+ data["x-velocity"][1:-1,1:-1,sl_left]) \
+ / (div_fac*data["dz"].flat[0])
+ dvzdx = (data["z-velocity"][sl_right,1:-1,1:-1] -
+ data["z-velocity"][sl_left,1:-1,1:-1]) \
+ / (div_fac*data["dx"].flat[0])
+ new_field[1:-1,1:-1,1:-1] += (dvxdz - dvzdx)**2.0
+ del dvxdz, dvzdx
+ dvydx = (data["y-velocity"][sl_right,1:-1,1:-1] -
+ data["y-velocity"][sl_left,1:-1,1:-1]) \
+ / (div_fac*data["dx"].flat[0])
+ dvxdy = (data["x-velocity"][1:-1,sl_right,1:-1] -
+ data["x-velocity"][1:-1,sl_left,1:-1]) \
+ / (div_fac*data["dy"].flat[0])
+ new_field[1:-1,1:-1,1:-1] += (dvydx - dvxdy)**2.0
+ del dvydx, dvxdy
+ new_field = na.abs(new_field)
+ return new_field
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertVorticitySquared(data):
+ return data.convert("cm")**-2.0
+
+
+WeakLensingConvergence
+++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _DensityPerturbation(field, data):
+ rho_bar = rho_crit_now * data.pf.omega_matter * \
+ data.pf.hubble_constant**2 * \
+ (1.0 + data.pf.current_redshift)**3
+ return ((data['Matter_Density'] - rho_bar) / rho_bar)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertConvergence(data):
+ if not data.pf.parameters.has_key('cosmology_calculator'):
+ data.pf.parameters['cosmology_calculator'] = Cosmology(
+ HubbleConstantNow=(100.*data.pf.hubble_constant),
+ OmegaMatterNow=data.pf.omega_matter, OmegaLambdaNow=data.pf.omega_lambda)
+ # observer to lens
+ DL = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
+ data.pf.parameters['observer_redshift'], data.pf.current_redshift)
+ # observer to source
+ DS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
+ data.pf.parameters['observer_redshift'], data.pf.parameters['lensing_source_redshift'])
+ # lens to source
+ DLS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
+ data.pf.current_redshift, data.pf.parameters['lensing_source_redshift'])
+ return (((DL * DLS) / DS) * (1.5e14 * data.pf.omega_matter *
+ (data.pf.hubble_constant / speed_of_light_cgs)**2 *
+ (1 + data.pf.current_redshift)))
+
+
+XRayEmissivity
+++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _XRayEmissivity(field, data):
+ return ((data["Density"].astype('float64')**2.0) \
+ *data["Temperature"]**0.5)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertXRayEmissivity(data):
+ return 2.168e60
+
+
+dx
+++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dx(field, data):
+ return data.dds[0]
+ return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[0]
+
+
+**Convert Function Source**
+
+No source available.
+
+dy
+++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dy(field, data):
+ return data.dds[1]
+ return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[1]
+
+
+**Convert Function Source**
+
+No source available.
+
+dz
+++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dz(field, data):
+ return data.dds[2]
+ return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[2]
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_density
+++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _pdensity(field, data):
+ blank = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return blank
+ CICDeposit_3(data["particle_position_x"].astype(na.float64),
+ data["particle_position_y"].astype(na.float64),
+ data["particle_position_z"].astype(na.float64),
+ data["particle_mass"].astype(na.float32),
+ na.int64(data.NumberOfParticles),
+ blank, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ return blank
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertDensity(data):
+ return data.convert("Density")
+
+
+tempContours
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Contours(field, data):
+ return na.ones(data["Density"].shape)*-1
+
+
+**Convert Function Source**
+
+No source available.
+
+x
++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _coordX(field, data):
+ dim = data.ActiveDimensions[0]
+ return (na.ones(data.ActiveDimensions, dtype='float64')
+ * na.arange(data.ActiveDimensions[0])[:,None,None]
+ +0.5) * data['dx'] + data.LeftEdge[0]
+
+
+**Convert Function Source**
+
+No source available.
+
+y
++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _coordY(field, data):
+ dim = data.ActiveDimensions[1]
+ return (na.ones(data.ActiveDimensions, dtype='float64')
+ * na.arange(data.ActiveDimensions[1])[None,:,None]
+ +0.5) * data['dy'] + data.LeftEdge[1]
+
+
+**Convert Function Source**
+
+No source available.
+
+z
++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _coordZ(field, data):
+ dim = data.ActiveDimensions[2]
+ return (na.ones(data.ActiveDimensions, dtype='float64')
+ * na.arange(data.ActiveDimensions[2])[None,None,:]
+ +0.5) * data['dz'] + data.LeftEdge[2]
+
+
+**Convert Function Source**
+
+No source available.
+
+Enzo-Specific Field List
+------------------------
+
+Bmag
+++++
+
+ * Units: :math:`\mathrm{Gauss}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Bmag(field, data):
+ """ magnitude of bvec
+ """
+ return na.sqrt(data['Bx']**2 + data['By']**2 + data['Bz']**2)
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_DII_Density
+++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_DI_Density
++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_Electron_Density
++++++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_H2II_Density
++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_H2I_Density
+++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HDI_Density
+++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HII_Density
+++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HI_Density
++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HM_Density
++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HeIII_Density
+++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HeII_Density
++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_HeI_Density
+++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_Metal_Density
+++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+Comoving_PreShock_Density
++++++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesComovingDensity(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ ef = (1.0 + data.pf.current_redshift)**3.0
+ return data[sp] / ef
+
+
+**Convert Function Source**
+
+No source available.
+
+DII_Fraction
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+DII_Mass
+++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+DII_MassMsun
+++++++++++++
+
+ * Units: :math:`M_{\odot}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertCellMassMsun(data):
+ return 5.027854e-34 # g^-1
+
+
+DII_NumberDensity
++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesNumberDensity(field, data):
+ species = field.name.split("_")[0]
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / _speciesMass[species]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertNumberDensity(data):
+ return 1.0/mh
+
+
+DI_Fraction
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+DI_Mass
++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+Dark_Matter_Mass
+++++++++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Dark_Matter_Mass(field, data):
+ return data['Dark_Matter_Density'] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+Dark_Matter_MassMsun
+++++++++++++++++++++
+
+ * Units: :math:`M_{\odot}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Dark_Matter_Mass(field, data):
+ return data['Dark_Matter_Density'] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertCellMassMsun(data):
+ return 5.027854e-34 # g^-1
+
+
+Electron_Fraction
++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+Electron_Mass
++++++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+Gas_Energy
+++++++++++
+
+ * Units: :math:`\rm{ergs}/\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Gas_Energy(field, data):
+ return data["GasEnergy"] / _convertEnergy(data)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertEnergy(data):
+ return data.convert("x-velocity")**2.0
+
+
+H2II_Fraction
++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+H2II_Mass
++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+H2I_Fraction
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+H2I_Mass
+++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HDI_Fraction
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HDI_Mass
+++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HII_Fraction
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HII_Mass
+++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HI_Fraction
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HI_Mass
++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HM_Fraction
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HM_Mass
++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HeIII_Fraction
+++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HeIII_Mass
+++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HeII_Fraction
++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HeII_Mass
++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HeI_Fraction
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+HeI_Mass
+++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+IsStarParticle
+++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _IsStarParticle(field, data):
+ is_star = (data['creation_time'] > 0).astype('float64')
+ return is_star
+
+
+**Convert Function Source**
+
+No source available.
+
+KineticEnergy
++++++++++++++
+
+ * Units: :math:`\rm{ergs}/\rm{cm^3}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _KineticEnergy(field, data):
+ return 0.5*data["Density"] * ( data["x-velocity"]**2.0
+ + data["y-velocity"]**2.0
+ + data["z-velocity"]**2.0 )
+
+
+**Convert Function Source**
+
+No source available.
+
+Metal_Fraction
+++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+Metal_Mass
+++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+Metallicity
++++++++++++
+
+ * Units: :math:`Z_{\rm{\odot}}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Metallicity(field, data):
+ return data["Metal_Fraction"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertMetallicity(data):
+ return 49.0196 # 1 / 0.0204
+
+
+Metallicity3
+++++++++++++
+
+ * Units: :math:`Z_{\rm{\odot}}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Metallicity3(field, data):
+ return data["SN_Colour"]/data["Density"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertMetallicity(data):
+ return 49.0196 # 1 / 0.0204
+
+
+NumberDensity
++++++++++++++
+
+ * Units: :math:`\rm{cm}^{-3}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _NumberDensity(field, data):
+ # We can assume that we at least have Density
+ # We should actually be guaranteeing the presence of a .shape attribute,
+ # but I am not currently implementing that
+ fieldData = na.zeros(data["Density"].shape,
+ dtype = data["Density"].dtype)
+ if data.pf["MultiSpecies"] == 0:
+ if data.has_field_parameter("mu"):
+ mu = data.get_field_parameter("mu")
+ else:
+ mu = 0.6
+ fieldData += data["Density"] / mu
+ if data.pf["MultiSpecies"] > 0:
+ fieldData += data["HI_Density"] / 1.0
+ fieldData += data["HII_Density"] / 1.0
+ fieldData += data["HeI_Density"] / 4.0
+ fieldData += data["HeII_Density"] / 4.0
+ fieldData += data["HeIII_Density"] / 4.0
+ fieldData += data["Electron_Density"] / 1.0
+ if data.pf["MultiSpecies"] > 1:
+ fieldData += data["HM_Density"] / 1.0
+ fieldData += data["H2I_Density"] / 2.0
+ fieldData += data["H2II_Density"] / 2.0
+ if data.pf["MultiSpecies"] > 2:
+ fieldData += data["DI_Density"] / 2.0
+ fieldData += data["DII_Density"] / 2.0
+ fieldData += data["HDI_Density"] / 3.0
+ return fieldData
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertNumberDensity(data):
+ return 1.0/mh
+
+
+ParticleAge
++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleAge(field, data):
+ current_time = data.pf.current_time
+ return (current_time - data["creation_time"])
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertParticleAge(data):
+ return data.convert("years")
+
+
+ParticleMass
+++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleMass(field, data):
+ particles = data["particle_mass"].astype('float64') * \
+ just_one(data["CellVolumeCode"].ravel())
+ # Note that we mandate grid-type here, so this is okay
+ return particles
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertParticleMass(data):
+ return data.convert("Density")*(data.convert("cm")**3.0)
+
+
+ParticleMassMsun
+++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleMass(field, data):
+ particles = data["particle_mass"].astype('float64') * \
+ just_one(data["CellVolumeCode"].ravel())
+ # Note that we mandate grid-type here, so this is okay
+ return particles
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertParticleMassMsun(data):
+ return data.convert("Density")*((data.convert("cm")**3.0)/1.989e33)
+
+
+PreShock_Fraction
++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesFraction(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] / data["Density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+PreShock_Mass
++++++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _SpeciesMass(field, data):
+ sp = field.name.split("_")[0] + "_Density"
+ return data[sp] * data["CellVolume"]
+
+
+**Convert Function Source**
+
+No source available.
+
+StarAgeYears
+++++++++++++
+
+ * Units: :math:`\mathrm{yr}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _StarAge(field, data):
+ star_age = na.zeros(data['StarCreationTimeYears'].shape)
+ with_stars = data['StarCreationTimeYears'] > 0
+ star_age[with_stars] = data.pf.time_units['years'] * \
+ data.pf.current_time - \
+ data['StarCreationTimeYears'][with_stars]
+ return star_age
+
+
+**Convert Function Source**
+
+No source available.
+
+StarCreationTimeYears
++++++++++++++++++++++
+
+ * Units: :math:`\mathrm{yr}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _StarCreationTime(field, data):
+ return data['star_creation_time']
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertEnzoTimeYears(data):
+ return data.pf.time_units['years']
+
+
+StarDynamicalTimeYears
+++++++++++++++++++++++
+
+ * Units: :math:`\mathrm{yr}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _StarDynamicalTime(field, data):
+ return data['star_dynamical_time']
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertEnzoTimeYears(data):
+ return data.pf.time_units['years']
+
+
+StarMetallicity
++++++++++++++++
+
+ * Units: :math:`Z_{\rm{\odot}}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _StarMetallicity(field, data):
+ return data['star_metallicity_fraction']
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _ConvertMetallicity(data):
+ return 49.0196 # 1 / 0.0204
+
+
+ThermalEnergy
++++++++++++++
+
+ * Units: :math:`\rm{ergs}/\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ThermalEnergy(field, data):
+ if data.pf["HydroMethod"] == 2:
+ return data["TotalEnergy"]
+ else:
+ if data.pf["DualEnergyFormalism"]:
+ return data["GasEnergy"]
+ else:
+ return data["TotalEnergy"] - 0.5*(
+ data["x-velocity"]**2.0
+ + data["y-velocity"]**2.0
+ + data["z-velocity"]**2.0 )
+
+
+**Convert Function Source**
+
+No source available.
+
+Total_Energy
+++++++++++++
+
+ * Units: :math:`\rm{ergs}/\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Total_Energy(field, data):
+ return data["TotalEnergy"] / _convertEnergy(data)
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertEnergy(data):
+ return data.convert("x-velocity")**2.0
+
+
+cic_particle_velocity_x
++++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _cic_particle_field(field, data):
+ """
+ Create a grid field for particle quantities weighted by particle mass,
+ using cloud-in-cell deposit.
+ """
+ particle_field = field.name[4:]
+ top = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return top
+ particle_field_data = data[particle_field] * data['particle_mass']
+ amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
+ data["particle_position_y"].astype(na.float64),
+ data["particle_position_z"].astype(na.float64),
+ particle_field_data.astype(na.float32),
+ na.int64(data.NumberOfParticles),
+ top, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ del particle_field_data
+
+ bottom = na.zeros(data.ActiveDimensions, dtype='float32')
+ amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
+ data["particle_position_y"].astype(na.float64),
+ data["particle_position_z"].astype(na.float64),
+ data["particle_mass"].astype(na.float32),
+ na.int64(data.NumberOfParticles),
+ bottom, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ top[bottom == 0] = 0.0
+ bnz = bottom.nonzero()
+ top[bnz] /= bottom[bnz]
+ return top
+
+
+**Convert Function Source**
+
+No source available.
+
+cic_particle_velocity_y
++++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _cic_particle_field(field, data):
+ """
+ Create a grid field for particle quantities weighted by particle mass,
+ using cloud-in-cell deposit.
+ """
+ particle_field = field.name[4:]
+ top = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return top
+ particle_field_data = data[particle_field] * data['particle_mass']
+ amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
+ data["particle_position_y"].astype(na.float64),
+ data["particle_position_z"].astype(na.float64),
+ particle_field_data.astype(na.float32),
+ na.int64(data.NumberOfParticles),
+ top, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ del particle_field_data
+
+ bottom = na.zeros(data.ActiveDimensions, dtype='float32')
+ amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
+ data["particle_position_y"].astype(na.float64),
+ data["particle_position_z"].astype(na.float64),
+ data["particle_mass"].astype(na.float32),
+ na.int64(data.NumberOfParticles),
+ bottom, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ top[bottom == 0] = 0.0
+ bnz = bottom.nonzero()
+ top[bnz] /= bottom[bnz]
+ return top
+
+
+**Convert Function Source**
+
+No source available.
+
+cic_particle_velocity_z
++++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _cic_particle_field(field, data):
+ """
+ Create a grid field for particle quantities weighted by particle mass,
+ using cloud-in-cell deposit.
+ """
+ particle_field = field.name[4:]
+ top = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return top
+ particle_field_data = data[particle_field] * data['particle_mass']
+ amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
+ data["particle_position_y"].astype(na.float64),
+ data["particle_position_z"].astype(na.float64),
+ particle_field_data.astype(na.float32),
+ na.int64(data.NumberOfParticles),
+ top, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ del particle_field_data
+
+ bottom = na.zeros(data.ActiveDimensions, dtype='float32')
+ amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
+ data["particle_position_y"].astype(na.float64),
+ data["particle_position_z"].astype(na.float64),
+ data["particle_mass"].astype(na.float32),
+ na.int64(data.NumberOfParticles),
+ bottom, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ top[bottom == 0] = 0.0
+ bnz = bottom.nonzero()
+ top[bnz] /= bottom[bnz]
+ return top
+
+
+**Convert Function Source**
+
+No source available.
+
+dm_density
+++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dmpdensity(field, data):
+ blank = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return blank
+ if 'creation_time' in data.pf.field_info:
+ filter = data['creation_time'] <= 0.0
+ if not filter.any(): return blank
+ else:
+ filter = na.ones(data.NumberOfParticles, dtype='bool')
+ if not filter.any(): return blank
+ amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
+ data["particle_position_y"][filter].astype(na.float64),
+ data["particle_position_z"][filter].astype(na.float64),
+ data["particle_mass"][filter].astype(na.float32),
+ na.int64(na.where(filter)[0].size),
+ blank, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ return blank
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertDensity(data):
+ return data.convert("Density")
+
+
+particle_mass
++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ try:
+ return io._read_data_set(data, p_field).astype(dtype)
+ except io._read_exception:
+ pass
+ # This is bad. But it's the best idea I have right now.
+ return data._read_data(p_field.replace("_"," ")).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+star_creation_time
+++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _star_field(field, data):
+ """
+ Create a grid field for star quantities, weighted by star mass.
+ """
+ particle_field = field.name[5:]
+ top = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return top
+ filter = data['creation_time'] > 0.0
+ if not filter.any(): return top
+ particle_field_data = data[particle_field][filter] * data['particle_mass'][filter]
+ amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
+ data["particle_position_y"][filter].astype(na.float64),
+ data["particle_position_z"][filter].astype(na.float64),
+ particle_field_data.astype(na.float32),
+ na.int64(na.where(filter)[0].size),
+ top, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ del particle_field_data
+
+ bottom = na.zeros(data.ActiveDimensions, dtype='float32')
+ amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
+ data["particle_position_y"][filter].astype(na.float64),
+ data["particle_position_z"][filter].astype(na.float64),
+ data["particle_mass"][filter].astype(na.float32),
+ na.int64(na.where(filter)[0].size),
+ bottom, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ top[bottom == 0] = 0.0
+ bnz = bottom.nonzero()
+ top[bnz] /= bottom[bnz]
+ return top
+
+
+**Convert Function Source**
+
+No source available.
+
+star_density
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _spdensity(field, data):
+ blank = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return blank
+ filter = data['creation_time'] > 0.0
+ if not filter.any(): return blank
+ amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
+ data["particle_position_y"][filter].astype(na.float64),
+ data["particle_position_z"][filter].astype(na.float64),
+ data["particle_mass"][filter].astype(na.float32),
+ na.int64(na.where(filter)[0].size),
+ blank, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ return blank
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertDensity(data):
+ return data.convert("Density")
+
+
+star_dynamical_time
++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _star_field(field, data):
+ """
+ Create a grid field for star quantities, weighted by star mass.
+ """
+ particle_field = field.name[5:]
+ top = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return top
+ filter = data['creation_time'] > 0.0
+ if not filter.any(): return top
+ particle_field_data = data[particle_field][filter] * data['particle_mass'][filter]
+ amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
+ data["particle_position_y"][filter].astype(na.float64),
+ data["particle_position_z"][filter].astype(na.float64),
+ particle_field_data.astype(na.float32),
+ na.int64(na.where(filter)[0].size),
+ top, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ del particle_field_data
+
+ bottom = na.zeros(data.ActiveDimensions, dtype='float32')
+ amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
+ data["particle_position_y"][filter].astype(na.float64),
+ data["particle_position_z"][filter].astype(na.float64),
+ data["particle_mass"][filter].astype(na.float32),
+ na.int64(na.where(filter)[0].size),
+ bottom, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ top[bottom == 0] = 0.0
+ bnz = bottom.nonzero()
+ top[bnz] /= bottom[bnz]
+ return top
+
+
+**Convert Function Source**
+
+No source available.
+
+star_metallicity_fraction
++++++++++++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _star_field(field, data):
+ """
+ Create a grid field for star quantities, weighted by star mass.
+ """
+ particle_field = field.name[5:]
+ top = na.zeros(data.ActiveDimensions, dtype='float32')
+ if data.NumberOfParticles == 0: return top
+ filter = data['creation_time'] > 0.0
+ if not filter.any(): return top
+ particle_field_data = data[particle_field][filter] * data['particle_mass'][filter]
+ amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
+ data["particle_position_y"][filter].astype(na.float64),
+ data["particle_position_z"][filter].astype(na.float64),
+ particle_field_data.astype(na.float32),
+ na.int64(na.where(filter)[0].size),
+ top, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ del particle_field_data
+
+ bottom = na.zeros(data.ActiveDimensions, dtype='float32')
+ amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
+ data["particle_position_y"][filter].astype(na.float64),
+ data["particle_position_z"][filter].astype(na.float64),
+ data["particle_mass"][filter].astype(na.float32),
+ na.int64(na.where(filter)[0].size),
+ bottom, na.array(data.LeftEdge).astype(na.float64),
+ na.array(data.ActiveDimensions).astype(na.int32),
+ na.float64(data['dx']))
+ top[bottom == 0] = 0.0
+ bnz = bottom.nonzero()
+ top[bnz] /= bottom[bnz]
+ return top
+
+
+**Convert Function Source**
+
+No source available.
+
+Orion-Specific Field List
+-------------------------
+
+Density
++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+Pressure
+++++++++
+
+ * Units: :math:`\rm{dyne}/\rm{cm}^{2}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Pressure(field,data):
+ """M{(Gamma-1.0)*e, where e is thermal energy density
+ NB: this will need to be modified for radiation
+ """
+ return (data.pf["Gamma"] - 1.0)*data["ThermalEnergy"]
+
+
+**Convert Function Source**
+
+No source available.
+
+Temperature
++++++++++++
+
+ * Units: :math:`\rm{Kelvin}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Temperature(field,data):
+ return (data.pf["Gamma"]-1.0)*data.pf["mu"]*mh*data["ThermalEnergy"]/(kboltz*data["Density"])
+
+
+**Convert Function Source**
+
+No source available.
+
+ThermalEnergy
++++++++++++++
+
+ * Units: :math:`\rm{ergs}/\rm{cm^3}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ThermalEnergy(field, data):
+ """generate thermal (gas energy). Dual Energy Formalism was
+ implemented by Stella, but this isn't how it's called, so I'll
+ leave that commented out for now.
+ """
+ #if data.pf["DualEnergyFormalism"]:
+ # return data["GasEnergy"]
+ #else:
+ return data["TotalEnergy"] - 0.5 * data["density"] * (
+ data["x-velocity"]**2.0
+ + data["y-velocity"]**2.0
+ + data["z-velocity"]**2.0 )
+
+
+**Convert Function Source**
+
+No source available.
+
+TotalEnergy
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+density
++++++++
+
+ * Units: :math:`\rm{g}/\rm{cm}^3`
+ * Projected Units: :math:`\rm{g}/\rm{cm}^2`
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+eden
+++++
+
+ * Units: :math:`\rm{erg}/\rm{cm}^3`
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+particle_angmomen_x
++++++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_angmomen_y
++++++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_angmomen_z
++++++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_burnstate
+++++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_id
++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_mass
++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_mdeut
+++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_mdot
++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_mlast
+++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_momentum_x
++++++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_momentum_y
++++++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_momentum_z
++++++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_n
+++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_position_x
++++++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_position_y
++++++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_position_z
++++++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _Particles(field, data):
+ io = data.hierarchy.io
+ if not data.NumberOfParticles > 0:
+ return na.array([], dtype=dtype)
+ else:
+ return io._read_particles(data, p_field).astype(dtype)
+
+
+**Convert Function Source**
+
+No source available.
+
+temperature
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+x-momentum
+++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+x-velocity
+++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _xVelocity(field, data):
+ """generate x-velocity from x-momentum and density
+
+ """
+ return data["xmom"]/data["density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+xmom
+++++
+
+ * Units: :math:`\rm{g}/\rm{cm^2\ s}`
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+xvel
+++++
+
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+y-momentum
+++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+y-velocity
+++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _yVelocity(field,data):
+ """generate y-velocity from y-momentum and density
+
+ """
+ #try:
+ # return data["xvel"]
+ #except KeyError:
+ return data["ymom"]/data["density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+ymom
+++++
+
+ * Units: :math:`\rm{gm}/\rm{cm^2\ s}`
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+yvel
+++++
+
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+z-momentum
+++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+z-velocity
+++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _zVelocity(field,data):
+ """generate z-velocity from z-momentum and density
+
+ """
+ return data["zmom"]/data["density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+zmom
+++++
+
+ * Units: :math:`\rm{g}/\rm{cm^2\ s}`
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+zvel
+++++
+
+ * Particle Type: False
+
+**Field Source**
+
+No source available.
+
+FLASH-Specific Field List
+-------------------------
+
+DII_Density
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+DI_Density
+++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+Density
++++++++
+
+ * Units: :math:`\rm{g}/\rm{cm}^3`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+Electron_Density
+++++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+Flame_Density
++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+Flame_Fraction
+++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+GasEnergy
++++++++++
+
+ * Units: :math:`\rm{erg}/\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+H2II_Density
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+H2I_Density
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+HD_Density
+++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+HII_Density
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+HI_Density
+++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+HM_Density
+++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+HeIII_Density
++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+HeII_Density
+++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+HeI_Density
++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _dens(field, data):
+ return data[fname] * data['Density']
+
+
+**Convert Function Source**
+
+No source available.
+
+ParticleMass
+++++++++++++
+
+ * Units: :math:`\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+ParticleMassMsun
+++++++++++++++++
+
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _ParticleMassMsun(field, data):
+ return data["ParticleMass"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertParticleMassMsun(data):
+ return 1.0/1.989e33
+
+
+Temperature
++++++++++++
+
+ * Units: :math:`\rm{K}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+TotalEnergy
++++++++++++
+
+ * Units: :math:`\rm{erg}/\rm{g}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_index
+++++++++++++++
+
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_position_x
++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_position_y
++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_position_z
++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_velocity_x
++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_velocity_y
++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+particle_velocity_z
++++++++++++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+x-velocity
+++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+y-velocity
+++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+z-velocity
+++++++++++
+
+ * Units: :math:`\rm{cm}/\rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+Nyx-Specific Field List
+--------------------------
+
+Density
++++++++
+
+ * Units: :math:`\rm{g}} / \rm{cm}^3`
+ * Projected Units: :math:`\rm{g}} / \rm{cm}^2`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _TranslationFunc(field, data):
+ return data[field_name]
+
+
+**Convert Function Source**
+
+No source available.
+
+ParticleMassMsun
+++++++++++++++++
+
+ * Units: :math:`\rm{M_{\odot}}`
+ * Particle Type: True
+
+**Field Source**
+
+.. code-block:: python
+
+ def _particle_mass_m_sun(field, data):
+ return data["particle_mass"]
+
+
+**Convert Function Source**
+
+.. code-block:: python
+
+ def _convertParticleMassMsun(data):
+ return (1/1.989e33)
+
+
+Pressure
+++++++++
+
+ * Units: :math:`\rm{M_{\odot}} (\rm{km} / \rm{s})^2 / \rm{Mpc}^3`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _pressure(field, data):
+ """
+ Computed using
+
+ $$ pressure = (\gamma - 1.0) * e$$
+
+ where e is thermal energy density. Note that this will need to be modified
+ when radiation is accounted for.
+
+ """
+ return (data.pf["Gamma"] - 1.0) * data["ThermalEnergy"]
+
+
+**Convert Function Source**
+
+No source available.
+
+Temperature
++++++++++++
+
+ * Units: :math:`\rm{Kelvin}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _temperature(field, data):
+ return ((data.pf["Gamma"] - 1.0) * data.pf["mu"] * mh *
+ data["ThermalEnergy"] / (kboltz * data["Density"]))
+
+
+**Convert Function Source**
+
+No source available.
+
+ThermalEnergy
++++++++++++++
+
+ * Units: :math:`\rm{M_{\odot}} (\rm{km} / \rm{s})^2`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _thermal_energy(field, data):
+ """
+ Generate thermal (gas energy). Dual Energy Formalism was implemented by
+ Stella, but this isn't how it's called, so I'll leave that commented out for
+ now.
+
+ """
+ #if data.pf["DualEnergyFormalism"]:
+ # return data["Gas_Energy"]
+ #else:
+ return data["Total_Energy"] - 0.5 * data["density"] * (
+ data["x-velocity"]**2.0
+ + data["y-velocity"]**2.0
+ + data["z-velocity"]**2.0 )
+
+
+**Convert Function Source**
+
+No source available.
+
+x-velocity
+++++++++++
+
+ * Units: :math:`\rm{km} / \rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _x_velocity(field, data):
+ """ Generate x-velocity from x-momentum and density. """
+ return data["x-momentum"] / data["density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+y-velocity
+++++++++++
+
+ * Units: :math:`\rm{km} / \rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _y_velocity(field, data):
+ """ Generate y-velocity from y-momentum and density. """
+ return data["y-momentum"] / data["density"]
+
+
+**Convert Function Source**
+
+No source available.
+
+z-velocity
+++++++++++
+
+ * Units: :math:`\rm{km} / \rm{s}`
+ * Particle Type: False
+
+**Field Source**
+
+.. code-block:: python
+
+ def _z_velocity(field, data):
+ """ Generate z-velocity from z-momentum and density. """
+ return data["z-momentum"] / data["density"]
+
+
+**Convert Function Source**
+
+No source available.
+
diff -r 32a1ab8ea1e73f1fd0c9d89817e9b461059c28bd -r 18b55a05b6fbff3a3b8eb8f20ff19d34d8ef53cc source/index.rst
--- a/source/index.rst
+++ b/source/index.rst
@@ -41,7 +41,9 @@
advanced/index
getting_involved/index
cookbook/index
- reference/index
+ field_list
+ api
+ configuration
faq/index
diff -r 32a1ab8ea1e73f1fd0c9d89817e9b461059c28bd -r 18b55a05b6fbff3a3b8eb8f20ff19d34d8ef53cc source/reference/changelog.rst
--- a/source/reference/changelog.rst
+++ /dev/null
@@ -1,199 +0,0 @@
-.. _changelog:
-
-ChangeLog
-=========
-
-This is a non-comprehensive log of changes to the code.
-
-Version 2.3
------------
-
- * Multi-level parallelism
- * Real, extensive answer tests
- * Boolean data regions (see :ref:`boolean_data_objects`)
- * Isocontours / flux calculations (see :ref:`extracting-isocontour-information`)
- * Field reorganization (see :ref:`types_of_fields`)
- * PHOP memory improvements
- * Bug fixes for tests
- * Parallel data loading for RAMSES, along with other speedups and improvements
- there
- * WebGL interface for isocontours and a pannable map widget added to Reason
- (see :ref:`within-reason`)
- * Performance improvements for volume rendering
- * Adaptive HEALpix support (see :ref:`adaptive_healpix_volume_rendering`)
- * Column density calculations (see :ref:`radial_column_density`)
- * Massive speedup for 1D profiles
- * Lots more, bug fixes etc.
- * Substantial improvements to the documentation, including
- :ref:`manual-plotting` and a revamped :ref:`orientation`.
-
-Version 2.2
------------
-
- * Command-line submission to the yt Hub (http://hub.yt-project.org/)
- * Initial release of the web-based GUI Reason, designed for efficient remote
- usage over SSH tunnels (see :ref:`reason`)
- * Absorption line spectrum generator for cosmological simulations (see
- :ref:`absorption_spectrum`)
- * Interoperability with ParaView for volume rendering, slicing, and so forth
- * Support for the Nyx code
- * An order of magnitude speed improvement in the RAMSES support
- * Quad-tree projections, speeding up the process of projecting by up to an
- order of magnitude and providing better load balancing
- * “mapserver” for in-browser, Google Maps-style slice and projection
- visualization (see :ref:`mapserver`)
- * Many bug fixes and performance improvements
- * Halo loader (see :ref:`load_haloes`)
-
-Version 2.1
------------
-
- * HEALpix-based volume rendering for 4pi, allsky volume rendering
- * libconfig is now included
- * SQLite3 and Forthon now included by default in the install script
- * Development guide has been lengthened substantially and a development
- bootstrap script (:ref:`bootstrap-dev`) is now included.
- * Installation script now installs Python 2.7 and HDF5 1.8.6
- * iyt now tab-completes field names
- * Halos can now be stored on-disk much more easily between HaloFinding runs.
- * Halos found inline in Enzo can be loaded and merger trees calculated
- * Support for CASTRO particles has been added
- * Chombo support updated and fixed
- * New code contributions
- * Contour finder has been sped up by a factor of a few
- * Constrained two-point functions are now possible, for LOS power spectra
- * Time series analysis (:ref:`time-series-analysis`) now much easier
- * Stream Lines now a supported 1D data type (:class:`AMRStreamlineBase`)
- * Stream Lines now able to be calculated and plotted (:ref:`streamlines`)
- * In situ Enzo visualization now much faster
- * "gui" source directory reorganized and cleaned up
- * Cython now a compile-time dependency, reducing the size of source tree
- updates substantially
- * ``yt-supplemental`` repository now checked out by default, containing
- cookbook, documentation, handy mercurial extensions, and advanced plotting
- examples and helper scripts.
- * Pasteboards now supported and available
- * Parallel yt efficiency improved by removal of barriers and improvement of
- collective operations
-
-Version 2.0
------------
-
- * Major reorganization of the codebase for speed, ease of modification, and maintainability
- * Re-organization of documentation and addition of Orientation Session
- * Support for FLASH code
- * Preliminary support for MAESTRO, CASTRO, ART, and RAMSES (contributions welcome!)
- * Perspective projection for volume rendering
- * Exporting to Sunrise
- * Preliminary particle rendering in volume rendering visualization
- * Drastically improved parallel volume rendering, via kD-tree decomposition
- * Simple merger tree calculation for FOF catalogs
- * New and greatly expanded documentation, with a "source" button
-
-Version 1.7
------------
-
- * Direct writing of PNGs (see :ref:`image_writer`)
- * 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`)
- * 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
- :ref:`volume_rendering`)
- * Added Camera interface to volume rendering (See :ref:`volume_rendering`)
- * Off-axis projection (See :ref:`volume_rendering`)
- * Stereo (toe-in) volume rendering (See :ref:`volume_rendering`)
- * DualEPS extension for better EPS construction
- * yt now uses Distribute instead of SetupTools
- * Better ``iyt`` initialization for GUI support
- * Rewritten, memory conservative and speed-improved contour finding algorithm
- * Speed improvements to volume rendering
- * Preliminary support for the Tiger code
- * Default colormap is now ``algae``
- * Lightweight projection loading with ``projload``
- * Improvements to `yt.data_objects.time_series`
- * Improvements to :class:`yt.extensions.EnzoSimulation` (See
- :ref:`analyzing-an-entire-simulation`)
- * Removed ``direct_ray_cast``
- * Fixed bug causing double data-read in projections
- * Added Cylinder support to ParticleIO
- * Fixes for 1- and 2-D Enzo datasets
- * Preliminary, largely non-functional Gadget support
- * Speed improvements to basic HOP
- * Added physical constants module
- * Beginning to standardize and enforce docstring requirements, changing to
- ``autosummary``-based API documentation.
-
-Version 1.6.1
--------------
-
- * Critical fixes to ParticleIO
- * Halo mass function fixes for comoving coordinates
- * Fixes to halo finding
- * Fixes to the installation script
- * "yt instinfo" command to report current installation information as well as
- auto-update some types of installations
- * Optimizations to the volume renderer (2x-26x reported speedups)
-
-Version 1.6
------------
-
-Version 1.6 is a point release, primarily notable for the new parallel halo
-finder (see :ref:`halo_finding`)
-
- * (New) Parallel HOP ( http://arxiv.org/abs/1001.3411 , :ref:`halo_finding` )
- * (Beta) Software ray casting and volume rendering
- (see :ref:`volume_rendering`)
- * Rewritten, faster and better contouring engine for clump identification
- * Spectral Energy Distribution calculation for stellar populations
- (see :ref:`synthetic_spectrum`)
- * Optimized data structures such as the hierarchy
- * Star particle analysis routines
- (see :ref:`star_analysis`)
- * Halo mass function routines (see :ref:`hmf_howto`)
- * Completely rewritten, massively faster and more memory efficient Particle IO
- * Fixes for plots, including normalized phase plots
- * Better collective communication in parallel routines
- * Consolidation of optimized C routines into ``amr_utils``
- * Many bug fixes and minor optimizations
-
-Version 1.5
------------
-
-Version 1.5 features many new improvements, most prominently that of the
-addition of parallel computing abilities (see :ref:`parallel-computation`) and
-generalization for multiple AMR data formats, specifically both Enzo and Orion.
-
- * Rewritten documentation
- * Fully parallel slices, projections, cutting planes, profiles,
- quantities
- * Parallel HOP
- * Friends-of-friends halo finder
- * Object storage and serialization
- * Major performance improvements to the clump finder (factor of five)
- * Generalized domain sizes
- * Generalized field info containers
- * Dark Matter-only simulations
- * 1D and 2D simulations
- * Better IO for HDF5 sets
- * Support for the Orion AMR code
- * Spherical re-gridding
- * Halo profiler
- * Disk image stacker
- * Light cone generator
- * Callback interface improved
- * Several new callbacks
- * New data objects -- ortho and non-ortho rays, limited ray-tracing
- * Fixed resolution buffers
- * Spectral integrator for CLOUDY data
- * Substantially better interactive interface
- * Performance improvements *everywhere*
- * Command-line interface to *many* common tasks
- * Isolated plot handling, independent of PlotCollections
-
-Version 1.0
------------
-
- * Initial release!
diff -r 32a1ab8ea1e73f1fd0c9d89817e9b461059c28bd -r 18b55a05b6fbff3a3b8eb8f20ff19d34d8ef53cc source/reference/configuration.rst
--- a/source/reference/configuration.rst
+++ /dev/null
@@ -1,75 +0,0 @@
-.. _configuration-file:
-
-Configuration File
-==================
-
-yt will look for and recognize the file ``$HOME/.yt/config`` as a configuration
-file, containing several options that can be modified and adjusted to control
-runtime behavior. For example, a sample ``$HOME/.yt/config`` file could look
-like:
-
-.. code-block:: none
-
- [yt]
- loglevel = 1
- maximumstoredpfs = 10000
-
-This configuration file would set the logging threshold much lower, enabling
-much more voluminous output from yt. Additionally, it increases the number of
-parameter files tracked between instantiations of yt.
-
-In addition to setting parameters in the configuration file itself, you can set
-them at runtime.
-
-.. warning:: Several parameters are only accessed when yt starts up: therefore,
- if you want to modify any configuration parameters at runtime, you should
- execute the appropriate commands at the *very top* of your script!
-
-This involves importing the configuration object and then setting a given
-parameter to be equal to a specific string. Note that even for items that
-accept integers, floating points and other non-string types, you *must* set
-them to be a string or else the configuration object will consider them broken.
-
-Here is an example script, where we adjust the logging at startup:
-
-.. code-block:: python
-
- from yt.config import ytcfg
- ytcfg["yt", "loglevel"] = "1"
-
- from yt.mods import *
- pf = load("my_data0001")
- pf.h.print_stats()
-
-This has the same effect as setting ``loglevel = 1`` in the configuration file.
-
-The following parameters are available.
-
-* ``__parallel`` (default: ``'False'``): Internal parameter governing whether this
- run is being executed in parallel or not. Can be read from.
-* ``__parallel_rank`` (default: ``'0'``): Internal parameter governing the rank of
- the current processor. Can be read from.
-* ``__parallel_size`` (default: ``'1'``): Internal parameter governing the size of
- the parallel job. Can be read from.
-* ``coloredlogs`` (default: ``'False'``): Should logs be colored?
-* ``inline`` (default: ``'False'``): Internal parameter indicating whether this
- session is being called from within a running simulation code.
-* ``loadfieldplugins`` (default: ``'True'``): Do we want to load the plugin file?
-* ``logfile`` (default: ``'False'``): Should we output to a log file in the
- filesystem?
-* ``loglevel`` (default: ``'20'``): What is the threshold (0 to 50) for outputing
- log files?
-* ``maximumstoredpfs`` (default: ``'500'``): How many parameter files should be
- tracked between sessions?
-* ``onlydeserialize`` (default: ``'False'``): If true, only pull from .yt files,
- never add to them.
-* ``parameterfilestore`` (default: ``'parameter_files.csv'``): The name of the file
- in ``$HOME/.yt/`` in which parameter files will be tracked.
-* ``pluginfilename`` (default ``'my_plugins.py'``) The name of our plugin file.
-* ``serialize`` (default: ``'True'``): Are we allowed to write to the ``.yt`` file?
-* ``storeparameterfiles`` (default: ``'False'``): Should we track parameter files
- between sessions?
-* ``suppressStreamLogging`` (default: ``'False'``): If true, execution mode will be
- quiet.
-* ``timefunctions`` (default: ``'False'``): Should (some) functions report their
- runtime?
diff -r 32a1ab8ea1e73f1fd0c9d89817e9b461059c28bd -r 18b55a05b6fbff3a3b8eb8f20ff19d34d8ef53cc source/reference/field_list.rst
--- a/source/reference/field_list.rst
+++ /dev/null
@@ -1,5178 +0,0 @@
-.. _field-list:
-
-Field List
-==========
-
-This is a list of all fields available in ``yt``. It has been organized by the
-type of code that each field is supported by. "Universal" fields are available
-everywhere, "Enzo" fields in Enzo datasets, "Orion" fields in Orion datasets,
-and so on.
-
-.. note:: Universal fields will be overridden by a code-specific field.
-
-.. rubric:: Table of Contents
-
-.. contents::
- :depth: 2
- :local:
- :backlinks: none
-
-Universal Field List
---------------------
-
-AbsDivV
-+++++++
-
- * Units: :math:`\rm{s}^{-1}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AbsDivV(field, data):
- return na.abs(data['DivV'])
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentum
-+++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentum(field, data):
- return data["CellMass"] * data["SpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumMSUNKMSMPC
-+++++++++++++++++++++++++
-
- * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentum(field, data):
- return data["CellMass"] * data["SpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumX
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumX(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumX"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumY
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumY(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumY"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AngularMomentumZ
-++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AngularMomentumZ(field, data):
- return data["CellMass"] * data["SpecificAngularMomentumZ"]
-
-
-**Convert Function Source**
-
-No source available.
-
-AveragedDensity
-+++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _AveragedDensity(field, data):
- nx, ny, nz = data["Density"].shape
- new_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')
- weight_field = na.zeros((nx-2,ny-2,nz-2), dtype='float64')
- i_i, j_i, k_i = na.mgrid[0:3,0:3,0:3]
- for i,j,k in zip(i_i.ravel(),j_i.ravel(),k_i.ravel()):
- sl = [slice(i,nx-(2-i)),slice(j,ny-(2-j)),slice(k,nz-(2-k))]
- new_field += data["Density"][sl] * data["CellMass"][sl]
- weight_field += data["CellMass"][sl]
- # Now some fancy footwork
- new_field2 = na.zeros((nx,ny,nz))
- new_field2[1:-1,1:-1,1:-1] = new_field/weight_field
- return new_field2
-
-
-**Convert Function Source**
-
-No source available.
-
-Baryon_Overdensity
-++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Baryon_Overdensity(field, data):
- if data.pf.has_key('omega_baryon_now'):
- omega_baryon_now = data.pf['omega_baryon_now']
- else:
- omega_baryon_now = 0.0441
- return data['Density'] / (omega_baryon_now * rho_crit_now *
- (data.pf['CosmologyHubbleConstantNow']**2) *
- ((1+data.pf['CosmologyCurrentRedshift'])**3))
-
-
-**Convert Function Source**
-
-No source available.
-
-CellMass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMass(field, data):
- return data["Density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-CellMassCode
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMassCode(field, data):
- return data["Density"] * data["CellVolumeCode"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassCode(data):
- return 1.0/data.convert("Density")
-
-
-CellMassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellMass(field, data):
- return data["Density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-CellVolume
-++++++++++
-
- * Units: :math:`\rm{cm}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertCellVolumeCGS(data):
- return data.convert("cm")**3.0
-
-
-CellVolumeCode
-++++++++++++++
-
- * Units: :math:`\rm{BoxVolume}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-No source available.
-
-CellVolumeMpc
-+++++++++++++
-
- * Units: :math:`\rm{Mpc}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CellVolume(field, data):
- if data['dx'].size == 1:
- try:
- return data['dx']*data['dy']*data['dx']*\
- na.ones(data.ActiveDimensions, dtype='float64')
- except AttributeError:
- return data['dx']*data['dy']*data['dx']
- return data["dx"]*data["dy"]*data["dz"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertCellVolumeMpc(data):
- return data.convert("mpc")**3.0
-
-
-CellsPerBin
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Ones(field, data):
- return na.ones(data.ActiveDimensions, dtype='float64')
-
-
-**Convert Function Source**
-
-No source available.
-
-ComovingDensity
-+++++++++++++++
-
- * Units: :math:`\rm{g}/\rm{cm}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _ComovingDensity(field, data):
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data["Density"]/ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Contours
-++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Contours(field, data):
- return na.ones(data["Density"].shape)*-1
-
-
-**Convert Function Source**
-
-No source available.
-
-CourantTimeStep
-+++++++++++++++
-
- * Units: :math:`$\rm{s}$`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CourantTimeStep(field, data):
- t1 = data['dx'] / (
- data["SoundSpeed"] + \
- abs(data["x-velocity"]))
- t2 = data['dy'] / (
- data["SoundSpeed"] + \
- abs(data["y-velocity"]))
- t3 = data['dz'] / (
- data["SoundSpeed"] + \
- abs(data["z-velocity"]))
- return na.minimum(na.minimum(t1,t2),t3)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCourantTimeStep(data):
- # SoundSpeed and z-velocity are in cm/s, dx is in code
- return data.convert("cm")
-
-
-CuttingPlaneVelocityX
-+++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CuttingPlaneVelocityX(field, data):
- x_vec, y_vec, z_vec = [data.get_field_parameter("cp_%s_vec" % (ax))
- for ax in 'xyz']
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- v_vec = na.array([data["%s-velocity" % ax] for ax in 'xyz']) \
- - bulk_velocity[...,na.newaxis]
- return na.dot(x_vec, v_vec)
-
-
-**Convert Function Source**
-
-No source available.
-
-CuttingPlaneVelocityY
-+++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _CuttingPlaneVelocityY(field, data):
- x_vec, y_vec, z_vec = [data.get_field_parameter("cp_%s_vec" % (ax))
- for ax in 'xyz']
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- v_vec = na.array([data["%s-velocity" % ax] for ax in 'xyz']) \
- - bulk_velocity[...,na.newaxis]
- return na.dot(y_vec, v_vec)
-
-
-**Convert Function Source**
-
-No source available.
-
-DensityPerturbation
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DensityPerturbation(field, data):
- rho_bar = rho_crit_now * data.pf.omega_matter * \
- data.pf.hubble_constant**2 * \
- (1.0 + data.pf.current_redshift)**3
- return ((data['Matter_Density'] - rho_bar) / rho_bar)
-
-
-**Convert Function Source**
-
-No source available.
-
-DiskAngle
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DiskAngle(field, data):
- # We make both r_vec and h_vec into unit vectors
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- r_vec = r_vec/na.sqrt((r_vec**2.0).sum(axis=0))
- h_vec = na.array(data.get_field_parameter("height_vector"))
- dp = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.arccos(dp)
-
-
-**Convert Function Source**
-
-No source available.
-
-DivV
-++++
-
- * Units: :math:`\rm{s}^{-1}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DivV(field, data):
- # We need to set up stencils
- if data.pf["HydroMethod"] == 2:
- sl_left = slice(None,-2,None)
- sl_right = slice(1,-1,None)
- div_fac = 1.0
- else:
- sl_left = slice(None,-2,None)
- sl_right = slice(2,None,None)
- div_fac = 2.0
- ds = div_fac * data['dx'].flat[0]
- f = data["x-velocity"][sl_right,1:-1,1:-1]/ds
- f -= data["x-velocity"][sl_left ,1:-1,1:-1]/ds
- if data.pf.dimensionality > 1:
- ds = div_fac * data['dy'].flat[0]
- f += data["y-velocity"][1:-1,sl_right,1:-1]/ds
- f -= data["y-velocity"][1:-1,sl_left ,1:-1]/ds
- if data.pf.dimensionality > 2:
- ds = div_fac * data['dz'].flat[0]
- f += data["z-velocity"][1:-1,1:-1,sl_right]/ds
- f -= data["z-velocity"][1:-1,1:-1,sl_left ]/ds
- new_field = na.zeros(data["x-velocity"].shape, dtype='float64')
- new_field[1:-1,1:-1,1:-1] = f
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertDivV(data):
- return data.convert("cm")**-1.0
-
-
-DynamicalTime
-+++++++++++++
-
- * Units: :math:`\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DynamicalTime(field, data):
- """
- The formulation for the dynamical time is:
- M{sqrt(3pi/(16*G*rho))} or M{sqrt(3pi/(16G))*rho^-(1/2)}
- Note that we return in our natural units already
- """
- return (3.0*na.pi/(16*G*data["Density"]))**(1./2.)
-
-
-**Convert Function Source**
-
-No source available.
-
-Entropy
-+++++++
-
- * Units: :math:`\rm{ergs}\ \rm{cm}^{2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Entropy(field, data):
- return kboltz * data["Temperature"] / \
- (data["NumberDensity"]**(data.pf["Gamma"] - 1.0))
-
-
-**Convert Function Source**
-
-No source available.
-
-GridIndices
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _GridIndices(field, data):
- return na.ones(data["Ones"].shape)*(data.id-data._id_offset)
-
-
-**Convert Function Source**
-
-No source available.
-
-GridLevel
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _GridLevel(field, data):
- return na.ones(data.ActiveDimensions)*(data.Level)
-
-
-**Convert Function Source**
-
-No source available.
-
-Height
-++++++
-
- * Units: :math:`cm`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Height(field, data):
- # We take the dot product of the radius vector with the height-vector
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- h_vec = na.array(data.get_field_parameter("height_vector"))
- h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
- h_vec[1]**2.0+
- h_vec[2]**2.0)
- height = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.abs(height)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertHeight(data):
- return data.convert("cm")
-
-
-HeightAU
-++++++++
-
- * Units: :math:`AU`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Height(field, data):
- # We take the dot product of the radius vector with the height-vector
- center = data.get_field_parameter("center")
- r_vec = na.array([data["x"] - center[0],
- data["y"] - center[1],
- data["z"] - center[2]])
- h_vec = na.array(data.get_field_parameter("height_vector"))
- h_vec = h_vec / na.sqrt(h_vec[0]**2.0+
- h_vec[1]**2.0+
- h_vec[2]**2.0)
- height = r_vec[0,:] * h_vec[0] \
- + r_vec[1,:] * h_vec[1] \
- + r_vec[2,:] * h_vec[2]
- return na.abs(height)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertHeightAU(data):
- return data.convert("au")
-
-
-JeansMassMsun
-+++++++++++++
-
- * Units: :math:`\rm{M_{\odot}}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _JeansMassMsun(field,data):
- MJ_constant = (((5*kboltz)/(G*mh))**(1.5)) * \
- (3/(4*3.1415926535897931))**(0.5) / 1.989e33
-
- return (MJ_constant *
- ((data["Temperature"]/data["MeanMolecularWeight"])**(1.5)) *
- (data["Density"]**(-0.5)))
-
-
-**Convert Function Source**
-
-No source available.
-
-MachNumber
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MachNumber(field, data):
- """M{|v|/t_sound}"""
- return data["VelocityMagnitude"] / data["SoundSpeed"]
-
-
-**Convert Function Source**
-
-No source available.
-
-MagneticEnergy
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MagneticEnergy(field,data):
- """This assumes that your front end has provided Bx, By, Bz in
- units of Gauss. If you use MKS, make sure to write your own
- MagneticEnergy field to deal with non-unitary \mu_0.
- """
- return (data["Bx"]**2 + data["By"]**2 + data["Bz"]**2)/2.
-
-
-**Convert Function Source**
-
-No source available.
-
-Matter_Density
-++++++++++++++
-
- * Units: :math:`\rm{g}/\rm{cm^3}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Matter_Density(field,data):
- return (data['Density'] + data['Dark_Matter_Density'])
-
-
-**Convert Function Source**
-
-No source available.
-
-MeanMolecularWeight
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _MeanMolecularWeight(field,data):
- return (data["Density"] / (mh *data["NumberDensity"]))
-
-
-**Convert Function Source**
-
-No source available.
-
-Ones
-++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Ones(field, data):
- return na.ones(data.ActiveDimensions, dtype='float64')
-
-
-**Convert Function Source**
-
-No source available.
-
-OnesOverDx
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _OnesOverDx(field, data):
- return na.ones(data["Ones"].shape,
- dtype=data["Density"].dtype)/data['dx']
-
-
-**Convert Function Source**
-
-No source available.
-
-Overdensity
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Matter_Density(field,data):
- return (data['Density'] + data['Dark_Matter_Density'])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _Convert_Overdensity(data):
- return 1 / (rho_crit_now * data.pf.hubble_constant**2 *
- (1+data.pf.current_redshift)**3)
-
-
-ParticleAngularMomentum
-+++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentum(field, data):
- return data["ParticleMass"] * data["ParticleSpecificAngularMomentum"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumMSUNKMSMPC
-+++++++++++++++++++++++++++++++++
-
- * Units: :math:`M_{\odot}\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumMSUNKMSMPC(field, data):
- return data["ParticleMass"] * data["ParticleSpecificAngularMomentumKMSMPC"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumX
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumX(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumX"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumY
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumY(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumY"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleAngularMomentumZ
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{g}\/\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAngularMomentumZ(field, data):
- return data["CellMass"] * data["ParticleSpecificAngularMomentumZ"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleRadius
-++++++++++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusCGS(data):
- return data.convert("cm")
-
-
-ParticleRadiusAU
-++++++++++++++++
-
- * Units: :math:`\rm{AU}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusAU(data):
- return data.convert("au")
-
-
-ParticleRadiusCode
-++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleRadiusMpc
-+++++++++++++++++
-
- * Units: :math:`\rm{Mpc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusMpc(data):
- return data.convert("mpc")
-
-
-ParticleRadiuskpc
-+++++++++++++++++
-
- * Units: :math:`\rm{kpc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-ParticleRadiuskpch
-++++++++++++++++++
-
- * Units: :math:`\rm{kpc}/\rm{h}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpch(data):
- return data.convert("kpch")
-
-
-ParticleRadiuspc
-++++++++++++++++
-
- * Units: :math:`\rm{pc}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleRadius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["particle_position_x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data["particle_position_%s" % ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuspc(data):
- return data.convert("pc")
-
-
-ParticleSpecificAngularMomentum
-+++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentum(field, data):
- """
- Calculate the angular of a particle velocity. Returns a vector for each
- particle.
- """
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- center = data.get_field_parameter('center')
- coords = na.array([data['particle_position_x'],
- data['particle_position_y'],
- data['particle_position_z']], dtype='float64')
- new_shape = tuple([3] + [1]*(len(coords.shape)-1))
- r_vec = coords - na.reshape(center,new_shape)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumKMSMPC
-+++++++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentum(field, data):
- """
- Calculate the angular of a particle velocity. Returns a vector for each
- particle.
- """
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- center = data.get_field_parameter('center')
- coords = na.array([data['particle_position_x'],
- data['particle_position_y'],
- data['particle_position_z']], dtype='float64')
- new_shape = tuple([3] + [1]*(len(coords.shape)-1))
- r_vec = coords - na.reshape(center,new_shape)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
-
-
-ParticleSpecificAngularMomentumX
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumX(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- y = data["particle_position_y"] - center[1]
- z = data["particle_position_z"] - center[2]
- yv = data["particle_velocity_y"] - bv[1]
- zv = data["particle_velocity_z"] - bv[2]
- return yv*z - zv*y
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumY
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumY(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- x = data["particle_position_x"] - center[0]
- z = data["particle_position_z"] - center[2]
- xv = data["particle_velocity_x"] - bv[0]
- zv = data["particle_velocity_z"] - bv[2]
- return -(xv*z - zv*x)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleSpecificAngularMomentumZ
-++++++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleSpecificAngularMomentumZ(field, data):
- if data.has_field_parameter("bulk_velocity"):
- bv = data.get_field_parameter("bulk_velocity")
- else: bv = na.zeros(3, dtype='float64')
- center = data.get_field_parameter('center')
- x = data["particle_position_x"] - center[0]
- y = data["particle_position_y"] - center[1]
- xv = data["particle_velocity_x"] - bv[0]
- yv = data["particle_velocity_y"] - bv[1]
- return xv*y - yv*x
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-ParticleVelocityMagnitude
-+++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleVelocityMagnitude(field, data):
- """M{|v|}"""
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- return ( (data["particle_velocity_x"]-bulk_velocity[0])**2.0 + \
- (data["particle_velocity_y"]-bulk_velocity[1])**2.0 + \
- (data["particle_velocity_z"]-bulk_velocity[2])**2.0 )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-Pressure
-++++++++
-
- * Units: :math:`\rm{dyne}/\rm{cm}^{2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Pressure(field, data):
- """M{(Gamma-1.0)*rho*E}"""
- return (data.pf["Gamma"] - 1.0) * \
- data["Density"] * data["ThermalEnergy"]
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialMachNumber
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialMachNumber(field, data):
- """M{|v|/t_sound}"""
- return na.abs(data["RadialVelocity"]) / data["SoundSpeed"]
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocity
-++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocity(field, data):
- center = data.get_field_parameter("center")
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
- + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
- + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
- )/data["RadiusCode"]
- if na.any(na.isnan(new_field)): # to fix center = point
- new_field[na.isnan(new_field)] = 0.0
- return new_field
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocityABS
-+++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocityABS(field, data):
- return na.abs(_RadialVelocity(field, data))
-
-
-**Convert Function Source**
-
-No source available.
-
-RadialVelocityKMS
-+++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocity(field, data):
- center = data.get_field_parameter("center")
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- new_field = ( (data['x']-center[0])*(data["x-velocity"]-bulk_velocity[0])
- + (data['y']-center[1])*(data["y-velocity"]-bulk_velocity[1])
- + (data['z']-center[2])*(data["z-velocity"]-bulk_velocity[2])
- )/data["RadiusCode"]
- if na.any(na.isnan(new_field)): # to fix center = point
- new_field[na.isnan(new_field)] = 0.0
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadialVelocityKMS(data):
- return 1e-5
-
-
-RadialVelocityKMSABS
-++++++++++++++++++++
-
- * Units: :math:`\rm{km}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _RadialVelocityABS(field, data):
- return na.abs(_RadialVelocity(field, data))
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadialVelocityKMS(data):
- return 1e-5
-
-
-Radius
-++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusCGS(data):
- return data.convert("cm")
-
-
-RadiusAU
-++++++++
-
- * Units: :math:`\rm{AU}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusAU(data):
- return data.convert("au")
-
-
-RadiusCode
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-No source available.
-
-RadiusMpc
-+++++++++
-
- * Units: :math:`\rm{Mpc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiusMpc(data):
- return data.convert("mpc")
-
-
-Radiuskpc
-+++++++++
-
- * Units: :math:`\rm{kpc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuskpc(data):
- return data.convert("kpc")
-
-
-Radiuspc
-++++++++
-
- * Units: :math:`\rm{pc}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Radius(field, data):
- center = data.get_field_parameter("center")
- DW = data.pf.domain_right_edge - data.pf.domain_left_edge
- radius = na.zeros(data["x"].shape, dtype='float64')
- for i, ax in enumerate('xyz'):
- r = na.abs(data[ax] - center[i])
- radius += na.minimum(r, na.abs(DW[i]-r))**2.0
- na.sqrt(radius, radius)
- return radius
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertRadiuspc(data):
- return data.convert("pc")
-
-
-SZKinetic
-+++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SZKinetic(field, data):
- vel_axis = data.get_field_parameter('axis')
- if vel_axis > 2:
- raise NeedsParameter(['axis'])
- vel = data["%s-velocity" % ({0:'x',1:'y',2:'z'}[vel_axis])]
- return (vel*data["Density"])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSZKinetic(data):
- return 0.88*((sigma_thompson/mh)/clight)
-
-
-SZY
-+++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SZY(field, data):
- return (data["Density"]*data["Temperature"])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSZY(data):
- conv = (0.88/mh) * (kboltz)/(me * clight*clight) * sigma_thompson
- return conv
-
-
-SoundSpeed
-++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SoundSpeed(field, data):
- if data.pf["EOSType"] == 1:
- return na.ones(data["Density"].shape, dtype='float64') * \
- data.pf["EOSSoundSpeed"]
- return ( data.pf["Gamma"]*data["Pressure"] / \
- data["Density"] )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-SpecificAngularMomentum
-+++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentum(field, data):
- """
- Calculate the angular velocity. Returns a vector for each cell.
- """
- r_vec = obtain_rvec(data)
- xv, yv, zv = obtain_velocities(data)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumKMSMPC
-+++++++++++++++++++++++++++++
-
- * Units: :math:`\rm{km}\rm{Mpc}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentum(field, data):
- """
- Calculate the angular velocity. Returns a vector for each cell.
- """
- r_vec = obtain_rvec(data)
- xv, yv, zv = obtain_velocities(data)
- v_vec = na.array([xv,yv,zv], dtype='float64')
- return na.cross(r_vec, v_vec, axis=0)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentumKMSMPC(data):
- return data.convert("mpc")/1e5
-
-
-SpecificAngularMomentumX
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumX(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return yv*rv[2,:] - zv*rv[1,:]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumY
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumY(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return -(xv*rv[2,:] - zv*rv[0,:])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-SpecificAngularMomentumZ
-++++++++++++++++++++++++
-
- * Units: :math:`\rm{cm}^2/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpecificAngularMomentumZ(field, data):
- xv, yv, zv = obtain_velocities(data)
- rv = obtain_rvec(data)
- return xv*rv[1,:] - yv*rv[0,:]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertSpecificAngularMomentum(data):
- return data.convert("cm")
-
-
-StarMassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _StarMass(field,data):
- return data["star_density"] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-TangentialOverVelocityMagnitude
-+++++++++++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TangentialOverVelocityMagnitude(field, data):
- return na.abs(data["TangentialVelocity"])/na.abs(data["VelocityMagnitude"])
-
-
-**Convert Function Source**
-
-No source available.
-
-TangentialVelocity
-++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TangentialVelocity(field, data):
- return na.sqrt(data["VelocityMagnitude"]**2.0
- - data["RadialVelocity"]**2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-TotalMass
-+++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TotalMass(field,data):
- return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-TotalMassMsun
-+++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TotalMass(field,data):
- return (data["Density"]+data["Dark_Matter_Density"]) * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-VelocityMagnitude
-+++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _VelocityMagnitude(field, data):
- """M{|v|}"""
- bulk_velocity = data.get_field_parameter("bulk_velocity")
- if bulk_velocity == None:
- bulk_velocity = na.zeros(3)
- return ( (data["x-velocity"]-bulk_velocity[0])**2.0 + \
- (data["y-velocity"]-bulk_velocity[1])**2.0 + \
- (data["z-velocity"]-bulk_velocity[2])**2.0 )**(1.0/2.0)
-
-
-**Convert Function Source**
-
-No source available.
-
-VorticitySquared
-++++++++++++++++
-
- * Units: :math:`\rm{s}^{-2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _VorticitySquared(field, data):
- mylog.debug("Generating vorticity on %s", data)
- # We need to set up stencils
- if data.pf["HydroMethod"] == 2:
- sl_left = slice(None,-2,None)
- sl_right = slice(1,-1,None)
- div_fac = 1.0
- else:
- sl_left = slice(None,-2,None)
- sl_right = slice(2,None,None)
- div_fac = 2.0
- new_field = na.zeros(data["x-velocity"].shape)
- dvzdy = (data["z-velocity"][1:-1,sl_right,1:-1] -
- data["z-velocity"][1:-1,sl_left,1:-1]) \
- / (div_fac*data["dy"].flat[0])
- dvydz = (data["y-velocity"][1:-1,1:-1,sl_right] -
- data["y-velocity"][1:-1,1:-1,sl_left]) \
- / (div_fac*data["dz"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvzdy - dvydz)**2.0
- del dvzdy, dvydz
- dvxdz = (data["x-velocity"][1:-1,1:-1,sl_right] -
- data["x-velocity"][1:-1,1:-1,sl_left]) \
- / (div_fac*data["dz"].flat[0])
- dvzdx = (data["z-velocity"][sl_right,1:-1,1:-1] -
- data["z-velocity"][sl_left,1:-1,1:-1]) \
- / (div_fac*data["dx"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvxdz - dvzdx)**2.0
- del dvxdz, dvzdx
- dvydx = (data["y-velocity"][sl_right,1:-1,1:-1] -
- data["y-velocity"][sl_left,1:-1,1:-1]) \
- / (div_fac*data["dx"].flat[0])
- dvxdy = (data["x-velocity"][1:-1,sl_right,1:-1] -
- data["x-velocity"][1:-1,sl_left,1:-1]) \
- / (div_fac*data["dy"].flat[0])
- new_field[1:-1,1:-1,1:-1] += (dvydx - dvxdy)**2.0
- del dvydx, dvxdy
- new_field = na.abs(new_field)
- return new_field
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertVorticitySquared(data):
- return data.convert("cm")**-2.0
-
-
-WeakLensingConvergence
-++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _DensityPerturbation(field, data):
- rho_bar = rho_crit_now * data.pf.omega_matter * \
- data.pf.hubble_constant**2 * \
- (1.0 + data.pf.current_redshift)**3
- return ((data['Matter_Density'] - rho_bar) / rho_bar)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertConvergence(data):
- if not data.pf.parameters.has_key('cosmology_calculator'):
- data.pf.parameters['cosmology_calculator'] = Cosmology(
- HubbleConstantNow=(100.*data.pf.hubble_constant),
- OmegaMatterNow=data.pf.omega_matter, OmegaLambdaNow=data.pf.omega_lambda)
- # observer to lens
- DL = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.parameters['observer_redshift'], data.pf.current_redshift)
- # observer to source
- DS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.parameters['observer_redshift'], data.pf.parameters['lensing_source_redshift'])
- # lens to source
- DLS = data.pf.parameters['cosmology_calculator'].AngularDiameterDistance(
- data.pf.current_redshift, data.pf.parameters['lensing_source_redshift'])
- return (((DL * DLS) / DS) * (1.5e14 * data.pf.omega_matter *
- (data.pf.hubble_constant / speed_of_light_cgs)**2 *
- (1 + data.pf.current_redshift)))
-
-
-XRayEmissivity
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _XRayEmissivity(field, data):
- return ((data["Density"].astype('float64')**2.0) \
- *data["Temperature"]**0.5)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertXRayEmissivity(data):
- return 2.168e60
-
-
-dx
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dx(field, data):
- return data.dds[0]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[0]
-
-
-**Convert Function Source**
-
-No source available.
-
-dy
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dy(field, data):
- return data.dds[1]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[1]
-
-
-**Convert Function Source**
-
-No source available.
-
-dz
-++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dz(field, data):
- return data.dds[2]
- return na.ones(data.ActiveDimensions, dtype='float64') * data.dds[2]
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_density
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _pdensity(field, data):
- blank = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return blank
- CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- data["particle_mass"].astype(na.float32),
- na.int64(data.NumberOfParticles),
- blank, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- return blank
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertDensity(data):
- return data.convert("Density")
-
-
-tempContours
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Contours(field, data):
- return na.ones(data["Density"].shape)*-1
-
-
-**Convert Function Source**
-
-No source available.
-
-x
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordX(field, data):
- dim = data.ActiveDimensions[0]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[0])[:,None,None]
- +0.5) * data['dx'] + data.LeftEdge[0]
-
-
-**Convert Function Source**
-
-No source available.
-
-y
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordY(field, data):
- dim = data.ActiveDimensions[1]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[1])[None,:,None]
- +0.5) * data['dy'] + data.LeftEdge[1]
-
-
-**Convert Function Source**
-
-No source available.
-
-z
-+
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _coordZ(field, data):
- dim = data.ActiveDimensions[2]
- return (na.ones(data.ActiveDimensions, dtype='float64')
- * na.arange(data.ActiveDimensions[2])[None,None,:]
- +0.5) * data['dz'] + data.LeftEdge[2]
-
-
-**Convert Function Source**
-
-No source available.
-
-Enzo-Specific Field List
-------------------------
-
-Bmag
-++++
-
- * Units: :math:`\mathrm{Gauss}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Bmag(field, data):
- """ magnitude of bvec
- """
- return na.sqrt(data['Bx']**2 + data['By']**2 + data['Bz']**2)
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_DII_Density
-++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_DI_Density
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_Electron_Density
-+++++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_H2II_Density
-+++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_H2I_Density
-++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HDI_Density
-++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HII_Density
-++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HI_Density
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HM_Density
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HeIII_Density
-++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HeII_Density
-+++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_HeI_Density
-++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_Metal_Density
-++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-Comoving_PreShock_Density
-+++++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesComovingDensity(field, data):
- sp = field.name.split("_")[0] + "_Density"
- ef = (1.0 + data.pf.current_redshift)**3.0
- return data[sp] / ef
-
-
-**Convert Function Source**
-
-No source available.
-
-DII_Fraction
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-DII_Mass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-DII_MassMsun
-++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-DII_NumberDensity
-+++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesNumberDensity(field, data):
- species = field.name.split("_")[0]
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / _speciesMass[species]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
-DI_Fraction
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-DI_Mass
-+++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-Dark_Matter_Mass
-++++++++++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Dark_Matter_Mass(field, data):
- return data['Dark_Matter_Density'] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-Dark_Matter_MassMsun
-++++++++++++++++++++
-
- * Units: :math:`M_{\odot}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Dark_Matter_Mass(field, data):
- return data['Dark_Matter_Density'] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertCellMassMsun(data):
- return 5.027854e-34 # g^-1
-
-
-Electron_Fraction
-+++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-Electron_Mass
-+++++++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-Gas_Energy
-++++++++++
-
- * Units: :math:`\rm{ergs}/\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Gas_Energy(field, data):
- return data["GasEnergy"] / _convertEnergy(data)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertEnergy(data):
- return data.convert("x-velocity")**2.0
-
-
-H2II_Fraction
-+++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-H2II_Mass
-+++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-H2I_Fraction
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-H2I_Mass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HDI_Fraction
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HDI_Mass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HII_Fraction
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HII_Mass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HI_Fraction
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HI_Mass
-+++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HM_Fraction
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HM_Mass
-+++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HeIII_Fraction
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HeIII_Mass
-++++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HeII_Fraction
-+++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HeII_Mass
-+++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HeI_Fraction
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-HeI_Mass
-++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-IsStarParticle
-++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _IsStarParticle(field, data):
- is_star = (data['creation_time'] > 0).astype('float64')
- return is_star
-
-
-**Convert Function Source**
-
-No source available.
-
-KineticEnergy
-+++++++++++++
-
- * Units: :math:`\rm{ergs}/\rm{cm^3}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _KineticEnergy(field, data):
- return 0.5*data["Density"] * ( data["x-velocity"]**2.0
- + data["y-velocity"]**2.0
- + data["z-velocity"]**2.0 )
-
-
-**Convert Function Source**
-
-No source available.
-
-Metal_Fraction
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-Metal_Mass
-++++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-Metallicity
-+++++++++++
-
- * Units: :math:`Z_{\rm{\odot}}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Metallicity(field, data):
- return data["Metal_Fraction"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertMetallicity(data):
- return 49.0196 # 1 / 0.0204
-
-
-Metallicity3
-++++++++++++
-
- * Units: :math:`Z_{\rm{\odot}}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Metallicity3(field, data):
- return data["SN_Colour"]/data["Density"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertMetallicity(data):
- return 49.0196 # 1 / 0.0204
-
-
-NumberDensity
-+++++++++++++
-
- * Units: :math:`\rm{cm}^{-3}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _NumberDensity(field, data):
- # We can assume that we at least have Density
- # We should actually be guaranteeing the presence of a .shape attribute,
- # but I am not currently implementing that
- fieldData = na.zeros(data["Density"].shape,
- dtype = data["Density"].dtype)
- if data.pf["MultiSpecies"] == 0:
- if data.has_field_parameter("mu"):
- mu = data.get_field_parameter("mu")
- else:
- mu = 0.6
- fieldData += data["Density"] / mu
- if data.pf["MultiSpecies"] > 0:
- fieldData += data["HI_Density"] / 1.0
- fieldData += data["HII_Density"] / 1.0
- fieldData += data["HeI_Density"] / 4.0
- fieldData += data["HeII_Density"] / 4.0
- fieldData += data["HeIII_Density"] / 4.0
- fieldData += data["Electron_Density"] / 1.0
- if data.pf["MultiSpecies"] > 1:
- fieldData += data["HM_Density"] / 1.0
- fieldData += data["H2I_Density"] / 2.0
- fieldData += data["H2II_Density"] / 2.0
- if data.pf["MultiSpecies"] > 2:
- fieldData += data["DI_Density"] / 2.0
- fieldData += data["DII_Density"] / 2.0
- fieldData += data["HDI_Density"] / 3.0
- return fieldData
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertNumberDensity(data):
- return 1.0/mh
-
-
-ParticleAge
-+++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleAge(field, data):
- current_time = data.pf.current_time
- return (current_time - data["creation_time"])
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertParticleAge(data):
- return data.convert("years")
-
-
-ParticleMass
-++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleMass(field, data):
- particles = data["particle_mass"].astype('float64') * \
- just_one(data["CellVolumeCode"].ravel())
- # Note that we mandate grid-type here, so this is okay
- return particles
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertParticleMass(data):
- return data.convert("Density")*(data.convert("cm")**3.0)
-
-
-ParticleMassMsun
-++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleMass(field, data):
- particles = data["particle_mass"].astype('float64') * \
- just_one(data["CellVolumeCode"].ravel())
- # Note that we mandate grid-type here, so this is okay
- return particles
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertParticleMassMsun(data):
- return data.convert("Density")*((data.convert("cm")**3.0)/1.989e33)
-
-
-PreShock_Fraction
-+++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesFraction(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] / data["Density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-PreShock_Mass
-+++++++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _SpeciesMass(field, data):
- sp = field.name.split("_")[0] + "_Density"
- return data[sp] * data["CellVolume"]
-
-
-**Convert Function Source**
-
-No source available.
-
-StarAgeYears
-++++++++++++
-
- * Units: :math:`\mathrm{yr}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _StarAge(field, data):
- star_age = na.zeros(data['StarCreationTimeYears'].shape)
- with_stars = data['StarCreationTimeYears'] > 0
- star_age[with_stars] = data.pf.time_units['years'] * \
- data.pf.current_time - \
- data['StarCreationTimeYears'][with_stars]
- return star_age
-
-
-**Convert Function Source**
-
-No source available.
-
-StarCreationTimeYears
-+++++++++++++++++++++
-
- * Units: :math:`\mathrm{yr}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _StarCreationTime(field, data):
- return data['star_creation_time']
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertEnzoTimeYears(data):
- return data.pf.time_units['years']
-
-
-StarDynamicalTimeYears
-++++++++++++++++++++++
-
- * Units: :math:`\mathrm{yr}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _StarDynamicalTime(field, data):
- return data['star_dynamical_time']
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertEnzoTimeYears(data):
- return data.pf.time_units['years']
-
-
-StarMetallicity
-+++++++++++++++
-
- * Units: :math:`Z_{\rm{\odot}}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _StarMetallicity(field, data):
- return data['star_metallicity_fraction']
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _ConvertMetallicity(data):
- return 49.0196 # 1 / 0.0204
-
-
-ThermalEnergy
-+++++++++++++
-
- * Units: :math:`\rm{ergs}/\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _ThermalEnergy(field, data):
- if data.pf["HydroMethod"] == 2:
- return data["TotalEnergy"]
- else:
- if data.pf["DualEnergyFormalism"]:
- return data["GasEnergy"]
- else:
- return data["TotalEnergy"] - 0.5*(
- data["x-velocity"]**2.0
- + data["y-velocity"]**2.0
- + data["z-velocity"]**2.0 )
-
-
-**Convert Function Source**
-
-No source available.
-
-Total_Energy
-++++++++++++
-
- * Units: :math:`\rm{ergs}/\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Total_Energy(field, data):
- return data["TotalEnergy"] / _convertEnergy(data)
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertEnergy(data):
- return data.convert("x-velocity")**2.0
-
-
-cic_particle_velocity_x
-+++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _cic_particle_field(field, data):
- """
- Create a grid field for particle quantities weighted by particle mass,
- using cloud-in-cell deposit.
- """
- particle_field = field.name[4:]
- top = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return top
- particle_field_data = data[particle_field] * data['particle_mass']
- amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- particle_field_data.astype(na.float32),
- na.int64(data.NumberOfParticles),
- top, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- del particle_field_data
-
- bottom = na.zeros(data.ActiveDimensions, dtype='float32')
- amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- data["particle_mass"].astype(na.float32),
- na.int64(data.NumberOfParticles),
- bottom, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- top[bottom == 0] = 0.0
- bnz = bottom.nonzero()
- top[bnz] /= bottom[bnz]
- return top
-
-
-**Convert Function Source**
-
-No source available.
-
-cic_particle_velocity_y
-+++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _cic_particle_field(field, data):
- """
- Create a grid field for particle quantities weighted by particle mass,
- using cloud-in-cell deposit.
- """
- particle_field = field.name[4:]
- top = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return top
- particle_field_data = data[particle_field] * data['particle_mass']
- amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- particle_field_data.astype(na.float32),
- na.int64(data.NumberOfParticles),
- top, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- del particle_field_data
-
- bottom = na.zeros(data.ActiveDimensions, dtype='float32')
- amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- data["particle_mass"].astype(na.float32),
- na.int64(data.NumberOfParticles),
- bottom, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- top[bottom == 0] = 0.0
- bnz = bottom.nonzero()
- top[bnz] /= bottom[bnz]
- return top
-
-
-**Convert Function Source**
-
-No source available.
-
-cic_particle_velocity_z
-+++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _cic_particle_field(field, data):
- """
- Create a grid field for particle quantities weighted by particle mass,
- using cloud-in-cell deposit.
- """
- particle_field = field.name[4:]
- top = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return top
- particle_field_data = data[particle_field] * data['particle_mass']
- amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- particle_field_data.astype(na.float32),
- na.int64(data.NumberOfParticles),
- top, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- del particle_field_data
-
- bottom = na.zeros(data.ActiveDimensions, dtype='float32')
- amr_utils.CICDeposit_3(data["particle_position_x"].astype(na.float64),
- data["particle_position_y"].astype(na.float64),
- data["particle_position_z"].astype(na.float64),
- data["particle_mass"].astype(na.float32),
- na.int64(data.NumberOfParticles),
- bottom, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- top[bottom == 0] = 0.0
- bnz = bottom.nonzero()
- top[bnz] /= bottom[bnz]
- return top
-
-
-**Convert Function Source**
-
-No source available.
-
-dm_density
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dmpdensity(field, data):
- blank = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return blank
- if 'creation_time' in data.pf.field_info:
- filter = data['creation_time'] <= 0.0
- if not filter.any(): return blank
- else:
- filter = na.ones(data.NumberOfParticles, dtype='bool')
- if not filter.any(): return blank
- amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
- data["particle_position_y"][filter].astype(na.float64),
- data["particle_position_z"][filter].astype(na.float64),
- data["particle_mass"][filter].astype(na.float32),
- na.int64(na.where(filter)[0].size),
- blank, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- return blank
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertDensity(data):
- return data.convert("Density")
-
-
-particle_mass
-+++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- try:
- return io._read_data_set(data, p_field).astype(dtype)
- except io._read_exception:
- pass
- # This is bad. But it's the best idea I have right now.
- return data._read_data(p_field.replace("_"," ")).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-star_creation_time
-++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _star_field(field, data):
- """
- Create a grid field for star quantities, weighted by star mass.
- """
- particle_field = field.name[5:]
- top = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return top
- filter = data['creation_time'] > 0.0
- if not filter.any(): return top
- particle_field_data = data[particle_field][filter] * data['particle_mass'][filter]
- amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
- data["particle_position_y"][filter].astype(na.float64),
- data["particle_position_z"][filter].astype(na.float64),
- particle_field_data.astype(na.float32),
- na.int64(na.where(filter)[0].size),
- top, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- del particle_field_data
-
- bottom = na.zeros(data.ActiveDimensions, dtype='float32')
- amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
- data["particle_position_y"][filter].astype(na.float64),
- data["particle_position_z"][filter].astype(na.float64),
- data["particle_mass"][filter].astype(na.float32),
- na.int64(na.where(filter)[0].size),
- bottom, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- top[bottom == 0] = 0.0
- bnz = bottom.nonzero()
- top[bnz] /= bottom[bnz]
- return top
-
-
-**Convert Function Source**
-
-No source available.
-
-star_density
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _spdensity(field, data):
- blank = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return blank
- filter = data['creation_time'] > 0.0
- if not filter.any(): return blank
- amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
- data["particle_position_y"][filter].astype(na.float64),
- data["particle_position_z"][filter].astype(na.float64),
- data["particle_mass"][filter].astype(na.float32),
- na.int64(na.where(filter)[0].size),
- blank, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- return blank
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertDensity(data):
- return data.convert("Density")
-
-
-star_dynamical_time
-+++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _star_field(field, data):
- """
- Create a grid field for star quantities, weighted by star mass.
- """
- particle_field = field.name[5:]
- top = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return top
- filter = data['creation_time'] > 0.0
- if not filter.any(): return top
- particle_field_data = data[particle_field][filter] * data['particle_mass'][filter]
- amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
- data["particle_position_y"][filter].astype(na.float64),
- data["particle_position_z"][filter].astype(na.float64),
- particle_field_data.astype(na.float32),
- na.int64(na.where(filter)[0].size),
- top, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- del particle_field_data
-
- bottom = na.zeros(data.ActiveDimensions, dtype='float32')
- amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
- data["particle_position_y"][filter].astype(na.float64),
- data["particle_position_z"][filter].astype(na.float64),
- data["particle_mass"][filter].astype(na.float32),
- na.int64(na.where(filter)[0].size),
- bottom, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- top[bottom == 0] = 0.0
- bnz = bottom.nonzero()
- top[bnz] /= bottom[bnz]
- return top
-
-
-**Convert Function Source**
-
-No source available.
-
-star_metallicity_fraction
-+++++++++++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _star_field(field, data):
- """
- Create a grid field for star quantities, weighted by star mass.
- """
- particle_field = field.name[5:]
- top = na.zeros(data.ActiveDimensions, dtype='float32')
- if data.NumberOfParticles == 0: return top
- filter = data['creation_time'] > 0.0
- if not filter.any(): return top
- particle_field_data = data[particle_field][filter] * data['particle_mass'][filter]
- amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
- data["particle_position_y"][filter].astype(na.float64),
- data["particle_position_z"][filter].astype(na.float64),
- particle_field_data.astype(na.float32),
- na.int64(na.where(filter)[0].size),
- top, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- del particle_field_data
-
- bottom = na.zeros(data.ActiveDimensions, dtype='float32')
- amr_utils.CICDeposit_3(data["particle_position_x"][filter].astype(na.float64),
- data["particle_position_y"][filter].astype(na.float64),
- data["particle_position_z"][filter].astype(na.float64),
- data["particle_mass"][filter].astype(na.float32),
- na.int64(na.where(filter)[0].size),
- bottom, na.array(data.LeftEdge).astype(na.float64),
- na.array(data.ActiveDimensions).astype(na.int32),
- na.float64(data['dx']))
- top[bottom == 0] = 0.0
- bnz = bottom.nonzero()
- top[bnz] /= bottom[bnz]
- return top
-
-
-**Convert Function Source**
-
-No source available.
-
-Orion-Specific Field List
--------------------------
-
-Density
-+++++++
-
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-Pressure
-++++++++
-
- * Units: :math:`\rm{dyne}/\rm{cm}^{2}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Pressure(field,data):
- """M{(Gamma-1.0)*e, where e is thermal energy density
- NB: this will need to be modified for radiation
- """
- return (data.pf["Gamma"] - 1.0)*data["ThermalEnergy"]
-
-
-**Convert Function Source**
-
-No source available.
-
-Temperature
-+++++++++++
-
- * Units: :math:`\rm{Kelvin}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _Temperature(field,data):
- return (data.pf["Gamma"]-1.0)*data.pf["mu"]*mh*data["ThermalEnergy"]/(kboltz*data["Density"])
-
-
-**Convert Function Source**
-
-No source available.
-
-ThermalEnergy
-+++++++++++++
-
- * Units: :math:`\rm{ergs}/\rm{cm^3}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _ThermalEnergy(field, data):
- """generate thermal (gas energy). Dual Energy Formalism was
- implemented by Stella, but this isn't how it's called, so I'll
- leave that commented out for now.
- """
- #if data.pf["DualEnergyFormalism"]:
- # return data["GasEnergy"]
- #else:
- return data["TotalEnergy"] - 0.5 * data["density"] * (
- data["x-velocity"]**2.0
- + data["y-velocity"]**2.0
- + data["z-velocity"]**2.0 )
-
-
-**Convert Function Source**
-
-No source available.
-
-TotalEnergy
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-density
-+++++++
-
- * Units: :math:`\rm{g}/\rm{cm}^3`
- * Projected Units: :math:`\rm{g}/\rm{cm}^2`
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-eden
-++++
-
- * Units: :math:`\rm{erg}/\rm{cm}^3`
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-particle_angmomen_x
-+++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_angmomen_y
-+++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_angmomen_z
-+++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_burnstate
-++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_id
-+++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_mass
-+++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_mdeut
-++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_mdot
-+++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_mlast
-++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_momentum_x
-+++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_momentum_y
-+++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_momentum_z
-+++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_n
-++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_position_x
-+++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_position_y
-+++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_position_z
-+++++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _Particles(field, data):
- io = data.hierarchy.io
- if not data.NumberOfParticles > 0:
- return na.array([], dtype=dtype)
- else:
- return io._read_particles(data, p_field).astype(dtype)
-
-
-**Convert Function Source**
-
-No source available.
-
-temperature
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-x-momentum
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-x-velocity
-++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _xVelocity(field, data):
- """generate x-velocity from x-momentum and density
-
- """
- return data["xmom"]/data["density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-xmom
-++++
-
- * Units: :math:`\rm{g}/\rm{cm^2\ s}`
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-xvel
-++++
-
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-y-momentum
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-y-velocity
-++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _yVelocity(field,data):
- """generate y-velocity from y-momentum and density
-
- """
- #try:
- # return data["xvel"]
- #except KeyError:
- return data["ymom"]/data["density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-ymom
-++++
-
- * Units: :math:`\rm{gm}/\rm{cm^2\ s}`
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-yvel
-++++
-
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-z-momentum
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-z-velocity
-++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _zVelocity(field,data):
- """generate z-velocity from z-momentum and density
-
- """
- return data["zmom"]/data["density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-zmom
-++++
-
- * Units: :math:`\rm{g}/\rm{cm^2\ s}`
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-zvel
-++++
-
- * Particle Type: False
-
-**Field Source**
-
-No source available.
-
-FLASH-Specific Field List
--------------------------
-
-DII_Density
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-DI_Density
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-Density
-+++++++
-
- * Units: :math:`\rm{g}/\rm{cm}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-Electron_Density
-++++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-Flame_Density
-+++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-Flame_Fraction
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-GasEnergy
-+++++++++
-
- * Units: :math:`\rm{erg}/\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-H2II_Density
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-H2I_Density
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-HD_Density
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-HII_Density
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-HI_Density
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-HM_Density
-++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-HeIII_Density
-+++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-HeII_Density
-++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-HeI_Density
-+++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _dens(field, data):
- return data[fname] * data['Density']
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleMass
-++++++++++++
-
- * Units: :math:`\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleMassMsun
-++++++++++++++++
-
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _ParticleMassMsun(field, data):
- return data["ParticleMass"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertParticleMassMsun(data):
- return 1.0/1.989e33
-
-
-Temperature
-+++++++++++
-
- * Units: :math:`\rm{K}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-TotalEnergy
-+++++++++++
-
- * Units: :math:`\rm{erg}/\rm{g}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_index
-++++++++++++++
-
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_position_x
-+++++++++++++++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_position_y
-+++++++++++++++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_position_z
-+++++++++++++++++++
-
- * Units: :math:`\rm{cm}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_velocity_x
-+++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_velocity_y
-+++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-particle_velocity_z
-+++++++++++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-x-velocity
-++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-y-velocity
-++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-z-velocity
-++++++++++
-
- * Units: :math:`\rm{cm}/\rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-Nyx-Specific Field List
---------------------------
-
-Density
-+++++++
-
- * Units: :math:`\rm{g}} / \rm{cm}^3`
- * Projected Units: :math:`\rm{g}} / \rm{cm}^2`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _TranslationFunc(field, data):
- return data[field_name]
-
-
-**Convert Function Source**
-
-No source available.
-
-ParticleMassMsun
-++++++++++++++++
-
- * Units: :math:`\rm{M_{\odot}}`
- * Particle Type: True
-
-**Field Source**
-
-.. code-block:: python
-
- def _particle_mass_m_sun(field, data):
- return data["particle_mass"]
-
-
-**Convert Function Source**
-
-.. code-block:: python
-
- def _convertParticleMassMsun(data):
- return (1/1.989e33)
-
-
-Pressure
-++++++++
-
- * Units: :math:`\rm{M_{\odot}} (\rm{km} / \rm{s})^2 / \rm{Mpc}^3`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _pressure(field, data):
- """
- Computed using
-
- $$ pressure = (\gamma - 1.0) * e$$
-
- where e is thermal energy density. Note that this will need to be modified
- when radiation is accounted for.
-
- """
- return (data.pf["Gamma"] - 1.0) * data["ThermalEnergy"]
-
-
-**Convert Function Source**
-
-No source available.
-
-Temperature
-+++++++++++
-
- * Units: :math:`\rm{Kelvin}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _temperature(field, data):
- return ((data.pf["Gamma"] - 1.0) * data.pf["mu"] * mh *
- data["ThermalEnergy"] / (kboltz * data["Density"]))
-
-
-**Convert Function Source**
-
-No source available.
-
-ThermalEnergy
-+++++++++++++
-
- * Units: :math:`\rm{M_{\odot}} (\rm{km} / \rm{s})^2`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _thermal_energy(field, data):
- """
- Generate thermal (gas energy). Dual Energy Formalism was implemented by
- Stella, but this isn't how it's called, so I'll leave that commented out for
- now.
-
- """
- #if data.pf["DualEnergyFormalism"]:
- # return data["Gas_Energy"]
- #else:
- return data["Total_Energy"] - 0.5 * data["density"] * (
- data["x-velocity"]**2.0
- + data["y-velocity"]**2.0
- + data["z-velocity"]**2.0 )
-
-
-**Convert Function Source**
-
-No source available.
-
-x-velocity
-++++++++++
-
- * Units: :math:`\rm{km} / \rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _x_velocity(field, data):
- """ Generate x-velocity from x-momentum and density. """
- return data["x-momentum"] / data["density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-y-velocity
-++++++++++
-
- * Units: :math:`\rm{km} / \rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _y_velocity(field, data):
- """ Generate y-velocity from y-momentum and density. """
- return data["y-momentum"] / data["density"]
-
-
-**Convert Function Source**
-
-No source available.
-
-z-velocity
-++++++++++
-
- * Units: :math:`\rm{km} / \rm{s}`
- * Particle Type: False
-
-**Field Source**
-
-.. code-block:: python
-
- def _z_velocity(field, data):
- """ Generate z-velocity from z-momentum and density. """
- return data["z-momentum"] / data["density"]
-
-
-**Convert Function Source**
-
-No source available.
-
https://bitbucket.org/yt_analysis/yt-doc/changeset/1a260a1dd420/
changeset: 1a260a1dd420
user: MatthewTurk
date: 2012-07-06 17:42:46
summary: Changing the autosummary stuff to be slightly different, such that each class
is on a single page instead of all split up. Adding some nice style changes to
the CSS.
affected #: 2 files
diff -r 18b55a05b6fbff3a3b8eb8f20ff19d34d8ef53cc -r 1a260a1dd420ffedb012d488002cf53b265e8b7d source/_static/agogo_yt.css
--- a/source/_static/agogo_yt.css
+++ b/source/_static/agogo_yt.css
@@ -23,3 +23,15 @@
a.biglink {
line-height: 1.2em;
}
+
+a tt.xref {
+ font-weight: bolder;
+}
+
+table.docutils {
+ width: 100%;
+}
+
+table.docutils td {
+ width: 50%;
+}
diff -r 18b55a05b6fbff3a3b8eb8f20ff19d34d8ef53cc -r 1a260a1dd420ffedb012d488002cf53b265e8b7d source/_templates/autosummary/class.rst
--- a/source/_templates/autosummary/class.rst
+++ b/source/_templates/autosummary/class.rst
@@ -1,21 +1,34 @@
{% extends "!autosummary/class.rst" %}
-{% block methods %}
-{% if methods %}
+{{ fullname }}
+{{ underline }}
+
+.. currentmodule:: {{ module }}
+
+.. autoclass:: {{ objname }}
+ :noindex:
+
+ {% block methods %}
+ .. automethod:: __init__
+ :noindex:
+
+ {% if methods %}
+ .. rubric:: Methods
+
.. autosummary::
- :toctree:
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
-{% endif %}
-{% endblock %}
+ {% endif %}
+ {% endblock %}
-{% block attributes %}
-{% if attributes %}
+ {% block attributes %}
+ {% if attributes %}
+ .. rubric:: Attributes
+
.. autosummary::
- :toctree:
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
-{% endif %}
-{% endblock %}
+ {% endif %}
+ {% endblock %}
https://bitbucket.org/yt_analysis/yt-doc/changeset/6a25bdd92ae5/
changeset: 6a25bdd92ae5
user: MatthewTurk
date: 2012-07-06 23:45:59
summary: Removing duplicated .inc files. Next up is fixing the index.
affected #: 21 files
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/camera_movement.inc
--- a/source/cookbook/camera_movement.inc
+++ /dev/null
@@ -1,68 +0,0 @@
-.. _cookbook-camera_movement:
-
-Camera movement
----------------
-
-This recipe shows how to use the movement functions hanging off of the Camera
-object. See :ref:`volume_rendering` for more information.
-
-Additionally, for the purposes of the recipe, we have simplified the image
-considerably.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/camera_movement.py .
-
-.. code-block:: python
-
- from yt.mods import * # set up our namespace
-
- # Follow the simple_volume_rendering cookbook for the first part of this.
- fn = "RedshiftOutput0005" # parameter file to load
- pf = load(fn) # load data
- dd = pf.h.all_data()
- mi, ma = dd.quantities["Extrema"]("Density")[0]
-
- # Set up transfer function
- tf = ColorTransferFunction((na.log10(mi), na.log10(ma)))
- tf.add_layers(6, w=0.05)
-
- # Set up camera paramters
- c = [0.5, 0.5, 0.5] # Center
- L = [1, 1, 1] # Normal Vector
- W = 1.0 # Width
- Nvec = 512 # Pixels on a side
-
- # Specify a north vector, which helps with rotations.
- north_vector = [0.,0.,1.]
-
- # Find the maximum density location, store it in max_c
- v,max_c = pf.h.find_max('Density')
-
- # Initialize the Camera
- cam = pf.h.camera(c, L, W, (Nvec,Nvec), tf, north_vector=north_vector)
- frame = 0
-
- # Do a rotation over 30 frames
- for i, snapshot in enumerate(cam.rotation(na.pi, 30)):
- write_bitmap(snapshot, 'camera_movement_%04i.png' % frame)
- frame += 1
-
- # Move to the maximum density location over 10 frames
- for i, snapshot in enumerate(cam.move_to(max_c, 10)):
- write_bitmap(snapshot, 'camera_movement_%04i.png' % frame)
- frame += 1
-
- # Zoom in by a factor of 10 over 10 frames
- for i, snapshot in enumerate(cam.zoomin(10.0, 10)):
- write_bitmap(snapshot, 'camera_movement_%04i.png' % frame)
- frame += 1
-
-
-
-
-.. rubric:: Sample Output
-
-.. image:: _camera_movement/camera_movement_camera_movement_0029.png
- :width: 240
- :target: ../_images/camera_movement_camera_movement_0029.png
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/contours_on_slice.inc
--- a/source/cookbook/contours_on_slice.inc
+++ /dev/null
@@ -1,31 +0,0 @@
-.. _cookbook-contours_on_slice:
-
-Contours on slice
------------------
-
-This is a simple recipe to show how to open a dataset, plot a slice
-through it, and add contours of another quantity on top.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/contours_on_slice.py .
-
-.. code-block:: python
-
- from yt.mods import * # set up our namespace
-
- fn = "RedshiftOutput0005" # parameter file to load
-
- pf = load(fn) # load data
- pc = PlotCollection(pf) # defaults to center at most dense point
- p = pc.add_slice("Density", 0) # 0 = x-axis
- p.modify["contour"]("Temperature")
- pc.set_width(1.5, 'mpc') # change width of all plots in pc
- pc.save(fn) # save all plots
-
-
-.. rubric:: Sample Output
-
-.. image:: _contours_on_slice/contours_on_slice_RedshiftOutput0005_Slice_x_Density.png
- :width: 240
- :target: ../_images/contours_on_slice_RedshiftOutput0005_Slice_x_Density.png
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/extract_fixed_resolution_data.inc
--- a/source/cookbook/extract_fixed_resolution_data.inc
+++ /dev/null
@@ -1,50 +0,0 @@
-.. _cookbook-extract_fixed_resolution_data:
-
-Extract fixed resolution data
------------------------------
-
-This is a recipe to show how to open a dataset and extract it to a file at a
-fixed resolution with no interpolation or smoothing. Additionally, this
-recipe shows how to insert a dataset into an external HDF5 file using h5py.
-For more information see :class:`covering_grid`.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/extract_fixed_resolution_data.py .
-
-.. code-block:: python
-
- from yt.mods import *
-
- # For this example we will use h5py to write to our output file.
- import h5py
-
- fn = "RedshiftOutput0005" # parameter file to load
- pf = load(fn) # load data
-
- # This is the resolution we will extract at
- DIMS = 128
-
- # Now, we construct an object that describes the data region and structure we
- # want
- cube = pf.h.covering_grid(2, # The level we are willing to extract to; higher
- # levels than this will not contribute to the data!
- # Now we set our spatial extent...
- left_edge=[0.0, 0.0, 0.0],
- right_edge=[1.0, 1.0, 1.0],
- # How many dimensions along each axis
- dims=[DIMS,DIMS,DIMS],
- # And any fields to preload (this is optional!)
- fields=["Density"])
-
- # Now we open our output file using h5py
- # Note that we open with 'w' which will overwrite existing files!
- f = h5py.File("my_data.h5", "w")
-
- # We create a dataset at the root note, calling it density...
- f.create_dataset("/density", data=cube["Density"])
-
- # We close our file
- f.close()
-
-
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/find_clumps.inc
--- a/source/cookbook/find_clumps.inc
+++ /dev/null
@@ -1,63 +0,0 @@
-.. _cookbook-find_clumps:
-
-Find clumps
------------
-
-This is a recipe to show how to find topologicall 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`.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/find_clumps.py .
-
-.. code-block:: python
-
- from yt.mods import * # set up our namespace
-
- fn = "RedshiftOutput0005" # parameter file to load
- field = "Density" # this is the field we look for contours over -- we could do
- # this over anything. Other common choices are 'AveragedDensity'
- # and 'Dark_Matter_Density'.
- step = 10.0 # This is the multiplicative interval between contours.
-
- pf = load(fn) # load data
-
- # We want to find clumps over the entire dataset, so we'll just grab the whole
- # thing! This is a convenience parameter that prepares an object that covers
- # the whole domain. Note, though, that it will load on demand and not before!
- data_source = pf.h.all_data()
-
- # Now we set some sane min/max values between which we want to find contours.
- # This is how we tell the clump finder what to look for -- it won't look for
- # contours connected below or above these threshold values.
- c_min = 10**na.floor(na.log10(data_source[field]).min() )
- c_max = 10**na.floor(na.log10(data_source[field]).max()+1)
-
- # Now find get our 'base' clump -- this one just covers the whole domain.
- master_clump = amods.level_sets.Clump(data_source, None, field)
-
- # This next command accepts our base clump and we say the range between which
- # we want to contour. It recursively finds clumps within the master clump, at
- # intervals defined by the step size we feed it. The current value is
- # *multiplied* by step size, rather than added to it -- so this means if you
- # want to look in log10 space intervals, you would supply step = 10.0.
- amods.level_sets.find_clumps(master_clump, c_min, c_max, step)
-
- # As it goes, it appends the information about all the sub-clumps to the
- # master-clump. Among different ways we can examine it, there's a convenience
- # function for outputting the full hierarchy to a file.
- f = open('%s_clump_hierarchy.txt' % pf,'w')
- amods.level_sets.write_clump_hierarchy(master_clump,0,f)
- f.close()
-
- # We can also output some handy information, as well.
- f = open('%s_clumps.txt' % pf,'w')
- amods.level_sets.write_clumps(master_clump,0,f)
- f.close()
- # If you'd like to visualize these clumps, a list of clumps can be supplied to
- # the "clumps" callback on a plot.
-
-
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/global_phase_plots.inc
--- a/source/cookbook/global_phase_plots.inc
+++ /dev/null
@@ -1,50 +0,0 @@
-.. _cookbook-global_phase_plots:
-
-Global phase plots
-------------------
-
-This is a simple recipe to show how to open a dataset and then plot a couple
-phase diagrams, save them, and quit. Note that this recipe will take advantage
-of multiple CPUs if executed with mpirun and supplied the --parallel command
-line argument. For more information, see :ref:`methods-profiles`.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/global_phase_plots.py .
-
-.. code-block:: python
-
- from yt.mods import * # set up our namespace
-
- fn = "RedshiftOutput0005" # parameter file to load
-
- pf = load(fn) # load data
- dd = pf.h.all_data() # This is an object that describes the entire box
- pc = PlotCollection(pf) # defaults to center at most dense point
-
- # We plot the average x-velocity (mass-weighted) in our object as a function of
- # Density and Temperature
- plot=pc.add_phase_object(dd, ["Density","Temperature","x-velocity"],
- lazy_reader = True)
-
- # We now plot the average value of x-velocity as a function of temperature
- plot=pc.add_profile_object(dd, ["Temperature", "x-velocity"],
- lazy_reader = True)
-
- # Finally, the velocity magnitude as a function of density
- plot=pc.add_profile_object(dd, ["Density", "VelocityMagnitude"],
- lazy_reader = True)
- pc.save() # save all plots
-
-
-.. rubric:: Sample Output
-
-.. image:: _global_phase_plots/global_phase_plots_RedshiftOutput0005_Profile1D_1_Temperature_x-velocity.png
- :width: 240
- :target: ../_images/global_phase_plots_RedshiftOutput0005_Profile1D_1_Temperature_x-velocity.png
-.. image:: _global_phase_plots/global_phase_plots_RedshiftOutput0005_Profile1D_2_Density_VelocityMagnitude.png
- :width: 240
- :target: ../_images/global_phase_plots_RedshiftOutput0005_Profile1D_2_Density_VelocityMagnitude.png
-.. image:: _global_phase_plots/global_phase_plots_RedshiftOutput0005_Profile2D_0_Density_Temperature_x-velocity.png
- :width: 240
- :target: ../_images/global_phase_plots_RedshiftOutput0005_Profile2D_0_Density_Temperature_x-velocity.png
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/halo_finding.inc
--- a/source/cookbook/halo_finding.inc
+++ /dev/null
@@ -1,29 +0,0 @@
-.. _cookbook-halo_finding:
-
-Halo finding
-------------
-
-This script shows the simplest way of getting halo information. For more
-information, see :ref:`halo_finding`.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/halo_finding.py .
-
-.. code-block:: python
-
- from yt.mods import * # set up our namespace
-
- fn = "RedshiftOutput0005" # parameter file to load
-
- pf = load(fn) # load data
- halos = HaloFinder(pf)
- halos.write_out("%s_halos.txt" % pf)
-
-
-.. rubric:: Sample Output
-
-
-``RedshiftOutput0005_halos.txt``
-
-.. literalinclude:: _halo_finding/halo_finding_RedshiftOutput0005_halos.txt
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/halo_mass_info.inc
--- a/source/cookbook/halo_mass_info.inc
+++ /dev/null
@@ -1,50 +0,0 @@
-.. _cookbook-halo_mass_info:
-
-Halo mass info
---------------
-
-This recipe finds halos and then prints out information about them. Note that
-this recipe will take advantage of multiple CPUs if executed with mpirun and
-supplied the --parallel command line argument. For more information, see
-:ref:`halo_finding`.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/halo_mass_info.py .
-
-.. code-block:: python
-
- from yt.mods import *
-
- fn = "RedshiftOutput0005" # parameter file to load
- pf = load(fn) # load data
-
- # First we run our halo finder to identify all the halos in the dataset. This
- # can take arguments, but the default are pretty sane.
- halos = HaloFinder(pf)
-
- f = open("%s_halo_info.txt" % pf, "w")
-
- # Now, for every halo, we get the baryon data and examine it.
- for halo in halos:
- # The halo has a property called 'get_sphere' that obtains a sphere
- # centered on the point of maximum density (or the center of mass, if that
- # argument is supplied) and with the radius the maximum particle radius of
- # that halo.
- sphere = halo.get_sphere()
- # We use the quantities[] method to get the total mass in baryons and in
- # particles.
- baryon_mass, particle_mass = sphere.quantities["TotalQuantity"](
- ["CellMassMsun", "ParticleMassMsun"], lazy_reader=True)
- # Now we print out this information, along with the ID.
- f.write("Total mass in HOP group %s is %0.5e (gas = %0.5e / particles = %0.5e)\n" % \
- (halo.id, baryon_mass + particle_mass, baryon_mass, particle_mass))
- f.close()
-
-
-.. rubric:: Sample Output
-
-
-``RedshiftOutput0005_halo_info.txt``
-
-.. literalinclude:: _halo_mass_info/halo_mass_info_RedshiftOutput0005_halo_info.txt
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/halo_particle_plotting.inc
--- a/source/cookbook/halo_particle_plotting.inc
+++ /dev/null
@@ -1,38 +0,0 @@
-.. _cookbook-halo_particle_plotting:
-
-Halo particle plotting
-----------------------
-
-This is a simple mechanism for overplotting the particles belonging only to
-halos. For more information, see :ref:`halo_finding`.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/halo_particle_plotting.py .
-
-.. code-block:: python
-
- from yt.mods import * # set up our namespace
-
- fn = "RedshiftOutput0005" # parameter file to load
-
- pf = load(fn) # load data
- halos = HaloFinder(pf)
-
- pc = PlotCollection(pf, [0.5, 0.5, 0.5])
- p = pc.add_projection("Density", 0)
- p.modify["hop_circles"](halos) # We like the circles for framing
-
- # Only plot the first 100 halos. Also, by default the particles are
- # semi-transparent, but the alpha parameter can be overriden to make them
- # darker.
- p.modify["hop_particles"](halos, max_number=100)
-
- pc.save()
-
-
-.. rubric:: Sample Output
-
-.. image:: _halo_particle_plotting/halo_particle_plotting_RedshiftOutput0005_Projection_x_Density.png
- :width: 240
- :target: ../_images/halo_particle_plotting_RedshiftOutput0005_Projection_x_Density.png
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/halo_plotting.inc
--- a/source/cookbook/halo_plotting.inc
+++ /dev/null
@@ -1,33 +0,0 @@
-.. _cookbook-halo_plotting:
-
-Halo plotting
--------------
-
-This is a mechanism for plotting circles representing identified particle halos
-on an image. For more information, see :ref:`halo_finding`.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/halo_plotting.py .
-
-.. code-block:: python
-
- from yt.mods import * # set up our namespace
-
- fn = "RedshiftOutput0005" # parameter file to load
-
- pf = load(fn) # load data
- halos = HaloFinder(pf)
-
- pc = PlotCollection(pf, [0.5, 0.5, 0.5])
- p = pc.add_projection("Density", 0)
- p.modify["hop_circles"](halos)
-
- pc.save()
-
-
-.. rubric:: Sample Output
-
-.. image:: _halo_plotting/halo_plotting_RedshiftOutput0005_Projection_x_Density.png
- :width: 240
- :target: ../_images/halo_plotting_RedshiftOutput0005_Projection_x_Density.png
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/index.rst
--- a/source/cookbook/index.rst
+++ b/source/cookbook/index.rst
@@ -1,7 +1,7 @@
.. _cookbook:
-Cookbook
-========
+Example Scripts
+===============
yt scripts can be a bit intimidating, and at times a bit obtuse. But there's a
@@ -20,40 +20,4 @@
:local:
:backlinks: none
-.. include:: simple_slice.inc
-.. include:: simple_projection.inc
-.. include:: aligned_cutting_plane.inc
-.. include:: sum_mass_in_sphere.inc
-.. include:: simple_phase.inc
-.. include:: simple_profile.inc
-.. include:: simple_radial_profile.inc
-.. include:: halo_finding.inc
-.. include:: halo_plotting.inc
-.. include:: halo_particle_plotting.inc
-.. include:: arbitrary_vectors_on_slice.inc
-.. include:: contours_on_slice.inc
-.. include:: velocity_vectors_on_slice.inc
-.. include:: average_value.inc
-.. include:: find_clumps.inc
-.. include:: boolean_data_objects.inc
-.. include:: global_phase_plots.inc
-.. include:: halo_mass_info.inc
-.. include:: multi_width_save.inc
-.. include:: zoomin_frames.inc
-.. include:: overplot_particles.inc
-.. include:: multi_plot.inc
-.. include:: multi_plot_3x2.inc
-.. include:: multi_plot_3x2_FRB.inc
-.. include:: time_series_phase.inc
-.. include:: time_series_quantity.inc
-.. include:: extract_fixed_resolution_data.inc
-.. include:: run_halo_profiler.inc
-.. include:: simulation_halo_profiler.inc
-.. include:: make_light_cone.inc
-.. include:: unique_light_cones.inc
-.. include:: light_cone_halo_mask.inc
-.. include:: make_light_ray.inc
-.. include:: simple_volume_rendering.inc
-.. include:: camera_movement.inc
-.. include:: offaxis_projection.inc
-.. include:: offaxis_projection_colorbar.inc
+
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/light_cone_halo_mask.inc
--- a/source/cookbook/light_cone_halo_mask.inc
+++ /dev/null
@@ -1,80 +0,0 @@
-.. _cookbook-light_cone_halo_mask:
-
-Light cone halo mask
---------------------
-
-The following recipe uses the HaloProfiler to locate halos of at least
-10 :superscript:`14` solar masses in the sampled volume and create a
-boolean mask to cover them up with circles of radii given by the virial
-radius of each halo. A text file is written out detailing the x and y
-positions in the light cone projection of all the halos in the mask, their
-redshifts, virial radii, and virial masses.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/light_cone_halo_mask.py .
-
-.. code-block:: python
-
-
- from yt.mods import *
-
- # Instantiate a light cone object as usual.
- lc = amods.light_cone.LightCone(
- "128Mpc256grid_SFFB.param", initial_redshift=0.4,
- final_redshift=0.0, observer_redshift=0.0,
- field_of_view_in_arcminutes=600.0,
- image_resolution_in_arcseconds=60.0,
- use_minimum_datasets=True, deltaz_min=0.0,
- minimum_coherent_box_fraction=0.0,
- output_dir='LC', output_prefix='LightCone')
-
- # Calculate the light cone solution.
- lc.calculate_light_cone_solution(seed=123456789, filename='lightcone.dat')
-
- # The list of halos to be masked out will come from the HaloProfiler.
- # Keyword arguments to be given to the halo profiler can be specified
- # in the form of a dictionary.
- halo_profiler_kwargs = {'halo_list_file': 'HopAnalysis.out'}
-
- # Any actions the HaloProfiler is to perform are given in a list.
- halo_profiler_actions = []
-
- # Each list item contains a dictionary with entries for the function to
- # be called ("function"), the arguments of the function ("args"), and the
- # keyword arguments of the function ("kwargs").
- # This item will add a virial filter.
- halo_profiler_actions.append({'function': amods.halo_profiler.HaloProfiler.add_halo_filter,
- 'args': [amods.halo_profiler.VirialFilter],
- 'kwargs': {'must_be_virialized':True,
- 'overdensity_field':'ActualOverdensity',
- 'virial_overdensity':200,
- 'virial_filters':[['TotalMassMsun','>','1e14']],
- 'virial_quantities':['TotalMassMsun','RadiusMpc']}})
-
- # This item will call the make_profile method to get the filtered halo list.
- halo_profiler_actions.append({'function': amods.halo_profiler.HaloProfiler.make_profiles,
- 'kwargs': {'filename': "virial_filter.out"}})
-
- # Specify the desired halo list is the filtered list.
- # If 'all' is given instead, the full list will be used.
- halo_list = 'filtered'
-
- # Get the halo list for the active solution of this light cone using
- # the HaloProfiler settings set up above.
- # Write the boolean map to an hdf5 file called 'halo_mask.h5'.
- # Write a text file detailing the location, redshift, radius, and mass
- # of each halo in light cone projection.
- lc.get_halo_mask(mask_file='halo_mask.h5', map_file='halo_map.out',
- halo_profiler_kwargs=halo_profiler_kwargs,
- halo_profiler_actions=halo_profiler_actions,
- halo_list=halo_list)
-
- # This will be the field to be projected.
- field = 'SZY'
-
- # Make the light cone projection and apply the halo mask.
- pc = lc.project_light_cone(field, save_stack=True, save_slice_images=True,
- add_redshift_label=True, apply_halo_mask=True)
-
-
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/make_light_cone.inc
--- a/source/cookbook/make_light_cone.inc
+++ /dev/null
@@ -1,38 +0,0 @@
-.. _cookbook-make_light_cone:
-
-Make light cone
----------------
-
-The following recipe will make a light cone projection (see :ref:`light-cone-generator`)
-of a single quantity over the redshift interval 0 to 0.4.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/make_light_cone.py .
-
-.. code-block:: python
-
- from yt.mods import *
- from yt.analysis_modules.light_cone.api import *
-
- # All of the light cone parameters are given as keyword arguments at instantiation.
- lc = LightCone("128Mpc256grid_SFFB.param", initial_redshift=0.4,
- final_redshift=0.0, observer_redshift=0.0,
- field_of_view_in_arcminutes=450.0,
- image_resolution_in_arcseconds=60.0,
- use_minimum_datasets=True, deltaz_min=0.0,
- minimum_coherent_box_fraction=0.0,
- output_dir='LC', output_prefix='LightCone')
-
- # Calculate a light cone solution and write out a text file with the details
- # of the solution.
- lc.calculate_light_cone_solution(seed=123456789, filename='lightcone.dat')
-
- # This will be the field to be projected.
- field = 'SZY'
-
- # Make the light cone projection, save individual images of each slice
- # and of the projection as well as an hdf5 file with the full data cube.
- lc.project_light_cone(field ,save_stack=True, save_slice_images=True)
-
-
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/make_light_ray.inc
--- a/source/cookbook/make_light_ray.inc
+++ /dev/null
@@ -1,71 +0,0 @@
-.. _cookbook-make_light_ray:
-
-Make light ray
---------------
-
-This is a recipe to make a light ray through a simulation.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/make_light_ray.py .
-
-.. code-block:: python
-
- import os
- import sys
-
- from yt.mods import *
- from yt.analysis_modules.halo_profiler.api import *
- from yt.analysis_modules.light_ray.api import *
-
- # Get the simulation parameter file from the command line.
- par_file = sys.argv[1]
-
- # Instantiate a ray object from z = 0 to z = 0.1 using the
- # minimum number of datasets.
- lr = LightRay(par_file, 0.0, 0.1, use_minimum_datasets=True)
-
- # The next four variables are used when get_nearest_galaxy is set to True.
- # This option will calculate the distance and mass of the halo nearest to
- # each element of the ray.
- # The light ray tool accomplishes this by using the HaloProfiler.
- # Here we are providing the LightRay with instructions to give the HaloProfiler.
- # This is a dictionary of standard halo profiler keyword arguments and values.
- halo_profiler_kwargs = {'halo_list_format': {'id':0, 'center':[4, 5, 6],
- 'TotalMassMsun':1},
- 'halo_list_file': 'HopAnalysis.out'}
- # This is a list of actions we want the HaloProfiler to perform.
- # Note that each list item is a dictionary with the following three
- # entries: 'function', 'args', and 'kwargs'.
- # These are the function to be called, the arguments to that function, and
- # any keyword arguments.
- halo_profiler_actions = [{'function': make_profiles,
- 'args': None,
- 'kwargs': {'filename': 'VirializedHalos.out'}},
- {'function': add_halo_filter,
- 'args': VirialFilter,
- 'kwargs': {'overdensity_field': 'ActualOverdensity',
- 'virial_overdensity': 200,
- 'virial_filters': [['TotalMassMsun','>=','1e14']],
- 'virial_quantities': ['TotalMassMsun','RadiusMpc']}}]
- # This option can only be 'all' or 'filtered' and tells the HaloProfiler to
- # use either the full halo list or the filtered list made after calling make_profiles.
- halo_list = 'filtered'
-
- # This is the name of the field from the halo list that represents the halo mass.
- halo_mass_field = 'TotalMassMsun_200'
-
- # Make the ray and get the Density and Temperature fields, the nearest galaxy information, and
- # the line of sight velocity.
- lr.make_light_ray(seed=8675309,
- solution_filename='lightraysolution.txt',
- data_filename='lightray.h5',
- fields=['Temperature', 'Density'],
- get_nearest_galaxy=True,
- halo_profiler_kwargs=halo_profiler_kwargs,
- halo_profiler_actions=halo_profiler_actions,
- halo_list=halo_list,
- halo_mass_field=halo_mass_field,
- get_los_velocity=True)
-
-
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/multi_plot.inc
--- a/source/cookbook/multi_plot.inc
+++ /dev/null
@@ -1,70 +0,0 @@
-.. _cookbook-multi_plot:
-
-Multi plot
-----------
-
-This is a simple recipe to show how to open a dataset and then plot a slice
-through it, centered at its most dense point. For more information, see
-:func:`~yt.visualization.plot_collection.get_multi_plot`.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/multi_plot.py .
-
-.. code-block:: python
-
- from yt.mods import * # set up our namespace
- import matplotlib.colorbar as cb
-
- fn = "RedshiftOutput0005" # parameter file to load
- orient = 'horizontal'
-
- pf = load(fn) # load data
-
- # There's a lot in here:
- # From this we get a containing figure, a list-of-lists of axes into which we
- # can place plots, and some axes that we'll put colorbars.
- # We feed it:
- # Number of plots on the x-axis, number of plots on the y-axis, and how we
- # want our colorbars oriented. (This governs where they will go, too.
- # bw is the base-width in inches, but 4 is about right for most cases.
- fig, axes, colorbars = get_multi_plot( 2, 1, colorbar=orient, bw = 4)
-
- # We'll use a plot collection, just for convenience's sake
- pc = PlotCollection(pf, center=[0.5, 0.5, 0.5])
-
- # Now we add a slice and set the colormap of that slice, but note that we're
- # feeding it an axes -- the zeroth row, the zeroth column, and telling the plot
- # "Don't make a colorbar." We'll make one ourselves.
- p = pc.add_slice("Density", 0, figure = fig, axes = axes[0][0], use_colorbar=False)
- p.set_cmap("bds_highcontrast") # this is our colormap
-
- # We do this again, but this time we take the 1-index column.
- p = pc.add_slice("Temperature", 0, figure=fig, axes=axes[0][1], use_colorbar=False)
- p.set_cmap("hot") # a different colormap
-
- pc.set_width(5.0, 'mpc') # change width of both plots
-
- # 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.
- # zip means, give these two me together.
- for p, cax in zip(pc.plots, colorbars):
- # Now we make a colorbar, using the 'image' attribute of the plot.
- # 'image' is usually not accessed; we're making a special exception here,
- # though. 'image' will tell the colorbar what the limits of the data are.
- cbar = cb.Colorbar(cax, p.image, orientation=orient)
- # Now, we have to do a tiny bit of magic -- we tell the plot what its
- # colorbar is, and then we tell the plot to set the label of that colorbar.
- p.colorbar = cbar
- p._autoset_label()
-
- # And now we're done! Note that we're calling a method of the figure, not the
- # PlotCollection.
- fig.savefig("%s" % pf)
-
-
-.. rubric:: Sample Output
-
-.. image:: _multi_plot/multi_plot_RedshiftOutput0005.png
- :width: 240
- :target: ../_images/multi_plot_RedshiftOutput0005.png
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/multi_plot_3x2.inc
--- a/source/cookbook/multi_plot_3x2.inc
+++ /dev/null
@@ -1,74 +0,0 @@
-.. _cookbook-multi_plot_3x2:
-
-Multi plot 3x2
---------------
-
-This is a simple recipe to show how to open a dataset and then plot a slice
-through it, centered at its most dense point. For more information, see
-:func:`~yt.visualization.plot_collection.get_multi_plot`.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/multi_plot_3x2.py .
-
-.. code-block:: python
-
- from yt.mods import * # set up our namespace
- import matplotlib.colorbar as cb
-
- fn = "RedshiftOutput0005" # parameter file to load
- orient = 'horizontal'
-
- pf = load(fn) # load data
-
- # There's a lot in here:
- # From this we get a containing figure, a list-of-lists of axes into which we
- # can place plots, and some axes that we'll put colorbars.
- # We feed it:
- # Number of plots on the x-axis, number of plots on the y-axis, and how we
- # want our colorbars oriented. (This governs where they will go, too.
- # bw is the base-width in inches, but 4 is about right for most cases.
- fig, axes, colorbars = get_multi_plot( 2, 3, colorbar=orient, bw = 4)
-
- # We'll use a plot collection, just for convenience's sake
- pc = PlotCollection(pf, center=[0.5, 0.5, 0.5])
-
- # Now we follow the method of "multi_plot.py" but we're going to iterate
- # over the columns, which will become axes of slicing.
- for ax in range(3):
- p = pc.add_slice("Density", ax, figure = fig, axes = axes[ax][0],
- use_colorbar=False)
- p.set_cmap("bds_highcontrast") # this is our colormap
- p.set_zlim(5e-32, 1e-29)
- # 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
-
- pc.set_width(5.0, 'mpc') # change width of both plots
-
- # 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.
- # zip means, give these two me together. Note that it cuts off after the
- # shortest iterator is exhausted, in this case pc.plots.
- for p, cax in zip(pc.plots, colorbars):
- # Now we make a colorbar, using the 'image' attribute of the plot.
- # 'image' is usually not accessed; we're making a special exception here,
- # though. 'image' will tell the colorbar what the limits of the data are.
- cbar = cb.Colorbar(cax, p.image, orientation=orient)
- # Now, we have to do a tiny bit of magic -- we tell the plot what its
- # colorbar is, and then we tell the plot to set the label of that colorbar.
- p.colorbar = cbar
- p._autoset_label()
-
- # And now we're done! Note that we're calling a method of the figure, not the
- # PlotCollection.
- fig.savefig("%s_3x2" % pf)
-
-
-.. rubric:: Sample Output
-
-.. image:: _multi_plot_3x2/multi_plot_3x2_RedshiftOutput0005_3x2.png
- :width: 240
- :target: ../_images/multi_plot_3x2_RedshiftOutput0005_3x2.png
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/offaxis_projection.inc
--- a/source/cookbook/offaxis_projection.inc
+++ /dev/null
@@ -1,59 +0,0 @@
-.. _cookbook-offaxis_projection:
-
-Offaxis projection
-------------------
-
-This recipe shows how to make a projection of a dataset from an arbitrary
-projection angle (so you are not confined to the x, y, and z axes).
-See :ref:`volume_rendering` for more information.
-
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/offaxis_projection.py .
-
-.. code-block:: python
-
- from yt.mods import * # set up our namespace
-
- fn = "RedshiftOutput0005" # parameter file to load
-
- pf = load(fn) # load data
-
- # Now we need a center of our volume to render. Here we'll just use
- # 0.5,0.5,0.5, because volume renderings are not periodic.
- c = [0.5, 0.5, 0.5]
-
- # Our image plane will be normal to some vector. For things like collapsing
- # objects, you could set it the way you would a cutting plane -- but for this
- # dataset, we'll just choose an off-axis value at random. This gets normalized
- # automatically.
- L = [0.5, 0.2, 0.7]
-
- # Our "width" is the width of the image plane as well as the depth -- so we set
- # it to be 0.8 so we get almost the whole domain. Note that corners may be
- # visible in the output image!
- W = 0.8
-
- # Now we decide how big an image we want. 512x512 should be sufficient.
- N = 512
-
- # Now we call the off_axis_projection function, which handles the rest.
- # Note that we set no_ghost equal to False, so that we *do* include ghost
- # zones in our data. This takes longer to calculate, but the results look
- # much cleaner than when you ignore the ghost zones.
- # Also note that we set the field which we want to project as "Density", but
- # really we could use any arbitrary field like "Temperature", "Metallicity"
- # or whatever.
- image = off_axis_projection(pf, c, L, W, N, "Density", no_ghost=False)
-
- # Image is now an NxN array representing the intensities of the various pixels.
- # And now, we call our direct image saver. We save the log of the result.
- write_image(na.log10(image), "%s_offaxis_projection.png" % pf)
-
-
-.. rubric:: Sample Output
-
-.. image:: _offaxis_projection/offaxis_projection_RedshiftOutput0005_offaxis_projection.png
- :width: 240
- :target: ../_images/offaxis_projection_RedshiftOutput0005_offaxis_projection.png
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/run_halo_profiler.inc
--- a/source/cookbook/run_halo_profiler.inc
+++ /dev/null
@@ -1,49 +0,0 @@
-.. _cookbook-run_halo_profiler:
-
-Run halo profiler
------------------
-
-This is a recipe for making radial profiles and projections of all of the halos
-within a cosmological simulation. See :ref:`halo_profiling` for full documentation
-of the HaloProfiler.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/run_halo_profiler.py .
-
-.. code-block:: python
-
- from yt.mods import *
-
- # Instantiate HaloProfiler for this dataset.
- hp = amods.halo_profiler.HaloProfiler("DD0242/DD0242")
-
- # Add a filter to remove halos that have no profile points with overdensity
- # above 200, and with virial masses less than 1e14 solar masses.
- # Also, return the virial mass and radius to be written out to a file.
- hp.add_halo_filter(amods.halo_profiler.VirialFilter,must_be_virialized=True,
- overdensity_field='ActualOverdensity',
- virial_overdensity=200,
- virial_filters=[['TotalMassMsun','>=','1e14']],
- virial_quantities=['TotalMassMsun','RadiusMpc'])
-
- # Add profile fields.
- hp.add_profile('CellVolume',weight_field=None,accumulation=True)
- hp.add_profile('TotalMassMsun',weight_field=None,accumulation=True)
- hp.add_profile('Density',weight_field='CellMassMsun',accumulation=False)
- hp.add_profile('Temperature',weight_field='CellMassMsun',accumulation=False)
-
- # Make profiles and output filtered halo list to FilteredQuantities.out.
- hp.make_profiles(filename="FilteredQuantities.out")
-
- # Add projection fields.
- hp.add_projection('Density',weight_field=None)
- hp.add_projection('Temperature',weight_field='Density')
- hp.add_projection('Metallicity',weight_field='Density')
-
- # Make projections for all three axes using the filtered halo list and
- # save data to hdf5 files.
- hp.make_projections(save_cube=True,save_images=True,
- halo_list='filtered',axes=[0,1,2])
-
-
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/simulation_halo_profiler.inc
--- a/source/cookbook/simulation_halo_profiler.inc
+++ /dev/null
@@ -1,52 +0,0 @@
-.. _cookbook-simulation_halo_profiler:
-
-Simulation halo profiler
-------------------------
-
-The following recipe will run the HaloProfiler (see :ref:`halo_profiling`) on
-all the datasets in one simulation between z = 10 and 0.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/simulation_halo_profiler.py .
-
-.. code-block:: python
-
- from yt.mods import *
-
- es = amods.simulation_handler.EnzoSimulation(
- "simulation_parameter_file", initial_redshift=10, final_redshift=0)
-
- # Loop over all dataset in the requested time interval.
- for output in es.allOutputs:
-
- # Instantiate HaloProfiler for this dataset.
- hp = amods.halo_profiler.HaloProfiler(output['filename'])
-
- # Add a virialization filter.
- hp.add_halo_filter(amods.halo_profiler.VirialFilter,must_be_virialized=True,
- overdensity_field='ActualOverdensity',
- virial_overdensity=200,
- virial_filters=[['TotalMassMsun','>=','1e14']],
- virial_quantities=['TotalMassMsun','RadiusMpc'])
-
- # Add profile fields.
- hp.add_profile('CellVolume',weight_field=None,accumulation=True)
- hp.add_profile('TotalMassMsun',weight_field=None,accumulation=True)
- hp.add_profile('Density',weight_field="CellMassMsun",accumulation=False)
- hp.add_profile('Temperature',weight_field='CellMassMsun',accumulation=False)
- # Make profiles and output filtered halo list to FilteredQuantities.out.
- hp.make_profiles(filename="FilteredQuantities.out")
-
- # Add projection fields.
- hp.add_projection('Density',weight_field=None)
- hp.add_projection('Temperature',weight_field='Density')
- hp.add_projection('Metallicity',weight_field='Density')
- # Make projections for all three axes using the filtered halo list and
- # save data to hdf5 files.
- hp.make_projections(save_cube=True,save_images=True,
- halo_list='filtered',axes=[0,1,2])
-
- del hp
-
-
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/unique_light_cones.inc
--- a/source/cookbook/unique_light_cones.inc
+++ /dev/null
@@ -1,43 +0,0 @@
-.. _cookbook-unique_light_cones:
-
-Unique light cones
-------------------
-
-The following recipe will create 15 light cone projections that have
-at most 10% volume in common with each other.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/unique_light_cones.py .
-
-.. code-block:: python
-
- from yt.mods import *
-
- # Instantiate a light cone object as usual.
- lc = amods.light_cone.LightCone(
- "128Mpc256grid_SFFB.param", initial_redshift=0.4,
- final_redshift=0.0, observer_redshift=0.0,
- field_of_view_in_arcminutes=120.0,
- image_resolution_in_arcseconds=60.0,
- use_minimum_datasets=True, deltaz_min=0.0,
- minimum_coherent_box_fraction=0.0,
- output_dir='LC', output_prefix='LightCone')
-
- # Try to find 15 solutions that have at most 10% volume in
- # common and give up after 50 consecutive failed attempts.
- # The recycle=True setting tells the code to first attempt
- # to use recycled solutions before trying completely
- # independent solutions.
- LC.find_unique_solutions(lc, max_overlap=0.10, failures=50,
- seed=123456789, recycle=True,
- solutions=15, filename='unique.dat')
-
- # Make light cone projections with each of the random seeds
- # found above. All output files will be written with unique
- # names based on the random seed numbers. All keyword arguments
- # accepted by project_light_cone can be given here as well.
- field = 'SZY'
- LC.project_unique_light_cones(lc, 'unique.dat', field)
-
-
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/velocity_vectors_on_slice.inc
--- a/source/cookbook/velocity_vectors_on_slice.inc
+++ /dev/null
@@ -1,33 +0,0 @@
-.. _cookbook-velocity_vectors_on_slice:
-
-Velocity vectors on slice
--------------------------
-
-This is a simple recipe to show how to open a dataset, plot a slice
-through it, and add velocity vectors on top.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/velocity_vectors_on_slice.py .
-
-.. code-block:: python
-
- from yt.mods import * # set up our namespace
-
- fn = "RedshiftOutput0005" # parameter file to load
-
- pf = load(fn) # load data
- pc = PlotCollection(pf) # defaults to center at most dense point
- p = pc.add_slice("Density", 0) # 0 = x-axis
- p.modify["velocity"]() # This takes a few arguments, but we'll use the defaults
- # here. You can control the 'skip' factor in the
- # vectors.
- pc.set_width(2.5, 'mpc') # change width of all plots in pc
- pc.save(fn) # save all plots
-
-
-.. rubric:: Sample Output
-
-.. image:: _velocity_vectors_on_slice/velocity_vectors_on_slice_RedshiftOutput0005_Slice_x_Density.png
- :width: 240
- :target: ../_images/velocity_vectors_on_slice_RedshiftOutput0005_Slice_x_Density.png
-
-
diff -r 1a260a1dd420ffedb012d488002cf53b265e8b7d -r 6a25bdd92ae58a49fabad3b749c817559626ed98 source/cookbook/zoomin_frames.inc
--- a/source/cookbook/zoomin_frames.inc
+++ /dev/null
@@ -1,66 +0,0 @@
-.. _cookbook-zoomin_frames:
-
-Zoomin frames
--------------
-
-This is a recipe that takes a slice through the most dense point, then creates
-a bunch of frames as it zooms in. It's important to note that this particular
-recipe is provided to show how to be more flexible and add annotations and the
-like -- the base system, of a zoomin, is provided by the ``yt zoomin`` command.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/zoomin_frames.py .
-
-.. code-block:: python
-
- from yt.mods import * # set up our namespace
-
- fn = "RedshiftOutput0005" # parameter file to load
- n_frames = 5 # This is the number of frames to make -- below, you can see how
- # this is used.
- min_dx = 40 # This is the minimum size in smallest_dx of our last frame.
- # Usually it should be set to something like 400, but for THIS
- # dataset, we actually don't have that great of resolution.
-
- pf = load(fn) # load data
- frame_template = "frame_%05i" # Template for frame filenames
-
- pc = PlotCollection(pf, center=[0.5, 0.5, 0.5]) # We make a plot collection that defaults to being
- # centered at the most dense point.
- p = pc.add_slice("Density", 2) # Add our slice, along z
- p.modify["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!
-
- # 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
- # something like "i = 0" and then inside the loop "i += 1" for ever loop. The
- # argument to enumerate is the 'logspace' function, which takes a minimum and a
- # maximum and the number of items to generate. It returns 10^power of each
- # item it generates.
- for i,v in enumerate(na.logspace(
- 0, na.log10(pf.h.get_smallest_dx()*min_dx), n_frames)):
- # We set our width as necessary for this frame ...
- pc.set_width(v,'1')
- # ... and we save!
- pc.save(frame_template % (i))
-
-
-.. rubric:: Sample Output
-
-.. image:: _zoomin_frames/zoomin_frames_frame_00000_Slice_z_Density.png
- :width: 240
- :target: ../_images/zoomin_frames_frame_00000_Slice_z_Density.png
-.. image:: _zoomin_frames/zoomin_frames_frame_00001_Slice_z_Density.png
- :width: 240
- :target: ../_images/zoomin_frames_frame_00001_Slice_z_Density.png
-.. image:: _zoomin_frames/zoomin_frames_frame_00002_Slice_z_Density.png
- :width: 240
- :target: ../_images/zoomin_frames_frame_00002_Slice_z_Density.png
-.. image:: _zoomin_frames/zoomin_frames_frame_00003_Slice_z_Density.png
- :width: 240
- :target: ../_images/zoomin_frames_frame_00003_Slice_z_Density.png
-.. image:: _zoomin_frames/zoomin_frames_frame_00004_Slice_z_Density.png
- :width: 240
- :target: ../_images/zoomin_frames_frame_00004_Slice_z_Density.png
-
-
https://bitbucket.org/yt_analysis/yt-doc/changeset/df8f33041942/
changeset: df8f33041942
user: MatthewTurk
date: 2012-07-07 00:35:18
summary: * Starting to re-organize the simple scripts
* Changing to using way more complex data than RD0005
* Going back to the old template for autosummary
Still to do: adding comments and including images & whatnot.
affected #: 19 files
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 helper_scripts/run_recipes.sh
--- /dev/null
+++ b/helper_scripts/run_recipes.sh
@@ -0,0 +1,16 @@
+ROOT=`pwd`
+
+for s in source/cookbook/simple_*.py
+do
+ sb=`basename ${s}`
+ cd ${ROOT}/_temp/
+ echo ${sb}.done
+ [ -e ${sb}.done ] && continue
+ echo ${sb}
+ python2.7 ${ROOT}/${s} || exit
+ for o in *.png *.txt
+ do
+ mv -v ${o} ${ROOT}/source/cookbook/_static/${sb%%.py}_${o}
+ done
+ touch ${sb}.done
+done
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/_templates/autosummary/class.rst
--- a/source/_templates/autosummary/class.rst
+++ b/source/_templates/autosummary/class.rst
@@ -1,34 +1,21 @@
{% extends "!autosummary/class.rst" %}
-{{ fullname }}
-{{ underline }}
-
-.. currentmodule:: {{ module }}
-
-.. autoclass:: {{ objname }}
- :noindex:
-
- {% block methods %}
- .. automethod:: __init__
- :noindex:
-
- {% if methods %}
- .. rubric:: Methods
-
+{% block methods %}
+{% if methods %}
.. autosummary::
+ :toctree:
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
- {% endif %}
- {% endblock %}
+{% endif %}
+{% endblock %}
- {% block attributes %}
- {% if attributes %}
- .. rubric:: Attributes
-
+{% block attributes %}
+{% if attributes %}
.. autosummary::
+ :toctree:
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
- {% endif %}
- {% endblock %}
+{% endif %}
+{% endblock %}
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/advanced/creating_frontend.rst
--- a/source/advanced/creating_frontend.rst
+++ b/source/advanced/creating_frontend.rst
@@ -80,7 +80,7 @@
must be an array of grid objects that already know their IDs.
* ``_populate_grid_objects``: this initializes the grids by calling
``_prepare_grid`` and ``_setup_dx`` on all of them. Additionally, it should
- set up ``Children`` and ``Parent`` lists on each grid object.
+ set up ``Children`` and ``Parent`` lists on each grid object.
* ``_setup_unknown_fields``: If a field is in the data file that yt doesn't
already know, this is where you make a guess at it.
* ``_setup_derived_fields``: ``self.derived_field_list`` needs to be made a
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/api.rst
--- a/source/api.rst
+++ b/source/api.rst
@@ -1,8 +1,6 @@
Plots and the Plotting Interface
================================
-.. py:module:: yt.visualization
-
.. autosummary::
:toctree: generated/
@@ -20,8 +18,6 @@
Data Sources
============
-.. py:module:: yt.data_objects
-
.. _physical-object-api:
Physical Objects
@@ -78,7 +74,6 @@
Enzo
++++
-.. py:module:: yt.frontends.enzo
.. autosummary::
:toctree: generated/
@@ -90,7 +85,6 @@
Orion
+++++
-.. py:module:: yt.frontends.orion
.. autosummary::
:toctree: generated/
@@ -102,7 +96,6 @@
FLASH
+++++
-.. py:module:: yt.frontends.flash
.. autosummary::
:toctree: generated/
@@ -114,7 +107,6 @@
Chombo
++++++
-.. py:module:: yt.frontends.chombo
.. autosummary::
:toctree: generated/
@@ -126,7 +118,6 @@
RAMSES
++++++
-.. py:module:: yt.frontends.ramses
.. autosummary::
:toctree: generated/
@@ -145,7 +136,6 @@
average. Typically they are more easily used through the
`yt.visualization.plot_collection` interface.
-.. py:module:: yt.data_objects
.. autosummary::
:toctree: generated/
@@ -159,7 +149,6 @@
Halo finding can be executed using these types.
-.. py:module:: yt.analysis_modules.halo_finding
.. autosummary::
:toctree: generated/
@@ -176,7 +165,6 @@
operations acting on two spatially-distinct points in a data source. See also
:ref:`two_point_functions`.
-.. py:module:: yt.analysis_modules.two_point_functions
.. autosummary::
:toctree: generated/
@@ -187,7 +175,6 @@
Field Types
===========
-.. py:module:: yt.data_objects
.. autosummary::
:toctree: generated/
@@ -206,7 +193,6 @@
Coordinate Transformations
--------------------------
-.. py:module:: yt.analysis_modules.coordinate_transformation
.. autosummary::
:toctree: generated/
@@ -219,7 +205,6 @@
For the generation of stellar SEDs. (See also :ref:`star_analysis`.)
-.. py:module:: yt.analysis_modules.star_analysis
.. autosummary::
:toctree: generated/
@@ -230,7 +215,6 @@
Light cone generation and simulation analysis. (See also
:ref:`light-cone-generator`.)
-.. py:module:: yt.analysis_modules.light_cone
.. autosummary::
:toctree: generated/
@@ -242,7 +226,6 @@
See also :ref:`volume_rendering`.
-.. py:module:: yt.visualization.volume_rendering
.. autosummary::
:toctree: generated/
@@ -267,7 +250,6 @@
See also :ref:`streamlines`.
-.. py:module:: yt.visualization.streamlines
.. autosummary::
:toctree: generated/
@@ -281,7 +263,6 @@
without calling matplotlib. This can be very useful for high-cadence outputs
where colorbars are unnecessary or for volume rendering.
-.. py:module:: yt.visualization
.. autosummary::
:toctree: generated/
@@ -313,7 +294,6 @@
See also :ref:`image-panner`.
-.. py:module:: yt.visualization.image_panner
.. autosummary::
:toctree: generated/
@@ -328,7 +308,6 @@
See :ref:`derived-quantities`.
-.. py:module:: yt.data_objects
.. autosummary::
:toctree: generated/
@@ -350,7 +329,6 @@
Callback List
=============
-.. py:module:: yt.visualization
See also :ref:`callbacks`.
@@ -381,10 +359,6 @@
Function List
=============
-.. py:module:: yt.funcs
-.. py:module:: yt.analysis_modules.level_sets
-.. py:module:: yt.utilities
-.. py:module:: yt.utilities.parallel_tools
.. autosummary::
:toctree: generated/
@@ -413,12 +387,6 @@
Miscellaneous Types
===================
-.. py:module:: yt.config
-.. py:module:: yt.analysis_modules.hierarchy_subset
-.. py:module:: yt.analysis_modules.spectral_integrator
-.. py:module:: yt.utilities
-.. py:module:: yt.analysis_modules.level_sets
-.. py:module:: yt.utilities.parallel_tools
.. autosummary::
:toctree: generated/
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/aligned_cutting_plane.py
--- a/source/cookbook/aligned_cutting_plane.py
+++ b/source/cookbook/aligned_cutting_plane.py
@@ -1,7 +1,7 @@
from yt.mods import *
# Load the dataset.
-pf = load("RedshiftOutput0005")
+pf = load("Enzo_64/DD0043/data0043")
# Create a 5 Mpc radius sphere, centered on the max density.
sp = pf.h.sphere("max", (5.0, "mpc"))
@@ -18,7 +18,7 @@
pc.add_cutting_plane("Density", L)
# Change the width of the image.
-pc.set_width(2.5, 'mpc')
+pc.set_width(25, 'mpc')
# Save the image.
# Optionally, give a string as an argument
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/average_value.inc
--- a/source/cookbook/average_value.inc
+++ /dev/null
@@ -1,34 +0,0 @@
-.. _cookbook-average_value:
-
-Average value
--------------
-
-This recipe finds the average value of a quantity through the entire box. (See
-:ref:`derived-quantities`.) Note that this recipe will take advantage of
-multiple CPUs if executed with mpirun and supplied the --parallel command line
-argument.
-
-The latest version of this recipe can be downloaded here: http://hg.yt-project.org/cookbook/raw/tip/recipes/average_value.py .
-
-.. code-block:: python
-
- from yt.mods import *
-
- fn = "RedshiftOutput0005" # parameter file to load
- pf = load(fn) # load data
-
- field = "Temperature" # The field to average
- weight = "CellMassMsun" # The weight for the average
-
- dd = pf.h.all_data() # This is a region describing the entire box,
- # but note it doesn't read anything in yet!
- # We now use our 'quantities' call to get the average quantity
- average_value = dd.quantities["WeightedAverageQuantity"](
- field, weight, lazy_reader=True)
-
- print "Average %s (weighted by %s) is %0.5e" % (field, weight, average_value)
-
-
-
-
-
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/average_value.py
--- /dev/null
+++ b/source/cookbook/average_value.py
@@ -0,0 +1,14 @@
+from yt.mods import *
+
+pf = load("RedshiftOutput0005") # load data
+
+field = "Temperature" # The field to average
+weight = "CellMassMsun" # The weight for the average
+
+dd = pf.h.all_data() # This is a region describing the entire box,
+ # but note it doesn't read anything in yet!
+# We now use our 'quantities' call to get the average quantity
+average_value = dd.quantities["WeightedAverageQuantity"](
+ field, weight, lazy_reader=True)
+
+print "Average %s (weighted by %s) is %0.5e" % (field, weight, average_value)
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/boolean_data_objects.py
--- a/source/cookbook/boolean_data_objects.py
+++ b/source/cookbook/boolean_data_objects.py
@@ -6,9 +6,7 @@
"""
from yt.mods import * # set up our namespace
-fn = "RedshiftOutput0005" # parameter file to load
-
-pf = load(fn) # load data
+pf = load("RedshiftOutput0005") # load data
# Make a few data ojbects to start.
re1 = pf.h.region([0.5, 0.5, 0.5], [0.4, 0.4, 0.4], [0.6, 0.6, 0.6])
re2 = pf.h.region([0.5, 0.5, 0.5], [0.5, 0.5, 0.5], [0.6, 0.6, 0.6])
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/index.rst
--- a/source/cookbook/index.rst
+++ b/source/cookbook/index.rst
@@ -10,14 +10,86 @@
other Python code, into more complicated and advanced tasks.
.. note::
- All of these scripts are located in the mercurial repository at
- http://hg.yt-project.org/cookbook/ . If you want to take a look at more
- complex recipes, or submit your own, check out the `yt Hub
- <http://hub.yt-project.org>`.
+ If you want to take a look at more complex recipes, or submit your own,
+ check out the `yt Hub <http://hub.yt-project.org>`.
.. contents::
:depth: 1
:local:
:backlinks: none
+Making Simple Plots
+-------------------
+Simple Probability Distribution Functions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. literalinclude:: simple_pdf.py
+
+Simple Phase Plots
+~~~~~~~~~~~~~~~~~~
+
+.. literalinclude:: simple_phase.py
+
+Simple 1D Histograms
+~~~~~~~~~~~~~~~~~~~~
+
+.. literalinclude:: simple_profile.py
+
+Simple Projections
+~~~~~~~~~~~~~~~~~~
+
+.. literalinclude:: simple_projection.py
+
+Simple Radial Profiles
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. literalinclude:: simple_radial_profile.py
+
+Simple Slices
+~~~~~~~~~~~~~
+
+.. literalinclude:: simple_slice.py
+
+Simple Volume Rendering
+~~~~~~~~~~~~~~~~~~~~~~~
+
+.. literalinclude:: simple_volume_rendering.py
+
+Off-Axis Slicing
+~~~~~~~~~~~~~~~~
+
+.. literalinclude:: aligned_cutting_plane.py
+
+Calculating Dataset Information
+-------------------------------
+
+.. literalinclude:: average_value.py
+.. literalinclude:: sum_mass_in_sphere.py
+.. literalinclude:: global_phase_plots.py
+
+A Few Complex Plots
+-------------------
+
+.. literalinclude:: offaxis_projection.py
+.. literalinclude:: multi_width_image.py
+.. literalinclude:: overplot_particles.py
+.. literalinclude:: thin_slice_projection.py
+.. literalinclude:: velocity_vectors_on_slice.py
+.. literalinclude:: contours_on_slice.py
+
+Cosmological Analysis
+---------------------
+
+.. literalinclude:: make_light_cone.py
+.. literalinclude:: make_light_ray.py
+.. literalinclude:: halo_finding.py
+.. literalinclude:: halo_particle_plotting.py
+.. literalinclude:: halo_plotting.py
+
+Constructing Data Objects
+-------------------------
+
+.. literalinclude:: find_clumps.py
+.. literalinclude:: boolean_data_objects.py
+
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/simple_pdf.py
--- a/source/cookbook/simple_pdf.py
+++ b/source/cookbook/simple_pdf.py
@@ -1,17 +1,16 @@
from yt.mods import *
# Load the dataset.
-pf = load("RedshiftOutput0005")
+pf = load("GalaxyClusterMerger/fiducial_1to3_b0.273d_hdf5_plt_cnt_0175")
# Create a plot collection for the dataset.
-# With no additional arguments, the center will be
-# the densest point in the box.
-pc = PlotCollection(pf)
+# We center it at the center of the domain.
+pc = PlotCollection(pf, 'c')
-# 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.
-pc.add_phase_sphere(10.0, "mpc",
+# 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",
["Density", "Temperature", "CellMassMsun"],
weight=None,
fractional=True)
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/simple_phase.py
--- a/source/cookbook/simple_phase.py
+++ b/source/cookbook/simple_phase.py
@@ -1,19 +1,19 @@
from yt.mods import *
# Load the dataset.
-pf = load("RedshiftOutput0005")
+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 2D profile within a sphere of radius 10 Mpc
+# Create a 2D profile within a sphere of radius 100 kpc
# of the total mass in bins of density and temperature.
# Setting weight to None will calculate a sum.
# Setting weight to a field will calculate an average
# weighted by that field.
-pc.add_phase_sphere(10.0, "mpc",
+pc.add_phase_sphere(100.0, "kpc",
["Density", "Temperature", "CellMassMsun"],
weight=None)
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/simple_profile.py
--- a/source/cookbook/simple_profile.py
+++ b/source/cookbook/simple_profile.py
@@ -1,16 +1,16 @@
from yt.mods import *
# Load the dataset.
-pf = load("RedshiftOutput0005")
+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 1D profile within a sphere of radius 10 Mpc
+# Create a 1D profile within a sphere of radius 100 kpc
# of the average temperature vs. density, weighted by mass.
-pc.add_profile_sphere(10.0, "mpc",
+pc.add_profile_sphere(100.0, "kpc",
["Density", "Temperature"], weight="CellMassMsun")
# Save the image.
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/simple_projection.py
--- a/source/cookbook/simple_projection.py
+++ b/source/cookbook/simple_projection.py
@@ -1,12 +1,12 @@
from yt.mods import *
# Load the dataset.
-pf = load("RedshiftOutput0005")
+pf = load("GalaxyClusterMerger/fiducial_1to3_b0.273d_hdf5_plt_cnt_0175")
# Create a plot collection for the dataset.
# With no additional arguments, the center will be
# the densest point in the box.
-pc = PlotCollection(pf)
+pc = PlotCollection(pf, 'c')
# Create projections of the density-weighted mean density.
pc.add_projection("Density", "x", weight_field="Density")
@@ -14,7 +14,7 @@
pc.add_projection("Density", "z", weight_field="Density")
# Change the width of the image.
-pc.set_width(1.5, 'mpc')
+pc.set_width(1.0, 'unitary')
# Save the image.
# Optionally, give a string as an argument
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/simple_radial_profile.py
--- a/source/cookbook/simple_radial_profile.py
+++ b/source/cookbook/simple_radial_profile.py
@@ -1,19 +1,18 @@
from yt.mods import *
# Load the dataset.
-pf = load("RedshiftOutput0005")
+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 1D profile within a sphere of radius 10 Mpc
+# Create a 1D profile within a sphere of radius 100 kpc
# of the average density vs. radius, weighted by mass.
-# We will also manually set the radius bounds.
-pc.add_profile_sphere(10.0, "mpc",
- ["RadiusMpc", "Density"], weight="CellMassMsun",
- x_bounds = (1e-3, 10.0))
+# We could also manually set the radius bounds.
+pc.add_profile_sphere(100.0, "kpc",
+ ["RadiusMpc", "Density"], weight="CellMassMsun")
# Save the image.
# Optionally, give a string as an argument
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/simple_slice.py
--- a/source/cookbook/simple_slice.py
+++ b/source/cookbook/simple_slice.py
@@ -1,12 +1,12 @@
from yt.mods import *
# Load the dataset.
-pf = load("RedshiftOutput0005")
+pf = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0150")
# Create a plot collection for the dataset.
# With no additional arguments, the center will be
# the densest point in the box.
-pc = PlotCollection(pf)
+pc = PlotCollection(pf, 'c')
# Create density slices in all three axes.
pc.add_slice("Density", "x")
@@ -14,7 +14,7 @@
pc.add_slice("Density", "z")
# Change the width of the image.
-pc.set_width(1.5, 'mpc')
+pc.set_width(100.0, 'kpc')
# Save the image.
# Optionally, give a string as an argument
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/simple_volume_rendering.py
--- a/source/cookbook/simple_volume_rendering.py
+++ b/source/cookbook/simple_volume_rendering.py
@@ -1,7 +1,7 @@
from yt.mods import *
# Load the dataset.
-pf = load("RedshiftOutput0005")
+pf = load("Enzo_64/DD0043/data0043")
# Create a data container (like a sphere or region) that
# represents the entire domain.
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/time_series_phase.py
--- a/source/cookbook/time_series_phase.py
+++ /dev/null
@@ -1,29 +0,0 @@
-from yt.mods import *
-
-# Loop over a list of autodetected datasets.
-for pf in all_pfs(max_depth=2):
-
- # Create a plot collection at the domain center.
- pc = PlotCollection(pf, "c")
-
- # Create a 2D profile of the total mass in bins of
- # density and temperature.
- # Setting weight to None will calculate a sum.
- # Setting weight to a field will calculate an average
- # weighted by that field.
- # The radius of the sphere is set to be the size of the domain.
- # This will make sure the entire volume is included in the calculation.
- # The first and second arguments are radius and units. '1' means code units.
- # We also manually set the number of bins and the range.
- p = pc.add_phase_sphere(1.0, '1', ["Density", "Temperature", "CellMassMsun"],
- weight=None,
- x_bins=128, x_bounds = (1e-32, 1e-24),
- y_bins=128, y_bounds = (1e2, 1e7))
-
- # Add a title to the image.
- p.modify["title"]("%s (z = %0.2f)" % (pf, pf["CosmologyCurrentRedshift"]))
-
- # Save the image.
- # Optionally, give a string as an argument
- # to name files with a keyword.
- pc.save()
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/time_series_quantity.py
--- a/source/cookbook/time_series_quantity.py
+++ /dev/null
@@ -1,30 +0,0 @@
-from yt.mods import *
-
-# Create lists for the times and values.
-times = []
-values = []
-
-# Loop over a list of autodetected datasets.
-for pf in all_pfs(max_depth=2):
-
- # Get the current time, convert to years from code units
- # Add it to the list.
- times.append(pf["InitialTime"] * pf["years"])
-
- # Create a container representing the entire domain.
- data = pf.h.all_data()
-
- # Use the WeightedAverageQuantity derived quantity to
- # calculate the average temperature, weighted by volume.
- val = data.quantities["WeightedAverageQuantity"](
- "Temperature", "CellVolume")
-
- # Add the value to the list.
- values.append(val)
-
-# Use matplotlib to plot the values.
-import pylab
-pylab.semilogy(times, values, '-x')
-pylab.xlabel(r"$Time [years]$")
-pylab.ylabel(r"$\mathrm{H}^{+}\/\/\mathrm{Fraction}$")
-pylab.savefig("average_HII_fraction.png")
diff -r 6a25bdd92ae58a49fabad3b749c817559626ed98 -r df8f33041942e47073a4bcbf1096e85587417655 source/cookbook/velocity_vectors_on_slice.py
--- a/source/cookbook/velocity_vectors_on_slice.py
+++ b/source/cookbook/velocity_vectors_on_slice.py
@@ -1,7 +1,7 @@
from yt.mods import *
# Load the dataset.
-pf = load(RedshiftOutput0005)
+pf = load("RedshiftOutput0005")
# Create a plot collection for the dataset.
# With no additional arguments, the center will be
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