Generate noisified lightcurves based on the BTS sample and retrain Parsnip with these.
Project description
ztfparsnip
Retrain Parsnip for ZTF. This is achieved by using fpbot forced photometry lightcurves of the Bright Transient Survey. These are augmented (redshifted, noisified and - when possible - K-corrected).
The package is maintained by A. Townsend (HU Berlin) and S. Reusch (DESY).
The following augmentation steps are taken for each parent lightcurve to generate a desired number of children (calculated via weights):
- draw a new redshift from a cubic distribution with maximum redshift increase
delta_z - only accept the lightcurve if at least
n_det_thresholddatapoints are above the signal-to-noise thresholdSN_threshold - if the lightcurve has an existing SNCosmo template, apply a K-correction at that magnitude (if
k_corr=True) - randomly drop datapoints until
subsampling_rateis reached - add some scatter to the observed dates (
jd_scatter_sigmain days) - if
phase_lim=True, only keep datapoints during a typical duration (depends on the type of source)
:warning:
Note that a high delta_z without loosening the SN_threshold and n_det_threshold will result in a large dropout rate, which will ultimately lead to far less lightcurves being generated than initially desired.
Usage
Create an augmented training sample
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
from ztfparsnip.train import Train
if __name__ == "__main__":
train = Train(classkey="simpleclasses", seed=None)
train.run()
Evaluate the Parsnip model
from ztfparsnip.train import Train
if __name__ == "__main__":
train = Train(classkey="simpleclasses", seed=None)
train.classify()
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ztfparsnip-0.3.0.tar.gz.
File metadata
- Download URL: ztfparsnip-0.3.0.tar.gz
- Upload date:
- Size: 3.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1042-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4a214daf24b0b8bbc80ab5211724ef70211dd7bd3497f71aae432dd604af210
|
|
| MD5 |
a5e91a4b993c8a53ebfa314bd6ce9ba8
|
|
| BLAKE2b-256 |
3de8b4caa6671b13b23be052dd5e01db536abb560f6a676cb4426ec3d5175cb9
|
File details
Details for the file ztfparsnip-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ztfparsnip-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1042-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30a85b070a48119e1be06d61364865ec2fae76876e3fe2bcd3e61f3efb382589
|
|
| MD5 |
3f9fe276f16366ded10d5ff90702a670
|
|
| BLAKE2b-256 |
92ec73034df264cf13a22614b3b3f342701dcf4b7eb29efe26ee159fad80e88f
|