# PISCOLA
**Supernova light-curve fitting code in python**
Although the main purpose of PISCOLA is to fit type Ia supernovae, it can be used to fit other types of supernovae or even other transients.
[](https://github.com/temuller/piscola)
[](https://piscola.readthedocs.io/en/latest/?badge=latest)
[](https://github.com/temuller/piscola/blob/master/LICENSE)
[](https://github.com/temuller/piscola/actions/workflows/main.yml)
[](https://raw.githubusercontent.com/temuller/piscola/master/coverage.svg)

[](https://pypi.org/project/piscola/)
[](https://ui.adsabs.harvard.edu/abs/2022MNRAS.512.3266M/abstract)
Read the full documentation at: [piscola.readthedocs.io](http://piscola.readthedocs.io/). See below for a summary. Check [https://github.com/temuller/piscola_templates](https://github.com/temuller/piscola_templates) for spectral templates of different types of supernovae.
___
## Installation
PISCOLA can be installed in the usual way, via pip:
```
pip install piscola
```
or from source:
```
git clone https://github.com/temuller/piscola.git
cd piscola
pip install .
```
If you are using a Mac with M1 or M2 chip and you encounter `RuntimeError: This version of jaxlib was built using AVX instructions, which your CPU and/or operating system do not support. You may be able work around this issue by building jaxlib from source.`, try installing `jax` from anaconda (as suggested [here](https://stackoverflow.com/questions/68327863/importing-jax-fails-on-mac-with-m1-chip)):
```
pip uninstall jax jaxlib
conda install -c conda-forge jaxlib
conda install -c conda-forge jax
```
### Requirements
The requirements can be found in the `requirements.txt` file.
### Tests
To run the tests, go to the parent directory and run the following command:
```
pytest -v
```
## Using PISCOLA
PISCOLA can fit the supernova light curves and correct them in a few lines of code:
```python
sn = piscola.call_sn(<sn_file>)
sn.fit()
```
The light-curve parameters are saved in a dictionary and can be accessed directly:
```python
sn.lc_parameters # dictionary
```
You can find an example of input file in the [data](https://github.com/temuller/piscola/tree/master/data) directory.
## Citing PISCOLA
If you make use of PISCOLA in your projects, please cite [Müller-Bravo et al. (2022)](https://ui.adsabs.harvard.edu/abs/2022MNRAS.512.3266M/abstract). See below for the bibtex format:
```code
@ARTICLE{2022MNRAS.512.3266M,
author = {{M{\"u}ller-Bravo}, Tom{\'a}s E. and {Sullivan}, Mark and {Smith}, Mathew and {Frohmaier}, Chris and {Guti{\'e}rrez}, Claudia P. and {Wiseman}, Philip and {Zontou}, Zoe},
title = "{PISCOLA: a data-driven transient light-curve fitter}",
journal = {\mnras},
keywords = {supernovae: general, cosmology: observations, distance scale, Astrophysics - High Energy Astrophysical Phenomena, Astrophysics - Cosmology and Nongalactic Astrophysics, Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - Solar and Stellar Astrophysics},
year = 2022,
month = may,
volume = {512},
number = {3},
pages = {3266-3283},
doi = {10.1093/mnras/stab3065},
archivePrefix = {arXiv},
eprint = {2110.11340},
primaryClass = {astro-ph.HE},
adsurl = {https://ui.adsabs.harvard.edu/abs/2022MNRAS.512.3266M},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
```
## Contributing and raising an issue
The recommended way is to use the [issues](https://github.com/temuller/piscola/issues) page or send a pull request. Otherwise, you can contact me directly.
Raw data
{
"_id": null,
"home_page": "https://github.com/temuller/piscola",
"name": "piscola",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Tom\u00e1s Enrique M\u00fcller Bravo",
"author_email": "t.e.muller-bravo@soton.ac.uk",
"download_url": "https://files.pythonhosted.org/packages/a3/41/1c1d6005e62ef6ddcbbebefc776bc4b896d01a2b03cbfa122b762743cc7e/piscola-3.0.0.tar.gz",
"platform": null,
"description": "# PISCOLA\n\n**Supernova light-curve fitting code in python**\n\nAlthough the main purpose of PISCOLA is to fit type Ia supernovae, it can be used to fit other types of supernovae or even other transients.\n\n[](https://github.com/temuller/piscola)\n[](https://piscola.readthedocs.io/en/latest/?badge=latest)\n[](https://github.com/temuller/piscola/blob/master/LICENSE)\n[](https://github.com/temuller/piscola/actions/workflows/main.yml)\n[](https://raw.githubusercontent.com/temuller/piscola/master/coverage.svg)\n\n[](https://pypi.org/project/piscola/)\n[](https://ui.adsabs.harvard.edu/abs/2022MNRAS.512.3266M/abstract)\n\nRead the full documentation at: [piscola.readthedocs.io](http://piscola.readthedocs.io/). See below for a summary. Check [https://github.com/temuller/piscola_templates](https://github.com/temuller/piscola_templates) for spectral templates of different types of supernovae.\n\n___\n## Installation\n\nPISCOLA can be installed in the usual way, via pip:\n\n```\npip install piscola\n```\n\nor from source:\n\n```\ngit clone https://github.com/temuller/piscola.git\ncd piscola\npip install .\n```\n\nIf you are using a Mac with M1 or M2 chip and you encounter `RuntimeError: This version of jaxlib was built using AVX instructions, which your CPU and/or operating system do not support. You may be able work around this issue by building jaxlib from source.`, try installing `jax` from anaconda (as suggested [here](https://stackoverflow.com/questions/68327863/importing-jax-fails-on-mac-with-m1-chip)):\n\n```\npip uninstall jax jaxlib\nconda install -c conda-forge jaxlib\nconda install -c conda-forge jax\n```\n\n### Requirements\n\nThe requirements can be found in the `requirements.txt` file.\n\n### Tests\n\nTo run the tests, go to the parent directory and run the following command:\n\n```\npytest -v\n```\n\n## Using PISCOLA\n\nPISCOLA can fit the supernova light curves and correct them in a few lines of code:\n\n\n```python\nsn = piscola.call_sn(<sn_file>)\nsn.fit()\n```\n\nThe light-curve parameters are saved in a dictionary and can be accessed directly:\n\n```python\nsn.lc_parameters # dictionary\n```\n\nYou can find an example of input file in the [data](https://github.com/temuller/piscola/tree/master/data) directory.\n\n## Citing PISCOLA\n\nIf you make use of PISCOLA in your projects, please cite [M\u00fcller-Bravo et al. (2022)](https://ui.adsabs.harvard.edu/abs/2022MNRAS.512.3266M/abstract). See below for the bibtex format:\n\n```code\n@ARTICLE{2022MNRAS.512.3266M,\n author = {{M{\\\"u}ller-Bravo}, Tom{\\'a}s E. and {Sullivan}, Mark and {Smith}, Mathew and {Frohmaier}, Chris and {Guti{\\'e}rrez}, Claudia P. and {Wiseman}, Philip and {Zontou}, Zoe},\n title = \"{PISCOLA: a data-driven transient light-curve fitter}\",\n journal = {\\mnras},\n keywords = {supernovae: general, cosmology: observations, distance scale, Astrophysics - High Energy Astrophysical Phenomena, Astrophysics - Cosmology and Nongalactic Astrophysics, Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - Solar and Stellar Astrophysics},\n year = 2022,\n month = may,\n volume = {512},\n number = {3},\n pages = {3266-3283},\n doi = {10.1093/mnras/stab3065},\narchivePrefix = {arXiv},\n eprint = {2110.11340},\n primaryClass = {astro-ph.HE},\n adsurl = {https://ui.adsabs.harvard.edu/abs/2022MNRAS.512.3266M},\n adsnote = {Provided by the SAO/NASA Astrophysics Data System}\n}\n```\n\n## Contributing and raising an issue\n\nThe recommended way is to use the [issues](https://github.com/temuller/piscola/issues) page or send a pull request. Otherwise, you can contact me directly.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Type Ia Supernova Light-curve fitting code",
"version": "3.0.0",
"project_urls": {
"Homepage": "https://github.com/temuller/piscola"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cf2133d01c0b193199b7bb7a7b6049fe941c2515d0072893a52f9f3a7e89a206",
"md5": "b4e67e79735b5aaa520e22e26dd79978",
"sha256": "075a5696c7d755073507e15aec43927b90a052ab655263a7baf803b96e1e10f3"
},
"downloads": -1,
"filename": "piscola-3.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b4e67e79735b5aaa520e22e26dd79978",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 1025786,
"upload_time": "2024-12-19T10:11:56",
"upload_time_iso_8601": "2024-12-19T10:11:56.996680Z",
"url": "https://files.pythonhosted.org/packages/cf/21/33d01c0b193199b7bb7a7b6049fe941c2515d0072893a52f9f3a7e89a206/piscola-3.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a3411c1d6005e62ef6ddcbbebefc776bc4b896d01a2b03cbfa122b762743cc7e",
"md5": "c6021bda23a812990b1d6de991edcc11",
"sha256": "245bf4b06ced2741235ca414a150f157e12be187fb540a1b91214526326de185"
},
"downloads": -1,
"filename": "piscola-3.0.0.tar.gz",
"has_sig": false,
"md5_digest": "c6021bda23a812990b1d6de991edcc11",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 1023020,
"upload_time": "2024-12-19T10:12:00",
"upload_time_iso_8601": "2024-12-19T10:12:00.252055Z",
"url": "https://files.pythonhosted.org/packages/a3/41/1c1d6005e62ef6ddcbbebefc776bc4b896d01a2b03cbfa122b762743cc7e/piscola-3.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-19 10:12:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "temuller",
"github_project": "piscola",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "numpy",
"specs": []
},
{
"name": "pandas",
"specs": []
},
{
"name": "matplotlib",
"specs": []
},
{
"name": "peakutils",
"specs": []
},
{
"name": "requests",
"specs": []
},
{
"name": "sfdmap2",
"specs": []
},
{
"name": "extinction",
"specs": []
},
{
"name": "astropy",
"specs": []
},
{
"name": "scipy",
"specs": []
},
{
"name": "jax",
"specs": []
},
{
"name": "jaxopt",
"specs": []
},
{
"name": "tinygp",
"specs": []
},
{
"name": "pickle5",
"specs": []
},
{
"name": "pytest",
"specs": []
}
],
"lcname": "piscola"
}