===================
Welcome to RESSPECT
===================
-------------------------------------------------
Recommendation System for Spectroscopic Follow-up
-------------------------------------------------
This tool allows the constructon of an optimized spectroscopic observation strategy which enables photometric supernova cosmology. It was developed as a collaboration between the LSST DESC and the Cosmostatistics Initiative.
This grew from the work presented in `Ishida et al., 2019 `_ and implemented in the `actsnclass `_ package.
The RESSPECT active learning and telescope resources pipeline is described in `Kennamer et al, 2020 `_. We kindly ask you to include its full citation if you use this material in your research.
The code has been modify for the task of enabling photometric supernova cosmology.
Getting started
===============
This code was developed for ``Python3`` and was not tested in Windows.
We recommend that you work within a `virtual environment `_.
You will need to install the `Python` package ``virtualenv``. In MacOS or Linux, do
.. code-block:: bash
>>> python3 -m pip install --user virtualenv
Navigate to a ``working_directory`` where you will store the new virtual environment and create it:
.. code-block:: bash
>>> python3.10 -m venv resspect
.. hint:: Make sure you deactivate any ``conda`` environment you might have running before moving forward.
Once the environment is set up you can activate it:
.. code-block:: bash
>>> source /bin/activate
You should see a ``(resspect)`` flag in the extreme left of terminal command line.
Next, clone this repository in another chosen location:
.. code-block:: bash
(resspect) >>> git clone https://github.com/COINtoolbox/resspect
Navigate to the repository folder and you can now install this package with:
.. code-block:: bash
(resspect) >>> pip install -e .
Setting up a working directory
------------------------------
In a your choosing, create the following directory structure:
::
work_dir
├── plots
├── results
The outputs of ``resspect`` will be stored in these directories.
In order to set things properly, you'll need to download a copy of the example data.
The following script will download the data and unpack it into your local cache
directory. (`/Users//Library/Caches/resspect/SIMGEN_PUBLIC_DES` in MacOS
and Linux, `C:\Users\\AppData\Local\resspect\SIMGEN_PUBLIC_DES` in Windows)
.. code-block:: bash
>>> fetch_example_data
This data was provided by Rick Kessler, after the publication of results from the
`SuperNova Photometric Classification Challenge `_ (SNPCC).
It allows you to run tests and validate your installation.
Analysis steps
==============
.. figure:: images/active_learning_loop.png
:align: right
:height: 255.6px
:width: 225 px
:alt: Active learning loop
Figure by Bruno Quint.
The active learning pipeline is composed of 4 important steps:
1. Feature extraction
2. Classifier
3. Query Strategy
4. Metric evaluation
These are arranged in the adaptable learning process (figure to the right).
Using this package
------------------
Step 1 is considered pre-processing. The current code does the feature extraction
using the `Bazin parametric function `_ for the complete training and test sample
before any machine learning application is used.
Details of the tools available to evaluate different steps on feature extraction can be found in the
:ref:`Feature extraction page `.
Alternatively, you can also perform the full light curve fit for the entire sample from the command line.
If you are only interested in testing your installation you should work with the SNPCC data:
.. code-block:: bash
>>> fit_dataset.py -s SNPCC -dd -o
Once the data has been processed you can apply the full Active Learning loop according to your needs.
A detail description on how to use this tool is provided in the :ref:`Learning Loop page `.
The command line option require a few more inputs than the feature extraction stage, but it is also available:
.. code-block:: bash
>>> run_loop.py -i -b -n
>>> -d