Reference on kuibit.cactus_horizons¶
The cactus_horizons
module provides classes to access the
information about apparent horizons from QuasiLocalMeasures and AHFinderDirect
(including shape files).
The main class is HorizonsDir
which collects all available data
from a SimDir
. This is a dictionarylike object whose values can
be accessed providing two integers. The first is the QuasiLocalMeasures index,
the second is the AHFinderDirect (we need two indices because at the moment we
have no way to connect the two indexing systems). If only one of the two is
available, the other index can be a dummy.
Once an horizon is selected with a combination of QLM and AHFinderDirect
indices, the resulting object is a OneHorizon
.
OneHorizon
contains as attributes all the QLM variables.
Similarly, the attribute ah
contains all the variables read from
AHFinderDirect. All of these are represented as TimeSeries
.
OneHorizon
also contains the shapes of the horizons (if the files
are found), which can be accessed with the methods
shape_at_iteration()
and shape_outline_at_iteration()
.
The module contains also functions to work with horizons:
compute_horizons_separation()
, which takes twoOneHorizon
and returns the timeseries of their separation

class
kuibit.cactus_horizons.
HorizonsDir
(sd)[source]¶ Class to collect information on apparent horizons available from thorns AHFinderDirect and QuasiLocalMeasures.
 Variables
found_any – True if at least one horizon was found.
AHFinderDirect and QuasiLocalMeasures have different indexing. You must provide both when accessing a file. In the future, the map between the two indexing systems will be inferred from the paramter file.
Constructor.
 Parameters
sd (SimDir) – SimDir object providing access to data directory.

property
available_apparent_horizons
¶ Horizons in AH indexing with associated data.
 Returns
Indices of the AH horizons found in the data.
 Return type
list

property
available_qlm_horizons
¶ Horizons in QLM indexing with associated data.
 Returns
Indices of the QLM horizons found in the data.
 Return type
list

class
kuibit.cactus_horizons.
OneHorizon
(qlm_vars, ah_vars, shape_files)[source]¶ This class represents properties of an apparent horizon computed from the quasiisolated horizon formalism.
All the variables from QuasiLocalMeasures are available as
TimeSeries
as attributes. All the ones from AHFinderDirect are attributes of the attributeah
. Variables
formation_time – First time at which the horizon has been found (as from AHFinderDirect).
mass_final – QLM mass at the last iteration available.
spin_final – QLM spin (angular momentum) at the last iteration available.
dimensionless_spin_final – Dimensionless spin computed from QLM variables at the last iteration available.
shape_available – Whether the shape files are available.
shape_iterations – Iterations at which the shape is available.
shape_iterations_min – First iteration at which the shape is available.
shape_iterations_max – Last iteration at which the shape is available.
shape_times – Times at which the shape is available.
shape_times_min – First time at which the shape is available.
shape_times_max – Last time at which the shape is available.
ah – All the variables from AHFinderDirect as
TimeSeries
.
Constructor.
 Parameters
qlm_vars (dict) – Dictionary that maps the name of the QLM variable with the associated
TimeSeries
.ah_vars (dict) – Dictionary that maps the name of the AH variable with the associated
TimeSeries
.shape_files (dict) – Dictionary that maps the iteration to the files where to find the shape at that iteration.

ah_origin_at_iteration
(iteration)[source]¶ Return the AH origin at the given iteration.
 Parameters
iteration (int) – Iteration number.
 Returns
Origin of the horizon as from AHFinderDirect.
 Return type
3D NumPy array

get_ah_property
(key)[source]¶ Return a property from AHFinderDirect as timeseries.
 Parameters
key (str) – AH property.
 Returns
AH property as a function of time.
 Return type

shape_at_iteration
(iteration)[source]¶ Return the shape of the horizon as 3 arrays with the coordinates of the points.
 Parameters
iteration (int) – Iteration number.
 Returns
Shape of the horizon.
 Return type
three lists of 2D NumPy arrays, one for each coordinate. The list is over the different patches.

shape_at_time
(time, tolerance=1e10)[source]¶ Return the shape of the horizon as 3 arrays with the coordinates of the points.
 Parameters
time (float) – Time.
tolerance (float) – Tolerance in determining the time.
 Returns
Shape of the horizon.
 Return type
three lists of 2D NumPy arrays, one for each coordinate. The list is over the different patches.

shape_outline_at_iteration
(iteration, cut)[source]¶ Return the cut of the 3D shape on a specified plane.
cut
has to be a 3D tuple or list with None on the dimensions you want to keep, and the value of the other coordinates. For example, if you want the outline at z = 3 on the xy plane,cut
has to be(None, None, 3)
.No interpolation is performed, so results are not accurate when the cut is not along one of the major directions centered in the origin of the horizon.
 Parameters
iteration (int) – Iteration number.
cut (3D tuple) – How should the horizon be sliced?
 Returns
Coordinates of AH outline.
 Return type
tuple of two 1D NumPy arrays.

shape_outline_at_time
(time, cut, tolerance=1e10)[source]¶ Return the cut of the 3D shape on a specified plane.
cut
has to be a 3D tuple or list with None on the dimensions you want to keep, and the value of the other coordinates. For example, if you want the outline at z = 3 on the xy plane,cut
has to be(None, None, 3)
.No interpolation is performed, so results are not accurate when the cut is not along one of the major directions centered in the origin of the horizon.
 Parameters
time (float) – Time.
tolerance (float) – Tolerance in determining the time.
cut (3D tuple) – How should the horizon be sliced?
 Returns
Coordinates of AH outline.
 Return type
tuple of two 1D NumPy arrays.

kuibit.cactus_horizons.
compute_horizons_separation
(horizon1, horizon2, resample=True)[source]¶ Compute the coordinate separation between the centroids of two horizons.
The information from the apparent horizons is used (contained in the BHDiagnostics files).
 Parameters
horizon1 (
OneHorizon
) – First horizon.horizon2 (
OneHorizon
) – Second horizon.
 Returns
Coordinate distance between the two centroids, sampled over both the horizons are available.
 Return type