Skip to main content

CASCADe filtering: Calibration of trAnsit Spectroscopy using CAusal Data filtering module.

Project description

pipeline status

CASCADe-filtering

This package is a sub package of the CASCADe package, developed within the EC Horizons 2020 project Exoplanets A . It contains functionality to detect and flag cosmic ray hits in spectral images, and to create cleaned and filtered spectral images, which can be used for spectral extraction.

Installing CASCADe-filtering

The easiest way to install the CASCADe-filtering package is to create an Anaconda environment, download the distribution from PyPi, and install the package in the designated Anaconda environment with the following commands:

conda create --name cascade-filtering python=3.9 ipython
conda activate cascade-filtering
pip install CASCADe-filtering

This will install all code and scripts you need for the package to work.

Installing the CASCADe-filtering examples

The CASCADe-filtering package comes with several examples, demonstrating how to detect and filter cosmic hits from spectroscopic images. If the package is installed from PypPi, the example jupyter notebooks and simulated data need be downloaded from the GitLab repository. To initialize the data download one can use the following bash command in the Anaconda environment:

setup_cascade-filtering.py

or alternatively from within the python interpreter:

from cascade_filtering.initialize import setup_examples
setup_examples()

The additional downloaded data also includes examples and observational data to try out the CASCADe package, which are explained below.

NOTE: The data files will be downloaded by default to a CASCADeSTORAGE/ directory in the users home directory. If a different location is preferred, please read the section on how to set the CASCADe CASCADE_STORAGE_PATH environment variable first. For details in the environment variables we refer to the documentation of the CASCADe main package.

Installing alternatives for the CASCADe-filtering package

The CASCADe-filtering code can also be downloaded from GitLab directly by either using git or pip. To download and install with a single command using pip, type in a terminal the following command

pip install git+git://gitlab.com/jbouwman/CASCADe-filtering.git@main

which will download the latest version. For other releases replace the main branch with one of the available releases on GitLab. Alternatively, one can first clone the repository and then install, either using the HTTPS protocol:

git clone https://gitlab.com/jbouwman/CASCADe-filtering.git

or clone using SSH:

git clone git@gitlab.com:jbouwman/CASCADe-filtering.git

Both commands will download a copy of the files in a folder named after the project's name. You can then navigate to the directory and start working on it locally. After accessing the root folder in a terminal, type

pip install .

to install the package.

In case one is installing CASCADe-filtering directly from GitLab, and one is using Anaconda, make sure a cascade environment is created and activated before using our package. For convenience, in the CASCADe-filtering main package directory an environment.yml can be found. You can use this yml file to create or update the cascade Anaconda environment. If you not already had created an cascade environment execute the following command:

conda env create -f environment.yml

In case you already have an cascade environment, you can update the necessary packages with the following command (also use this after updating CASCADe-filtering itself):

conda env update -f environment.yml

Make sure the CASCADe-filtering - package is in your path. You can either set a PYTHONPATH environment variable pointing to the location of the CASCADe -filtering package on your system, or when using anaconda with the following command:

conda develop <path_to_the_CASCADe_package_on_your_system>/CASCADe-filtering

Using CASCADe-filtering

The CASCADe-filtering distribution comes with several working examples and test data sets which can be found in the examples directory of the CASCADe-filtering distribution on GitLab, or have been installed locally with the commands outlined above. The example jupyter notebooks explain and demonstrate the basic usage of the filtering modules, and use simulated JWST/MIRI low resolution spectroscopic data as an example how to identify and remove cosmic hits. To run the examples make sure that the conda cascade-filtering environment can be found by the jupyter server. This can be achieved with the following command:

python -m ipykernel install --user --name=cascade-filtering

after which the notebooks can be viewed and excecuted with jupyter which can be started with.

jupyter notebooks

Documentation

The full documentation can be found online at:


https://jbouwman.gitlab.io/CASCADe-filtering/


Alternatively, the documentation can be found in the docs directory of the CASCADe-filtering GitLab repository. After cloning the git repository, the full documentation can be generated by executing in the in the docs directory the following commands:

make html
make latexpdf

The generated HTML and PDF files will be located in the build/html and build/latex sub-directories of the main documentation directory, respectively.

Documentation on the CASCADe main package can be found at:


https://jbouwman.gitlab.io/CASCADe/


Acknowledgments

The CASCADe-filtering code was developed by Jeroen Bouwman, with contributions from the following collaborators:

Juergen Schreiber (MPIA)

This work was supported by the European Unions Horizon 2020 Research and Innovation Programme, under Grant Agreement N 776403.

Publications

https://ui.adsabs.harvard.edu/abs/2021AJ....161..284M/abstract

https://ui.adsabs.harvard.edu/abs/2021A%26A...646A.168C/abstract

https://ui.adsabs.harvard.edu/abs/2020ASPC..527..179L/abstract

https://exoplanet-talks.org/talk/271

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CASCADe-filtering-1.0.3.tar.gz (41.9 kB view hashes)

Uploaded Source

Built Distribution

CASCADe_filtering-1.0.3-py3-none-any.whl (53.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page