Base
base
¶
Base class for binary black hole population simulators.
Classes¶
BBHSimulator
¶
BBHSimulator(*args: object, seed: int | None = None, **kwargs: object)
Bases: RandomMixin, Simulator
Base class for binary black hole population simulator.
Initialize the instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
object
|
Positional arguments. |
()
|
seed
|
int | None
|
Random seed for reproducibility. |
None
|
**kwargs
|
object
|
Keyword arguments. |
{}
|
Attributes¶
parameter_names
property
¶
parameter_names: list[str]
Get the names of the parameters.
Definition of the parameters:
- detector_frame_mass_1: The mass of the first component object in the binary (in solar masses) in detector frame.
- detector_frame_mass_2: The mass of the second component object in the binary (in solar masses) in the detector frame.
- spin_1x: The x component of the first binary component's dimensionless spin.
- spin_1y: The y component of the first binary component's dimensionless spin.
- spin_1z: The z component of the first binary component's dimensionless spin.
- spin_2x: The x component of the second binary component's dimensionless spin.
- spin_2y: The y component of the second binary component's dimensionless spin.
- spin_2z: The z component of the second binary component's dimensionless spin.
- eccentricity: Eccentricity.
- distance: Luminosity distance to the binary (in Mpc).
- coa_phase: Coalescence phase of the binary (in rad).
- inclination: Inclination (rad), defined as the angle between the orbital angular momentum L and the line-of-sight at the reference frequency.
- theta_jn: The angle between the total angular momentum J and the line-of-sight.
- long_asc_node: Longitude of ascending nodes axis (rad).
- mean_per_ano: Mean anomaly of the periastron (rad).
- coa_time: Coalescence time (s) is the time when a GW reaches the origin of a certain coordinate system.
- right_ascension: Right ascension (rad).
- declination: Declination (rad).
- polarization_angle: Polarization angle (rad) in a certain coordinate system.
- redshift: Redshift.
- f_ref: The reference frequency that defines the spin components.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of parameter names. |
source_type
property
¶
source_type: str
rng_manager
property
¶
rng_manager: RNGManager
rng_key_data
property
¶
rng_key_data: Array
Get the key data of the random number generator.
Returns:
| Type | Description |
|---|---|
Array
|
Key data of the random number generator. |
Functions¶
register_node
¶
register_node(name: str, func: Callable, depends_on: list[str] | None = None) -> None
node
¶
node(depends_on: list[str] | None = None) -> Callable
simulate
¶
simulate(*args: object, **kwargs: object) -> Mapping[str, Array]
save
¶
save(output_path: str | Path, file_format: str | None = None, data: Mapping[str, Array] | Array | None = None, compression: str | None = None, metadata: dict[str, Any] | None = None) -> None
Save the simulated data to a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_path
|
str | Path
|
Path to save the file. |
required |
file_format
|
str | None
|
File format (npy, npz, csv, hdf5). If None, infers from extension. |
None
|
data
|
Mapping[str, Array] | Array | None
|
Data to save. If None, uses last simulated data. Mapping inputs
are converted to a 2D array with columns ordered by
|
None
|
compression
|
str | None
|
Optional compression setting for supported formats. For HDF5, this specifies the compression filter (e.g., "gzip"). For NPZ, any non-None value enables default zlib compression. |
None
|
metadata
|
dict[str, Any] | None
|
Optional metadata to store alongside the samples. |
None
|