:mod:`yt.lagos` Physical and Derived Data Objects
=================================================

.. currentmodule:: yt.lagos

:mod:`yt.lagos.BaseDataTypes` Data Containers and Physical Objects
------------------------------------------------------------------

.. module:: yt.lagos.BaseDataTypes

yt provides a number of data containers, defined such that they satisfy a
logical need.  Each of these provides only the finest-resolution cells, unless
an option is available to restrict the levels from which they draw, as is the
case with :class:`~yt.lagos.AMRCoveringGrid`.

Each of these implements the same primary protocol - all data values can be
accessed dictionary-style:

.. code-block:: python

   >>> object["Density"]
   >>> object["Density"].max()

For more information about objects, see :ref:`philo-objects` and
:ref:`using-objects`.

Base Classes
++++++++++++

.. autoclass:: yt.lagos.AMRData
   :members:

.. autoclass:: yt.lagos.AMR1DData
   :members:
   :inherited-members:
   :show-inheritance:

.. autoclass:: yt.lagos.AMR2DData
   :members:
   :inherited-members:
   :show-inheritance:

.. autoclass:: yt.lagos.AMR3DData
   :members:
   :inherited-members:
   :show-inheritance:

.. autoclass:: yt.lagos.FakeGridForParticles
   :members:

.. _data_objects:

1D Data Containers
++++++++++++++++++

Each of these inherits from :class:`~yt.lagos.AMR1DData`, and so has all the
member functions defined there.

.. autoclass:: yt.lagos.AMROrthoRayBase
   :members:
   :show-inheritance:

2D Data Containers
++++++++++++++++++

.. autoclass:: yt.lagos.AMRSliceBase
   :members:
   :show-inheritance:

.. autoclass:: yt.lagos.AMRCuttingPlaneBase
   :members:
   :show-inheritance:

.. autoclass:: yt.lagos.AMRProjBase
   :members:
   :show-inheritance:

3D Data Containers
++++++++++++++++++

.. autoclass:: yt.lagos.AMRSphereBase
   :members:
   :show-inheritance:

.. autoclass:: yt.lagos.AMRRegionBase
   :members:
   :show-inheritance:

.. autoclass:: yt.lagos.AMRCylinderBase
   :members:
   :show-inheritance:

.. autoclass:: yt.lagos.AMRGridCollectionBase
   :members:
   :show-inheritance:

.. autoclass:: yt.lagos.AMRCoveringGridBase
   :members:
   :show-inheritance:

.. autoclass:: yt.lagos.AMRSmoothedCoveringGridBase
   :members:
   :show-inheritance:

.. autoclass:: yt.lagos.ExtractedRegionBase
   :members:
   :show-inheritance:

.. _derived-quantities-api:

:mod:`yt.lagos.DerivedQuantities` Derived Quantities
----------------------------------------------------

All of these are accessed via the ``.quantities[]`` object, and feeding it the
function name without the leading underscore.  For instance:

.. code-block:: python

   my_sphere.quantities["TotalMass"]()

They all accept the ``lazy_reader`` option, which governs whether the
calculation is performed out of core or not.  For more information, see
:ref:`derived-quantities`.

.. module:: yt.lagos.DerivedQuantities

.. autofunction:: yt.lagos.DerivedQuantities._AngularMomentumVector

.. autofunction:: yt.lagos.DerivedQuantities._BaryonSpinParameter

.. autofunction:: yt.lagos.DerivedQuantities._BulkVelocity

.. autofunction:: yt.lagos.DerivedQuantities._CenterOfMass

.. autofunction:: yt.lagos.DerivedQuantities._Extrema

.. autofunction:: yt.lagos.DerivedQuantities._IsBound

.. autofunction:: yt.lagos.DerivedQuantities._MaxLocation

.. autofunction:: yt.lagos.DerivedQuantities._ParticleSpinParameter

.. autofunction:: yt.lagos.DerivedQuantities._TotalMass

.. autofunction:: yt.lagos.DerivedQuantities._TotalQuantity

.. autofunction:: yt.lagos.DerivedQuantities._WeightedAverageQuantity

:mod:`yt.lagos.FieldInfoContainer` Derived Field Objects
--------------------------------------------------------

.. module:: yt.lagos.FieldInfoContainer

.. autoclass:: yt.lagos.FieldInfoContainer
   :members:

.. autoclass:: yt.lagos.EnzoFieldContainer
   :members:

.. autoclass:: yt.lagos.OrionFieldContainer
   :members:

.. autoclass:: yt.lagos.DerivedField
   :members:

.. autoclass:: yt.lagos.ValidateParameter
   :members:

.. autoclass:: yt.lagos.ValidateDataField
   :members:

.. autoclass:: yt.lagos.ValidateProperty
   :members:

.. autoclass:: yt.lagos.ValidateSpatial
   :members:

.. autoclass:: yt.lagos.ValidateGridType
   :members:

:mod:`yt.lagos.Profiles` Profiling
----------------------------------

Profiling in yt is a means of generating arbitrary histograms -- for instance,
phase diagrams, radial profiles, and even more complicated 3D examinations.

.. module:: yt.lagos.Profiles

.. autoclass:: yt.lagos.BinnedProfile1D
   :members:
   :inherited-members:
   :show-inheritance:

.. autoclass:: yt.lagos.BinnedProfile2D
   :members:
   :inherited-members:
   :show-inheritance:

.. autoclass:: yt.lagos.BinnedProfile3D
   :members:
   :inherited-members:
   :show-inheritance:

.. autoclass:: yt.lagos.StoredBinnedProfile3D
   :members:
   :show-inheritance:

:mod:`yt.lagos.ContourFinder` Contour Finding
---------------------------------------------

Typically this is done via the :meth:`extract_connected_sets` on a data object.
However, you can call it manually, as is done in the clump finding scripts.

.. module:: yt.lagos.ContourFinder

.. autofunction:: yt.lagos.identify_contours

.. autoclass:: yt.lagos.GridConsiderationQueue
   :members:

:mod:`yt.lagos.HaloFinding` Halo Finding
----------------------------------------

yt now includes the HOP algorithm and implementation from the Enzo source
distribution, with some modifications by both Stephen Skory and Matthew Turk.

.. module:: yt.lagos.HaloFinding

.. autoclass:: yt.lagos.HaloFinder
   :members:

.. autoclass:: yt.lagos.HaloList
   :members:

.. autoclass:: yt.lagos.Halo
   :members:

The specific halo finding algorithm can be specified by selecting the
appropriate HaloFinder object.  By default, HOP is used.

.. autoclass:: yt.lagos.HOPHaloFinder
   :members:

.. autoclass:: yt.lagos.FOFHaloFinder
   :members:
