Quick Start

Set-up

Install Hoki

To install the most recent stable release of hoki you can use:

sudo pip3 install --user hoki

If you are feeling adventurous and want the most recent (in development) version of hoki, you can clone our GitHub repository

Download the tutorials

They can be found in the side-bar to read, but you can dowload the jupyter notebooks so you can play with them later. For the SED fitting tutorials that were released with v1.7.1, since they have a large data file they have been put on Zenodo:

https://zenodo.org/badge/DOI/10.5281/zenodo.7409486.svg

Download the BPASS models

For the BPASSv2.2.1 starter kit with the stellar library and fiducial model outputs:

https://zenodo.org/badge/DOI/10.5281/zenodo.7340797.svg

Full BPASS models can be downloaded from:

Download

Hoki Compatible

Release Date

Reference

BPASSv2.2

Yes

July 2018

Stanway & Eldridge (2018)

BPASSv2.1

untested

October 2017

Eldridge, Stanway, Xiao, et al. (2017)

BPASSv2.0

untested

BPASSv1

untested

hoki is dedicated to being an interface with the BPASS models, but given the substancial size of the entire set of models, they are not downloaded upon installation of hoki, and you should download the models you want to work on.

Loading in Data

Tip

More details on the outputs mentioned below can be found in the BPASS manual.

Stellar Population Outputs

A stellar output file can be loaded in using the model_output() function in the load module.

1
2
3
from hoki import load

output = load.model_output('path_to_output')

The function will figure out based on the file name what data is being loaded in and will return the appropriate data format: pandas.DataFrames in most cases, apart from HR diagrams, which have their own HRDiagrams class – because they’re quite a complex data structure.

Here we summarise the shape of the outputs (51 time bins) for a given metalicity and IMF.

Output

File Name Root

Shape

Massive star type numbers

numbers

51 x 21

Supernova Rates

supernova

51 x 18

Energy and elemental yields

yields

51 x 9

Stellar mass remaining at the end

starmass

51 x 3

HR diagrams

hrs

51 x 100 x 100 x 3 x 3

Spectral Synthesis Outputs

The spectral synthesis output files can be also loaded in using the model_output() function in the load module. All outputs are returned as pandas.DataFrames with sensible column names.

1
2
3
from hoki import load

output = load.model_output('path_to_output')

Output

File Name Root

Shape

Spectra (SEDs)

spectra

52x10E5

Ionizing flux predictions

ionizing

51x5

Colours (broad-band)

colours

51x26

The full suite of stellar models is also available from the BPASS website (careful, the file is big ~50GB), and they are required to make colour magnitude diagram (CMD) such as in Figure 24 of BPASSv2.1. Creating these CMD and exploring these files is very tricky - in a future release hoki will offer features to make this straight forward.

Stellar Models

In addition to the population and spectral synthesis outputs, the stellar models are also available as a BPASS data product. They can be downloaded from the google drive: the name of the folder containing the most recent models is bpass-v2.2-newmodels.

Warning

These folder is ~50 GB. Make sure you have a good internet connection and sufficient space.

The stellar models are required to make Colour-Magnitude Diagrams (see RECIPES) and other deeper searches within the models that are not summarised in the population or spectral synthesis outputs.

Note

This is where the files names model_input become necesary. They are not human readable but are used within hoki to apply the correct algorithm to the stellar models in order to collate them correctly. (So don’t panic if you open them and wonder what is going on).

Citing Hoki

Hoki has been reviewed and published by the Journal Of Open Source Software! Click the button below to access the online publication.

https://joss.theoj.org/papers/10.21105/joss.01987/status.svg

If you use hoki for your science, please include the following reference in your paper:

@ARTICLE{2020JOSS....5.1987S,
    author = {{Stevance}, Heloise and {Eldridge}, J. and {Stanway}, Elizabeth},
    title = "{Hoki: Making BPASS accessible through Python}",
    journal = {The Journal of Open Source Software},
  keywords = {Python, galaxies, Batchfile, SED, astronomy, binary stars, Astrophysics - Solar and Stellar Astrophysics, Astrophysics - Astrophysics of Galaxies, Astrophysics - Instrumentation and Methods for Astrophysics},
     year = "2020",
     month = "Jan",
     volume = {5},
     number = {45},
     eid = {1987},
     pages = {1987},
     doi = {10.21105/joss.01987},
     archivePrefix = {arXiv},
     eprint = {2001.11069},
     primaryClass = {astro-ph.SR},
     adsurl = {https://ui.adsabs.harvard.edu/abs/2020JOSS....5.1987S},
    adsnote = {Provided by the SAO/NASA Astrophysics Data System}
 }

See also

For dedicated tutorials about specific aspecs of hoki and BPASS, check our RECIPES section in the side bar!