.. jjmodel documentation master file, created by
sphinx-quickstart on Thu Mar 24 16:00:37 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Installation
===============
Standard installation
-----------------------
To install the **jjmodel** code as *anaconda* package, do in terminal:
.. code-block:: bash
$ pip install git+https://github.com/askenja/jjmodel.git@main
To install a specific version (see releases on github), use the corresponding tag instead of *main*, e.g. *v.1.0.0*.
Note that **jjmodel** requires python 3.8. Also, it depends on the following packages:
`Numpy (v1.18.1) `_, `SciPy (v1.5.0) `_,
`Astropy (v4.2) `_, `matplotlib (v3.2.1) `_,
and `fast_histogram (v0.9) `_. Also, consider installing
`healpy (v1.15.0) `_ which is good for plotting sky maps
(used in one of the tutorials). All of these packages are pip-installable.
Installation without admin rights
----------------------------------
You can install **jjmodel** into a folder where you have write access.
Open there a terminal and run the following command:
.. code-block:: bash
$ pip install --install-option='--prefix=~/extra_package/' git+https://github.com/askenja/jjmodel.git@main
Then you have to add the ``site-packages/`` folder which will be one of the newly created subfolders in ``extra_package/`` into the PYTHONPATH variable, e.g.:
.. code-block:: bash
$ export PYTHONPATH=~/extra_package/lib/python3.8/site-packages/:$PYTHONPATH
If you want this to be permanent, you can add the last line to your ``.bashrc`` file.
Getting isochrones
-------------------------
In order to work with mock stellar populations, the **jjmodel** code needs an isochrone grid.
We provide three alternative isochrone packages compatible with the JJ model:
- `PARSEC (Padova) `_
- `MIST `_
- `BaSTI `_
After you have installed **jjmodel** to your *anaconda*, you can automatically download any
of the provided isochrone sets (or all of them). Run the following code in a python script or jupyther notebook:
.. code-block:: python
import jjmodel as jjm
from jjmodel.iso_loader import isochrone_loader
isochrone_loader('Padova')
isochrone_loader('MIST')
isochrone_loader('BaSTI')
This will save and unpack all three isochrone grids to your local **jjmodel** folder, e.g.
``/home/user/anaconda2/envs/py3/lib/python3.8/site-packages/jjmodel/input/isochrones``
(you can use command ``jjm.__file__`` to see the path to the **jjmodel** code on your computer).
Note that you may need quite a lot of space for the isochrones (1.7 Gb for Padova, 12.2 Gb for MIST,
and 5.7 Gb for BaSTI), and download can take a while.
After you have downloaded isochrones, the installation is complete, and you can start using the model
(e.g. see :doc:`tutorials`).