bilby.gw.eos.eos.TabularEOS
- class bilby.gw.eos.eos.TabularEOS(eos, sampling_flag=False, warning_flag=False)[source]
Bases:
object
Given a valid eos input format, such as 2-D array, an ascii file, or a string, parse, and interpolate
- Parameters:
- eos: (numpy.ndarray, str, ASCII TABLE)
if numpy.ndarray then user supplied pressure-density 2D numpy array. if str then given a valid eos name, relevant preshipped ASCII table will be loaded if ASCII TABLE then given viable file extensions, which include .txt,.dat, etc (np.loadtxt used), read in pressure density from file.
- sampling_flag: bool
Do you plan on sampling the parameterized EOS? Highly recommended. Defaults to False.
- warning_flag: bool
Keeps track of status of various physical checks on EoS.
- Attributes:
- msg: str
Human readable string describing the exception.
- code: int
Exception error code.
- __call__(*args, **kwargs)
Call self as a function.
Methods
__init__
(eos[, sampling_flag, warning_flag])Checks to see if the equation of state is causal i.e. the speed of sound in the star is less than the speed of light.
Checks to see if the equation of state is monotonically increasing in energy density-pressure space.
dedh
(pseudo_enthalpy[, rel_dh, interp_type])Value of [depsilon/dh](p)
dedp
(pressure[, rel_dp, interp_type])Find value of [depsilon/dp](p)
energy_density_from_pseudo_enthalpy
(...[, ...])Find energy_density_from_pseudo_enthalpy(pseudo_enthalpy) as in lalsimulation, return e = K * h**(3./2.) below min enthalpy
energy_from_pressure
(pressure[, interp_type])Find value of energy_from_pressure as in lalsimulation, return e = K * p**(3./5.) below min pressure
plot
(rep[, xlim, ylim, units])Given a representation in the form 'energy_density-pressure', plot the EoS in that space.
pressure_from_pseudo_enthalpy
(pseudo_enthalpy)Find p(h) as in lalsimulation, return p = K * h**(5./2.) below min enthalpy
pseudo_enthalpy_from_energy_density
(...[, ...])Find h(epsilon) as in lalsimulation, return h = K * e**(2./3.) below min enthalpy
velocity_from_pseudo_enthalpy
(pseudo_enthalpy)Returns the speed of sound in geometerized units in the neutron star at the specified pressure.
- check_causality()[source]
Checks to see if the equation of state is causal i.e. the speed of sound in the star is less than the speed of light. Returns True if causal, False if not.
- check_monotonicity()[source]
Checks to see if the equation of state is monotonically increasing in energy density-pressure space. Returns True if monotonic, False if not.
- dedh(pseudo_enthalpy, rel_dh=1e-05, interp_type='CubicSpline')[source]
Value of [depsilon/dh](p)
- Parameters:
(float) (rel_dh) – Dimensionless pseudo-enthalpy.
(str) (interp_type) – String specifying interpolation type. Current implementations are ‘CubicSpline’, ‘linear’.
(float) – Relative step size in pseudo-enthalpy space.
- Return dedh (float)float):
Derivative of energy-density with respect to pseudo-enthalpy evaluated at pseudo_enthalpy in geometerized units.
- dedp(pressure, rel_dp=1e-05, interp_type='CubicSpline')[source]
Find value of [depsilon/dp](p)
- Parameters:
(float) (interp_type) – pressure in geometerized units.
(float) – Relative step size in pressure space.
(float) – String specifying interpolation type. Current implementations are ‘CubicSpline’, ‘linear’.
- Return dedp (float)float):
Derivative of energy-density with respect to pressure evaluated at pressure.
- energy_density_from_pseudo_enthalpy(pseudo_enthalpy, interp_type='CubicSpline')[source]
Find energy_density_from_pseudo_enthalpy(pseudo_enthalpy) as in lalsimulation, return e = K * h**(3./2.) below min enthalpy
- Parameters:
(float) (pseudo_enthalpy) – Dimensionless pseudo-enthalpy.
(str) (interp_type) – String specifying interpolation type. Current implementations are ‘CubicSpline’, ‘linear’.
- Return energy_density (float)float):
energy-density in geometerized units.
- energy_from_pressure(pressure, interp_type='CubicSpline')[source]
Find value of energy_from_pressure as in lalsimulation, return e = K * p**(3./5.) below min pressure
- Parameters:
- pressure: float
pressure in geometerized units.
- interp_type: str
String specifying which interpolation type to use. Currently implemented: ‘CubicSpline’, ‘linear’.
- energy_density: float
energy-density in geometerized units.
- plot(rep, xlim=None, ylim=None, units=None)[source]
Given a representation in the form ‘energy_density-pressure’, plot the EoS in that space.
- Parameters:
- rep: str
Representation to plot. For example, plotting in energy_density-pressure space, specify ‘energy_density-pressure’
- xlim: list
Plotting bounds for x-axis in the form [low, high]. Defaults to ‘None’ which will plot from 10% below min x value to 10% above max x value
- ylim: list
Plotting bounds for y-axis in the form [low, high]. Defaults to ‘None’ which will plot from 10% below min y value to 10% above max y value
- units: str
Specifies unit system to plot. Currently can plot in CGS:’cgs’, SI:’si’, or geometerized:’geom’
- Returns:
- fig: matplotlib.figure.Figure
EOS plot.
- pressure_from_pseudo_enthalpy(pseudo_enthalpy, interp_type='CubicSpline')[source]
Find p(h) as in lalsimulation, return p = K * h**(5./2.) below min enthalpy
- Parameters:
(float) (pseudo_enthalpy) – Dimensionless pseudo-enthalpy.
- Interp_type (str)str):
String specifying interpolation type. Current implementations are ‘CubicSpline’, ‘linear’.
- Return pressure (float)float):
pressure in geometerized units.
- pseudo_enthalpy_from_energy_density(energy_density, interp_type='CubicSpline')[source]
Find h(epsilon) as in lalsimulation, return h = K * e**(2./3.) below min enthalpy
- Parameters:
(float) (energy_density) – energy-density in geometerized units.
(str) (interp_type) – String specifying interpolation type. Current implementations are ‘CubicSpline’, ‘linear’.
- Return pseudo_enthalpy (float)float):
Dimensionless pseudo-enthalpy.
- velocity_from_pseudo_enthalpy(pseudo_enthalpy, interp_type='CubicSpline')[source]
Returns the speed of sound in geometerized units in the neutron star at the specified pressure.
Assumes the equation vs = c (de/dp)^{-1/2}
- Parameters:
(float) (pseudo_enthalpy) – Dimensionless pseudo-enthalpy.
(str) (interp_type) – String specifying interpolation type. Current implementations are ‘CubicSpline’, ‘linear’.
- Return v_s (float)float):
Speed of sound at pseudo-enthalpy in geometerized units.