# Reproduction package for the paper "Prospects of Gravitational Wave Follow-up Through a Wide-field Ultra-violet Satellite: a Dorado Case Study"

This is a basic reproduction package for the paper "Prospects of Gravitational Wave Follow-up Through a Wide-field Ultra-violet Satellite: a Dorado Case Study" 
by [Dorsman et al. (2022)](https://doi.org/10.48550/arXiv.2206.09696).



## Data

* figures.tar.xz: figures 1-7 as included in the paper.
* input data.tar.xz: input data. The software expects the input data under "input_files/".
  * data is computed photometric data including SNRs/errorbars.
  * Sim_inspiral table are simulated GW observations from [Data-driven expectations for electromagnetic counterpart searches based on LIGO/Virgo public alerts: O5 simulations](https://doi.org/10.5281/zenodo.4765752), Leo Singer (2021). 10.ecsv is a Dorado observation schedule corresponding to BNS observation #10 from this dataset using the [Dorado observation scheduler](https://github.com/nasa/dorado-scheduling).
  * each ejecta, effective kappa, and solar r abundance are from Kenta Hotokezaka and Ehud Nakar’s heating rate code for kilonovae: [Github](https://github.com/hotokezaka/HeatingRate/tree/master/HeatingRate_beta/input_files).
  * Bands are sloan SDSS bands: [Source](http://svo2.cab.inta-csic.es/theory/fps/index.php?id=SLOAN/SDSS.i).
* samples.tar.xz: samples computed for figures 1-7. The software expects the samples under "output_files/results".
* software.tar.xz: Software used to produce data, samples, and figures. 


## Software

* The software includes its own README file and is also available at [Github](https://github.com/Basdorsman/kilonova-bayesian-analysis/tree/rp). 
* It has been developed and tested in a Linux environment, and is built in Python 3. It  is highly recommended to use [Poetry]((https://python-poetry.org/) for management of the virtual environment and dependencies.


## Figures and Tables

Scripts to generate figures:
* figure_1.py produces Fig 1.
* figures_model_selection.py produces the figures related to model selection: Fig 2 and Fig 6.
* figures_parameter_estimation.py produces the figures related to parameter estimation: Figs 3,4,5 and 7. 

Figures:
* Fig 1: Showcase of input data and light curves.
* Fig 2: Model selection for various bands.
* Fig 3: Parameter estimation for kilonova model for various distances.
* Fig 4: Parameter estimation for shock model.
* Fig 5: Parameter estimation for kilonova model for various bands.
* Fig 6: Model selection for various delays.
* Fig 7: Parameter estimation for various delays.


## End-to-End analysis scripts  

* single_parameter_estimation.sh and parallel_parameter_estimation.sh are the shell files for running the sampling analysis. 
  * The "single" version runs one sampling analysis.
  * The "parallel" version runs multiple analyses (with different input variables) using GNU parallel. Default input parameters are included to produce samples for Figures 2 and 6. Use uncommenting as indicated to reproduce the required samples.
  * Inside the shell files, produce-data.py is called to produce the photometric data. parameter_estimation.py is called to run sampling analysis.
