Metadata-Version: 2.1
Name: ztfparsnip
Version: 0.2.1
Summary: Generate noisified lightcurves based on the BTS sample and retrain Parsnip with these.
Author: Simeon Reusch
Author-email: simeon.reusch@desy.de
Requires-Python: >=3.10,<3.12
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: astro-parsnip (>=1.3.1,<2.0.0)
Requires-Dist: h5py (>=3.7.0,<4.0.0)
Requires-Dist: numpy (>=1.24.0,<2.0.0)
Requires-Dist: pandas (>=1.5.2,<2.0.0)
Requires-Dist: pandas-stubs (>=1.5.2.230105,<2.0.0.0)
Requires-Dist: seaborn (>=0.12.2,<0.13.0)
Requires-Dist: tqdm (>=4.64.1,<5.0.0)
Requires-Dist: tqdm-stubs (>=0.2.1,<0.3.0)
Requires-Dist: types-pyyaml (>=6.0.12.8,<7.0.0.0)
Description-Content-Type: text/markdown

# ztfparsnip
[![PyPI version](https://badge.fury.io/py/ztfparsnip.svg)](https://badge.fury.io/py/ztfparsnip)
[![CI](https://github.com/simeonreusch/ztfparsnip/actions/workflows/ci.yaml/badge.svg)](https://github.com/simeonreusch/ztfparsnip/actions/workflows/ci.yaml)
[![Coverage Status](https://coveralls.io/repos/github/simeonreusch/ztfparsnip/badge.svg?branch=main)](https://coveralls.io/github/simeonreusch/ztfparsnip?branch=main)

Retrain [Parsnip](https://github.com/LSSTDESC/parsnip) for ZTF. This is achieved by using [fpbot](https://github.com/simeonreusch/fpbot) forced photometry lightcurves of the [Bright Transient Survey](https://sites.astro.caltech.edu/ztf/bts/bts.php). These are augmented (redshifted, noisifed and - when possible - K-corrected).

The package is maintained by [A. Townsend](https://github.com/aotownsend) (HU Berlin) and [S. Reusch](https://github.com/simeonreusch) (DESY).

## Usage
### Create augmented training sample
```python
from pathlib import Path
from ztfparsnip.create import CreateLightcurves
weights = {"sn_ia": 9400, "tde": 9400, "sn_other": 9400, "agn": 9400, "star": 9400}
if __name__ == "__main__":
    sample = CreateLightcurves(
        output_format="parsnip",
        classkey="simpleclasses",
        weights=weights,
        train_dir=Path("train"),
        plot_dir=Path("plot"),
        seed=None,
        phase_lim=True,
        k_corr=True,
    )
    sample.select()
    sample.create(plot_debug=False)
```

### Train Parsnip with the augmented sample
```python
from ztfparsnip.train import Train
if __name__ == "__main__":
    train = Train(classkey="simpleclasses", seed=None)
    train.run()
```

### Evaluate
Coming soon.
