Skip to content

Commit

Permalink
Merge 4268587 into ca57c69
Browse files Browse the repository at this point in the history
  • Loading branch information
swagnercarena committed Mar 2, 2022
2 parents ca57c69 + 4268587 commit e8a06ae
Show file tree
Hide file tree
Showing 85 changed files with 1,939 additions and 2,450 deletions.
41 changes: 32 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,44 @@
Installation
------------

Lenstronomy requires an additional fortran package (fastell) to run lens models with elliptical mass distributions. Thankfully, installing the package is fairly easy (although a fortran compiler is required).
``paltas`` is installable via pip:

.. code-block:: bash
$ git clone https://github.com/sibirrer/fastell4py.git <desired location>
$ cd <desired location>
$ python setup.py install --user
$ pip install paltas
The default ``paltas`` requirements do not include ``tensorflow``, but if you are interested in using the modules contained in the Analysis folder, you will have to install ``tensorflow``:

In the future, paltas will be a pypi package. For now, it can be installed by cloning the git repo.
.. code-block:: bash
$ pip install tensorflow
Usage
-----

The main functionality of ``paltas`` is to generate realistic datasets of strong gravitational lenses in a way that's modular, scalable, and user-friendly. To make a dataset with platas all you need is a configuration file which you can then pass to the generate.py script:

.. code-block:: bash
$ python generate.py path/to/config/file path/to/output/folder --n 100
Running the line of code above would generate 100 lenses and output them in the specified folder. ``paltas`` comes preloaded with a number of configuration files which are described in ``Configs/README.rst``. For example, to create a dataset with HST observational effects, subhalos, and line-of-sight halos run:

.. code-block:: bash
$ git clone https://github.com/swagnercarena/paltas.git
$ cd paltas/
$ pip install -e . -r requirements.txt
$ python generate.py Configs/config_all.py example --n 100
We provide a tutorial notebook that describes how to `generate your own config file <https://github.com/swagnercarena/paltas/tree/main/notebooks/Config_Tutorial.ipynb>`_.

Demos
-----

``paltas`` comes with a few tutorial notebooks for users interested in modifying the simulation classes or training a neural posterior estimator of lens parameters.

* `Implement your own source, line-of-sight, subhalo, or main deflector model <https://github.com/swagnercarena/paltas/tree/main/notebooks/Understanding_Pipeline.ipynb>`_.
* `Training a neural posterior estimator of simulation parameters <https://github.com/swagnercarena/paltas/tree/main/notebooks/Network_Training.ipynb>`_
* `Running hierarchical inference on a population of strong lenses <https://github.com/swagnercarena/paltas/tree/main/notebooks/Population_Analysis.ipynb>`_

The addition of the -e option will allow you to pull paltas updates and have them work automatically.
Attribution
-----------
If you use ``paltas`` or its datasets for your own research, please cite the ``paltas`` package (`Wagner-Carena et al. 2022 <https://arxiv.org/abs/xxxx.yyyy>`_) as well as the ``lenstronomy`` package (`Birrer & Amara 2018 <https://arxiv.org/abs/1803.09746v1>`_, `Birrer et al. 2021 <https://joss.theoj.org/papers/10.21105/joss.03283>`_).
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Documentation
.. toctree::
:maxdepth: 2

paltas.generate
paltas.Analysis
paltas.MainDeflector
paltas.PointSource
Expand Down
2 changes: 2 additions & 0 deletions docs/paltas.MainDeflector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
:mod:`MainDeflector` -- Main Deflector Rendering Modules
========================================================

.. include:: ../paltas/MainDeflector/README.rst

paltas.MainDeflector.main_deflector_base module
-----------------------------------------------

Expand Down
2 changes: 2 additions & 0 deletions docs/paltas.PointSource.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
:mod:`PointSource` -- Point Source Rendering Modules
====================================================

.. include:: ../paltas/PointSource/README.rst

paltas.PointSource.point_source_base module
-------------------------------------------

Expand Down
2 changes: 2 additions & 0 deletions docs/paltas.Sources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
:mod:`Sources` -- Source Light Rendering Modules
================================================

.. include:: ../paltas/Sources/README.rst

paltas.Sources.cosmos module
----------------------------

Expand Down
2 changes: 2 additions & 0 deletions docs/paltas.Substructure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
:mod:`Substructure` -- Subhalos and Line-of-Sight Halos Rendering Modules
=========================================================================

.. include:: ../paltas/Substructure/README.rst

paltas.Substructure.los_base module
-----------------------------------

Expand Down
Loading

0 comments on commit e8a06ae

Please sign in to comment.