:mod:`yt.extensions` Extensions API
===================================

.. module:: yt.extensions

There are some functions, routines and classes that utilize the ``yt`` API but
aren't necessarily a part of the core functionality.  These live inside the
``yt/extensions/`` subdirectory and are accessible by direct importation.

:mod:`yt.extensions.coordinate_transforms` Coordinate Transforms
----------------------------------------------------------------

This module allows the user to regrid existing data into an arbitrary
coordinate system.  It comes with the machinery to automatically regrid onto
spherical coordinates.

.. module:: yt.extensions.coordinate_transforms
.. moduleauthor:: Matthew Turk <matthewturk@gmail.com>

.. autofunction:: yt.extensions.coordinate_transforms.spherical_regrid

.. autofunction:: yt.extensions.coordinate_transforms.arbitrary_regrid

.. rubric:: Sample Usage

.. code-block:: python

   from yt.mods import *
   from yt.extensions.coordinate_transforms import *

   pf = load("galaxy1200.dir/galaxy1200")

   nr, ntheta, nphi = 128, 180, 180
   fields = ["Density", "Temperature"]
   center = [0.5, 0.5, 0.5]

   regrid = spherical_regrid(pf, nr, ntheta, nphi, fields, center)

:mod:`yt.extensions.disk_analysis` Disk Analysis
------------------------------------------------

The disk stacker is a mechanism for taking many oblique slices (see
:class:`cutting`) and stacking them together.  The mechanism here is rather
simple -- you feed in a normal angle, a disk height, a width, and it makes many
slices through the domain and adds them all up.  This enables a 'stacked' image
of the disk to be produced.

Once the object has been instantiated, you can access any field as per normal
and it will stack it as requested:


.. module:: yt.extensions.disk_analysis
.. moduleauthor:: Matthew Turk <matthewturk@gmail.com>

.. autoclass:: yt.extensions.disk_analysis.StackedDiskImage
   :members:

.. rubric:: Sample Usage

.. code-block:: python

   from yt.mods import *
   from yt.extensions.disk_analysis import StackedDiskImage

   pf = load("galaxy1200.dir/galaxy1200")
   norm_vec = [0.2, 0.4, 0.1]
   center = [0.8, 0.5, 0.3]
   thickness = 5.0 / pf['kpc']
   width = 100.0 / pf['kpc']
   n_slices = 200
   image_size = (800, 800)

   disk = StackedDiskImage(pf, center, norm_vec,
                           thickness, width, nslices, image_size)
   my_disk_image = disk["Density"]

:mod:`yt.extensions.HaloProfiler` Halo Profiler
-----------------------------------------------

This module allows for systematic analysis and imaging of halos found in a
simulation.

.. module:: yt.extensions.HaloProfiler
.. moduleauthor:: Britton Smith <brittonsmith@gmail.com>

:mod:`yt.extensions.HierarchySubset` Hierarchy Subset
-----------------------------------------------------

This module provides a mechanism for extracted a subset of a hierarchy.
Typically this is used to export data to VTK or Amira format.

.. module:: yt.extensions.HierarchySubset
.. moduleauthor:: Matthew Turk <matthewturk@gmail.com>

.. autoclass:: ConstructedRootGrid
   :members:

.. autoclass:: ExtractedHierarchy
   :members:

:mod:`yt.extensions.SpectralIntegrator` Spectral Integrator
-----------------------------------------------------------

This module provides a mechanism for integrating emissivity output from CLOUDY
and creating integrated X-ray emissivity fields.

.. module:: yt.extensions.SpectralIntegrator
.. moduleauthor:: Matthew Turk <matthewturk@gmail.com>

.. autoclass:: SpectralFrequencyIntegrator
   :members:

.. autofunction:: create_table_from_textfiles

:mod:`yt.extensions.lightcone` Light Cone Generation
----------------------------------------------------

``yt`` has the facility to create light cones, which are stacks of images
generated from a series of simulations.  The code to generate this is in the
module ``lightcone``.

.. module:: yt.extensions.lightcone
.. moduleauthor:: Britton Smith <brittonsmith@gmail.com>
