Get Apparent Horizon Information¶
The cactus_ah
module provides classes to access the
information about apparent horizons from various thorns. The main class
is CactusAH
which collects all available data from a
simulation.
- class postcactus.cactus_ah.AHorizon(diag, shape, ih)¶
Class representing all the information available on a given apparent horizon, from the thorns AHFinderDirect, QuasiLocalMeasures, and IsolatedHorizon. Data members are
- Variables
idx – AHFinderDirect AH index.
tformation – AH formation time.
ah – Information from AHFinderDirect (
BHDiags
)shape – AH shape from AHFinderDirect (
BHShape
)ih – Measures obtained using isolated horizon framework (
IsolatedHorizon
)
Constructor. No need to use this class directly, create a
CactusAH
instance instead to collect all BH info.
- class postcactus.cactus_ah.BHDiags(idx, files)¶
This class collects the information BH_Diagnostic files saved by the thorn AHFinderDirect for a given horizon. Data from different restarts will be merged transparently. The following variables are provided as
TimeSeries
.- Variables
it – Iteration number
pos_x – x-position of spherical surface center.
pos_y – y-position of spherical surface center.
pos_z – z-position of spherical surface center.
rmean – Mean coordinate radius.
m_irr – Irreducible BH mass.
r_circ_xy – Circumferential radius in xy plane.
r_circ_xz – Circumferential radius in xz plane.
r_circ_yz – Circumferential radius in yz plane.
The final values are named the same with a “_final” suffix. Other members are:
- Variables
idx – AHFinderDirect index of BH.
tmin – Time of first detection.
tmax – Final time.
itmin – Iteration at first detection.
itmax – Final iteration.
max_rmean – Maximum (over time) mean radius.
Constructor. No need to use this class directly, create a
CactusAH
instance instead to collect all BH info.- Parameters
idx (int) – The horizon index.
files – List of all BHDiagnostic files.
- class postcactus.cactus_ah.BHShape(idx, allfiles, it_vs_t)¶
This class represents the shape evolution of a given apparent horizon found by the thorn AHFinderDirect. The main use is a method to get a cut of the AH in a coordinate plane at specified time.
- Variables
idx – AHFinderDirect AH index.
available – Whether the shape is available for this AH.
If AH is available, the following members are defined:
- Variables
t_min – Time where shape becomes available.
t_max – Final time shape is available.
iter_min – Iteration at which shape becomes available.
iter_max – Final Iteration where shape is available.
Constructor. No need to use this class directly, create a
CactusAH
instance instead to collect all BH info.- Parameters
idx – The AH horizon index.
allfiles (list of str) – List of files that might contain AH data.
it_vs_t (
TimeSeries
) – The iteration number as function of time.
- get_ah_cut(time, dim, tol=None)¶
Get a cut of the AH in a given coordinate plane.
- Parameters
time (float) – Time for which to get AH cut.
dim (int) – Direction of normal vector.
tol (float or None.) – Tolerance for time match. Default: infinite.
- Returns
Coordinates of AH outline.
- Return type
tuple of two 1D numpy arrays.
- get_ah_patches(time, tol=None)¶
Get the AH patches at a given time.
- Parameters
time (float) – Time for which to get AH cut.
tol (float or None.) – Tolerance for time match. Default: infinite.
- Returns
The available horizon patches.
- Return type
Dictionary patch name -> three 2D arrays x,y,z
- has_cut_at_time(t, tol=None)¶
Whether shape is available at a given time
- Parameters
t (float) – Time.
tol (float or None.) – Tolerance for time match. Default: infinite.
- Returns
If shape info is available.
- Return type
bool
- has_cut_for_it(it, tol=None)¶
Whether shape is available at iteration it.
- Parameters
it (int) – Iteration.
tol (int or None.) – Tolerance for iteration number match. Default: infinite.
- Returns
If shape info is available.
- Return type
bool
- class postcactus.cactus_ah.CactusAH(sd)¶
Class to collect information on apparent horizons available from thorns AHFinderDirect, IsolatedHorizon, and QuasiLocalMeasures. The following members are defined.
- Variables
horizons – All horizons (list of
AHorizon
).found_any – True if at least one horizon was found.
largest – Horizon with largest mean radius or None.
tformation – Formation time or None.
Iterating over CactusAH objects means iterating over the horizons.
Constructor.
- Parameters
sd (SimDir) – SimDir object providing access to data directory.
Note
In order to relate IsolatedHorizon and QuasiLocalMeasures surfaces to AH indices, the parameter file is required. Unfortunately, even if the data is available, it cannot be accessed if the parameters are not provided.
- class postcactus.cactus_ah.IsolatedHorizon(surf_idx, sts)¶
This class represents properties of an apparent horizon computed from the isolated horizon formalism.
The following variables are provided as
TimeSeries
:- Variables
M – Mass of the BH.
M_irr – Irreducible mass of the BH.
J – Angular momentum of the BH.
J_x – x-component of angular momentum.
J_y – y-component of angular momentum.
J_z – z-component of angular momentum.
area – Horizon area.
dimless_a – Dimensionless spin parameter of the BH.
circ_radius_xy – Circumferential radius of AH in xy plane.
circ_radius_xz – Circumferential radius of AH in xz plane.
circ_radius_yz – Circumferential radius of AH in yz plane.
Those are taken from the QuasilocalMeasures thorn output, if available, else from IsolatedHorizon. Results from both thorns are kept under the same name with prefixes “ih_” and “qlm_”. For each timeseries a boolean variable with prefix “has_” reports if the information is available or not. Variables with suffix “_final” provide the values at the end of the simulation. Printing this class (or conversion to string) results in human readable summary.
Constructor. No need to use this class directly, create a
CactusAH
instance instead to collect all BH info.- Parameters
surf_idx (int) – The SphericalSurface index of the AH.
sts (
CactusDirTS
) – Where to get the TimeSeries from.