Skip to content

Commit

Permalink
Update running_caesar and units docs
Browse files Browse the repository at this point in the history
  • Loading branch information
romeeld committed Jun 6, 2020
1 parent 5111d5b commit 1b749ab
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 11 deletions.
52 changes: 43 additions & 9 deletions docs/source/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,44 @@ Running CAESAR
:local:
:depth: 3

``CAESAR`` offers three basic functions:

[1] Identify galaxies and halos, compute a wide range of properties for each object, and cross-match them;

[2] Compute photometry accounting for the line-of-sight dust extinction to each star in the object; and

[3] Compute the most massive progenitors/descendant for any galaxy or halo in another snapshot [UNDER CONSTRUCTION].

----

Command Line
============

Running ``CAESAR`` has been made extremely simple! There is a nifty
command line interface (CLI) which allows you to quickly execute
``CAESAR`` on a single snapshot. This is done by:
Running ``CAESAR``'s first (and primary) functionality is very simple.
The command line interface (CLI) allows you to quickly execute
``CAESAR`` on a single snapshot:

.. code-block:: bash
$> caesar snapshot
This will run the code, an output a file named
``caesar_snapshot.hdf5``.
This will run the code, an output a catalog file named ``caesar_snapshot.hdf5``.

CLI OPTIONS
-----------

* LIST OPTIONS HERE [TODO]

----

Scripted
========

Scripting ``CAESAR`` is also quite simple. The following is a simple
example of how one might write a script to perform the same action as
was done in the above section (Command Line):
It is also possible to run ``CAESAR`` within a script. This is
useful e.g. for running over multiple snapshots.

Here is a simple example of how one might write a script to perform the same action as
the CLI command above; it also details what the CLI command does:

.. code-block:: python
Expand All @@ -51,4 +65,24 @@ was done in the above section (Command Line):
# now we save the output
obj.save('caesar_snapshot.hdf5')
member_search() options
-----------------------

* **nproc**: Number of cores for OpenMP parallelization. This follows the ``joblib`` convention that negative numbers correspond to using all except ``nproc+1`` cores, e.g. ``nproc=-2`` uses all but 1 core. *Default:* 1

* **haloid**: Source for halo ID's. *Default:* 'fof'

* ``haloid='fof'`` uses a 3D Friends-of-Friends (3DFOF) with b=0.2 to identify halos.

* ``haloid='snap'`` instead reads halo membership info for each particle from the snapshot variable ``HaloID``.

* **fof6d_file**: Stores results of 6DFOF galaxy finder in a file for future retrieval. If file does not exist, it is created; if it exists, the galaxy membership information is read from this file instead of running the 6DFOF. *Default:* *None*

* **fsps_bands**: Triggers optional photometry computation, in specified bands. The ``fsps.list_filters()`` command under ``python-fsps`` lists the available bands. One can also specify a string that will be matched to all available bands, e.g. ``fsps_bands=['sdss']`` will compute all bands that include the phrase ``sdss``. *Default:* *None*

* **ssp_table_file**: Path to lookup table for FSPS photometry. If this file does not exist or this keyword is unspecified, it will be generated (this takes some time). If it exists, ``CAESAR`` will read it in. *Default:* *None*




14 changes: 12 additions & 2 deletions docs/source/units.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ or to physical *kpc/h* (using ``obj.simulation.hubble_constant=0.7``):
In [3]: obj.galaxies[0].radii['total'].to('kpc/h')
Out[3]: 5.19577490116 kpc/h
That was easy!
When adding and subtracting quantities, they will be all be converted
to the units of the first quantity. You don't have to worry about
homegenizing the units yourself!

Working with units
******************
Expand All @@ -63,8 +65,16 @@ To assign a unit, you can use the yt functions ``YTQuantity`` and ``YTArray``:
Out[6]: 10000.0 kpc
Similarly, use ``YTArray`` for arrays.

If you need to get rid of the units and return a value for any reason,
simply append ``.d`` to the quantity.
simply append ``.d`` to the quantity:

.. code-block:: python
In [7]: print(x.d)
Out[7]: 10
In [8]: print(x.to('kpc').d)
Out[8]: 10000.0
For further information and tutorials regarding yt's units
please visit the `symbolic unit
Expand Down

0 comments on commit 1b749ab

Please sign in to comment.