.. _command-line-tool:

Command Line Tool
=================

``yt`` comes with a command-line tool, known as ``yt``, that exposes much of
the functionality that would normally be accessible through a scripts.  This
is designed to make the process of making immediate plots much easier.  All of
the functionality is described in the help strings:

.. code-block:: bash

   $ yt help

and then the subcommands all have ``help`` options as well:

.. code-block:: bash

   $ yt plot --help

In order to actually run the command, you'll need to tell it which outputs to
operate on.  The ``yt`` command-line tool has three mechanisms for specifying
outputs.  It will do its best to guess based on the information its provided.  

You can specify a base name for a parameter file and then a start and stop
number (and optionally a skip parameter):

.. code-block:: bash

   $ yt plot --basename=RedshiftOutput --skip 5 10 50

This will run your plot command on ``RedshiftOutput`` 10 through 50, but only
on multiples of five.  (And if your output is in a subdirectory, ``yt`` will
check there too, don't worry!)

You can specify a single parameter file:

.. code-block:: bash

   $ yt plot RedshiftOutput0010

This will run your plot command on ``RedshiftOutput0010``.

Alternatively, you can specify multiple parameter files on the command line:

.. code-block:: bash

   $ yt plot RedshiftOutput0010 RedshiftOutput0020 RedshiftOutput0030

This will plot ``RedshiftOutput0010``, ``RedshiftOutput0020``, and
``RedshiftOutput0030``.

Simple Statistics
-----------------

To get information about a given parameter file, including the maximum density,
the level information, the smallest cell size and some timing information, use
the ``stats`` command:

.. code-block:: bash

   $ yt stats RedshiftOutput0005

.. rubric: Sample Output

.. literalinclude:: _stats_output.txt

Plots
-----

The command line tool can make either projections or slices.  To make a
projection, supply it with the ``-p`` option:

.. code-block:: bash

   $ yt plot -p RedshiftOutput0005

If you don't supply the ``-p`` option, it will only slice rather than project
through the object.  Weights can also be supplied for an average along the line
of sight.  This command defaults to the full width, centered on the most dense
point, and outputting along all three axes.  The help command has more
information:

.. rubric: Help Output

.. literalinclude:: _plot_help.txt

Zoomin Movies
-------------

The command line tool also has facilities for outputting a set of frames that
zoom in on a central position.  This works on a single dataset and can zoom in
on projections or slices:

.. code-block:: bash

   $ yt zoomin RedshiftOutput0005

However, as with the other commands, you will likely want to specify your own
options.

.. rubric: Help Output

.. literalinclude:: _zoomin_help.txt

Halo Profiler
-------------
