kilopop.kilonovae.bns_kilonova

class kilopop.kilonovae.bns_kilonova(mass1=None, mass2=None, compactness1=None, compactness2=None, viewing_angle=None, electron_fraction=None, dynamical_ejecta_mass=None, median_ejecta_velocity=None, grey_opacity=None, secular_ejecta_mass=None, total_ejecta_mass=None, disk_unbinding_efficiency=None, mass_ratio_threshold=0.4, transient_duration=15.0, min_wave=500.0, max_wave=12000.0, EOS_path=None, opacity_data_path=None, emulator_path=None, id=None, only_draw_parameters=False, **kwargs)[source]

Bases: object

Top-level class for kilonovae transients based on Rosswog, et. al 2017 semi-analytic model for kilonovae spectral energy distributions. With added mappings and population priors to generate kilonovae consistent with a broad binary neutron star population.

Note: all input parameters are optional. If none are provided a kilonova will be generated by drawing parameters from the population priors used in our accompanying paper, Setzer et al. 2022.

Parameters:
  • mass1 (float) – The gravitational mass of the first neutron star.

  • mass2 (float) – The gravitational mass of the second neutron star.

  • compactness1 (float) – The stellar compactness of the first neutron star.

  • compactness2 (float) – The stellar compactness of the second neutron star.

  • viewing_angle (float) – The viewing angle of the observer with respect to the merger.

  • electron_fraction (float) – The electron fraction along the line of sight of the observer.

  • dynamical_ejecta_mass (float) – The dynamic ejecta mass of the expanding kilonova material.

  • median_ejecta_velocity (float) – The mean ejecta velocity of the expanding kilonova material.

  • grey_opacity (float) – The grey opacity of the material along the line of sight of the observer.

  • secular_ejecta_mass (float) – The secular ejecta mass of the expanding kilonova material.

  • total_ejecta_mass (float) – The total ejecta mass of the expanding kilonova material.

  • disk_unbinding_efficiency (float) – The fractional percentage of matter unbound by disk winds.

  • mass_ratio_threshold (float) – The lower bound on mass-ratio for which to simulate the binary.

  • transient_duration (float [days]) – The maximal length of time over which to generate the kilonova signal. Default is 15 days.

  • min_wave (float [Angstroms]) – The minimum wavelength of the simulated source-frame spectral timeseries.

  • max_wave (float [Angstroms]) – The maximum wavelength of the simulated source-frame spectral timeseries.

  • EOS_path (string) – The location of EOS mass vs. radius data for computation of TOV mass, translation between neutron star mass and radius, and computation of the stellar compactness of the component neutron stars.

  • opacity_data_path (string) – The location of the inferred grey opacity training data for use with the Gaussian process emulator.

  • emulator_path (string) – The file location of the emulator data needed to reconstruct the Gaussian process emulator for mapping ejecta parameters to grey opacity.

  • id (int) – Unique ID to associate with specific generated instance of a kilonova. Useful for simulation purposes.

  • only_draw_parameters (Boolean) – Flag indicating if the spectral timeseries should also be generated for the correspondingly provided or drawn parameters.

Returns:

object – Instance of this class of kilonovae.

Return type:

class instance

__init__(mass1=None, mass2=None, compactness1=None, compactness2=None, viewing_angle=None, electron_fraction=None, dynamical_ejecta_mass=None, median_ejecta_velocity=None, grey_opacity=None, secular_ejecta_mass=None, total_ejecta_mass=None, disk_unbinding_efficiency=None, mass_ratio_threshold=0.4, transient_duration=15.0, min_wave=500.0, max_wave=12000.0, EOS_path=None, opacity_data_path=None, emulator_path=None, id=None, only_draw_parameters=False, **kwargs)[source]
__call__(**kwargs)

Call self as a function.

Methods

__init__([mass1, mass2, compactness1, ...])

create_spectral_timeseries([KNE_parameters])

Create the spectral energy density timeseries for this kilonova instance.

draw_from_binary_population()

Draw from the population priors on masses and inclination.

draw_parameters()

Draw parameters not populated by the user.

emulate_grey_opacity()

Wrapper function to emulate the grey opacity as the last step in populating the transient instance with kilonova parameters.

enforce_emulator_bounds()

Impose emulator boundary conditions for validity.

map_mass_to_compactness()

Wrapper function to the equation of state mappings.

map_to_kilonova_ejecta()

Wrapper function to compute all of the kilonova ejecta, apart from emulation of the grey opacity given the ejecta parameters.

print_parameters()

Util function to print parameters of simulated kN.

Attributes

EOS_mass_to_rad

grey_opacity_emulator

opacity_data

threshold_mass

tov_mass

create_spectral_timeseries(KNE_parameters=None)[source]

Create the spectral energy density timeseries for this kilonova instance.

First layer wrapper function to FORTRAN library that computes the kilonova SED evolution.

Parameters:

KNE_parameters (list) – List of parameters needed to generate the kilonova SED. List format input instead of inputting mej, vej, etc. separately. Default=None.

self.phase

The phases in days where the kilonova SEDs are defined.

Type:

float array

self.wave

The discrete wavelengths at which fluxes are defined for a given phase.

Type:

float array

self.flux

The flux values for each combination of phase and wavelength.

Type:

float array

draw_from_binary_population()[source]

Draw from the population priors on masses and inclination. Wrapper to population functions to populate instance parameters with draws from the population distributions.

draw_parameters()[source]

Draw parameters not populated by the user.

Wrapper function to sample the generating parameter distributions from Setzer et al 2022.

self.param1

The gravitational mass of the first neutron star.

Type:

float

self.param2

The gravitational mass of the second neutron star.

Type:

float

self.param3

The stellar compactness of the first neutron star.

Type:

float

self.param4

The stellar compactness of the second neutron star.

Type:

float

self.param5

The viewing angle of the observer with respect to the merger.

Type:

float

self.param6

The electron fraction along the line of sight of the observer.

Type:

float

self.param7

The total ejecta mass of the expanding kilonova material.

Type:

float

self.param8

The mean ejecta velocity of the expanding kilonova material.

Type:

float

self.param9

The grey opacity of the material along the line of sight of the observer.

Type:

float

emulate_grey_opacity()[source]

Wrapper function to emulate the grey opacity as the last step in populating the transient instance with kilonova parameters.

enforce_emulator_bounds()[source]

Impose emulator boundary conditions for validity.

Imposes the boundary conditions we are limited to by our training data for the Gaussian process emulator.

If the drawn parameters not fall with the bounds re-draw consistently from the population.

map_mass_to_compactness()[source]

Wrapper function to the equation of state mappings. Using the inverse function interpolated from the given EOS mass-radius table, compute the compactness for a given mass.

map_to_kilonova_ejecta()[source]

Wrapper function to compute all of the kilonova ejecta, apart from emulation of the grey opacity given the ejecta parameters.

print_parameters()[source]

Util function to print parameters of simulated kN.