# ztfcosmo
ZTF Cosmo Data Release repository

Download and visualize ZTF SN Ia DR2 ([Rigault et al. 2025](https://ui.adsabs.harvard.edu/abs/2024arXiv240904346R/abstract)) data through its dedicated [website](http://ztfcosmo.in2p3.fr/).


# Basic usage

## access data tables

```python
import ztfcosmo
data = ztfcosmo.get_data() # see options
```

## Plot a lightcurve
```python
lc = ztfcosmo.get_target_lightcurve("ZTF18aaqfziz", as_data=False) # see options
fig = lc.show()
```
![](docs/figures/ZTF18aaqfziz_lcfit.png)

## Plot a spectrum
Remark that a target may have several spectra, if so spec is a `list`.
```python
spec = ztfcosmo.get_target_spectra("ZTF18aaqfziz", as_data=False) 
fig = spec.show()
```
![](docs/figures/ZTF18aaqfziz_spectrum.png)

# Citing

If you have been using ztfcosmo for your research, please cite [Rigault et al. 2025](https://ui.adsabs.harvard.edu/abs/2024arXiv240904346R/abstract).
