Horizons#
Horizons
class#
Bases: object
Container object for several HorizonQuantities objects
Parameters:
Name | Type | Description | Default |
---|---|---|---|
A |
HorizonQuantities
|
If these are not given, they will be |
required |
B |
HorizonQuantities
|
If these are not given, they will be |
required |
C |
HorizonQuantities
|
If these are not given, they will be |
required |
Attributes:
Name | Type | Description |
---|---|---|
A, B, C, a, b, c |
{HorizonQuantities, None}
|
The lowercase versions are simply aliases for the uppercase ones. |
Methods:
Name | Description |
---|---|
__getitem__ |
Indexes the individual HorizonQuantities objects, and optionally passes indexes through to the underlying object. See below for explanation. |
See also
HorizonQuantities : Containers for data pertaining to each of the horizons
Notes
This is a small container to provide an interface for several HorizonQuantities
objects, which can be accessed in several ways. Up to three horizons are
supported, and are named A, B, and C. Typically A and B will represent objects
in a merging binary and C will represent the remnant, though this convention is
not enforced. It is expected that components that do not have horizons (e.g.,
neutron stars) will be represented as None
rather than HorizonQuantities
objects. If this object is named horizons
, each individual horizon can be
accessed in any of these ways:
horizons.A
horizons.a
horizons["A"]
horizons["a"]
horizons["AhA.dir"]
and similarly for B and C. These different ways of accessing A
are
essentially aliases; they return precisely the same object. In addition, the
attributes of those horizon objects are passed through — for example, as
horizons.A.time
horizons["A/time"]
to access the time data for horizon A, or
horizons.A.coord_center_inertial
horizons["A/coord_center_inertial"]
horizons["AhA.dir/CoordCenterInertial"]
horizons["AhA.dir/CoordCenterInertial.dat"]
These are equivalent and return precisely the same thing, except for the last
one. If an attribute ends with ".dat", the returned quantity will be the
quantity that appears in a SpEC-format Horizons.h5 file, which is "horizontally
stacked" (via np.hstack
) with the time data. That is, rather than being an
Nx3 vector-valued function of time, when this attribute ends with ".dat" it
returns an Nx4 array. For scalar-valued functions of time, the returned object
has shape Nx2, rather than just N. This provides full backward compatibility
with SpEC-format Horizons.h5 files, in the sense that a Horizons
object can
be indexed in exactly the same way as a Horizons.h5 file. Also note that the
function sxs.loadcontext
provides a context manager just like h5py
:
with sxs.loadcontext("Horizons.h5") as f:
time = f["AhA.dir/ArealMass.dat"][:, 0]
areal_mass = f["AhA.dir/ArealMass.dat"][:, 1]
This code is identical to the equivalent code using h5py
except that the call
to h5py.File
is replaced with the call to sxs.loadcontext
. The .dat
datasets are re-computed on the fly.
Source code in sxs/horizons/__init__.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
|
l̂
property
#
Normalized angular-velocity vector
This function can be spelled ℓ̂
or ellhat
, interchangeably.
Returns:
Type | Description |
---|---|
ℓ̂ : ndarray
|
This has shape (self.A.n_times, 3), representing the components of the vector as a function of time. |
See Also
n⃗, nvec, separation : (Non-normalized) separation vector between two horizons n̂, nhat : Normalized separation vector λ̂, lambdahat : Normalized time-derivative of n̂
Notes
Note that (n̂, λ̂, ℓ̂) forms a right-handed frame, which is commonly used in post-Newtonian theory and similar treatments.
newtonian_com
property
#
Newtonian center of mass as function of time
This returns only the center of mass of the binary components; the center of
mass of the common horizon is just horizons.C.coord_center_inertial
.
Returns:
Name | Type | Description |
---|---|---|
com |
ndarray
|
This has shape (self.A.n_times, 3), representing the components of the vector as a function of time. |
See Also
average_com_motion : fit uniform motion to this result
Notes
This just evaluates the simple formula
(m_A * x_A + m_B * x_B) / (m_A + m_B)
where the masses are the respective Christodoulou masses, and the positions are
taken from the coord_center_inertial
properties of the respective horizons.
This is highly susceptible to the vagaries of gauge, and must always be taken
with plentiful grains of salt.
n̂
property
#
Unit vector pointing from horizon A to horizon B
This function can be spelled n̂
or nhat
, interchangeably.
Returns:
Type | Description |
---|---|
n̂ : ndarray
|
This has shape (self.A.n_times, 3), representing the components of the vector as a function of time. |
See Also
n⃗, nvec, separation : Non-normalized version of this vector λ̂, lambdahat : Normalized time-derivative of n̂ ℓ̂, ellhat : Normalized angular-velocity vector
Notes
Note that (n̂, λ̂, ℓ̂) forms a right-handed frame, which is commonly used in post-Newtonian theory and similar treatments.
n⃗
property
#
Vector pointing from horizon A to horizon B
This function can be spelled n⃗
, nvec
, or separation
, interchangeably.
Returns:
Type | Description |
---|---|
n⃗ : ndarray
|
This has shape (self.A.n_times, 3), representing the components of the vector as a function of time. |
See Also
n̂, nhat : Normalized version of this vector λ̂, lambdahat : Normalized time-derivative of n̂ ℓ̂, ellhat : Normalized angular-velocity vector of n̂
λ̂
property
#
Time-derivative of normalized separation vector
This function can be spelled λ̂
or lambdahat
, interchangeably.
Returns:
Type | Description |
---|---|
λ̂ : ndarray
|
This has shape (self.A.n_times, 3), representing the components of the vector as a function of time. |
See Also
n⃗, nvec, separation : (Non-normalized) separation vector between two horizons n̂, nhat : Normalized separation vector ℓ̂, ellhat : Normalized angular-velocity vector
Notes
Note that (n̂, λ̂, ℓ̂) forms a right-handed frame, which is commonly used in post-Newtonian theory and similar treatments.
average_com_motion(skip_beginning_fraction=0.01, skip_ending_fraction=0.1)
#
Fit uniform motion to measured Newtonian center of mass
Parameters:
Name | Type | Description | Default |
---|---|---|---|
skip_beginning_fraction |
float
|
Exclude this portion from the beginning of the data. Note that this is a fraction, rather than a percentage. The default value is 0.01, meaning the first 1% of the data will be ignored. |
0.01
|
skip_ending_fraction |
float
|
Exclude this portion from the end of the data. Note that this is a fraction, rather than a percentage. The default value is 0.10, meaning the last 10% of the data will be ignored. |
0.1
|
Returns:
Name | Type | Description |
---|---|---|
x_i |
length-3 array of floats
|
Best-fit initial position of the center of mass |
v_i |
length-3 array of floats
|
Best-fit initial velocity of the center of mass |
t_i |
float
|
Initial time used. This is determined by the |
t_f |
float
|
Final time used. This is determined by the |
See Also
newtonian_com : measured quantity as function of time
Notes
See the docstring of newtonian_com
for some relevant caveats. The
translation to be applied to the data should be calculated given the values
returned by this function as
com_average = sxs.TimeSeries(
x_i[np.newaxis] + v_i[np.newaxis] * horizons.A.time[:, np.newaxis],
horizons.A.time
)
Source code in sxs/horizons/__init__.py
HorizonQuantities
class#
Bases: object
Container object for various TimeSeries related to an individual horizon
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time |
(N,) array_like
|
Times at which the horizon quantities are measured. |
required |
areal_mass |
(N,) array_like
|
The areal (or irreducible) mass of the horizon, defined as the square-root of its surface area divided by 16π, where area is measured as a function of time. |
required |
christodoulou_mass |
(N,) array_like
|
The Christodoulou mass |
required |
coord_center_inertial |
(N, 3) array_like
|
Cartesian coordinates of the center of the apparent horizon, in the "inertial frame," the asymptotically inertial frame in which the gravitational waves are measured. |
required |
dimensionful_inertial_spin |
(N, 3) array_like
|
Cartesian vector components of the spin angular momentum measured on the apparent horizon in the "inertial frame". |
required |
chi_inertial |
(N, 3) array_like
|
Cartesian components of the spin angular momentum measured in the "inertial frame", made dimensionless by dividing by the square of the Christodoulou mass. |
required |
Attributes:
Name | Type | Description |
---|---|---|
All of the above parameters are converted to TimeSeries objects and accessible |
|
|
as attributes, along with the following |
|
|
dimensionful_inertial_spin_mag |
(N,) TimeSeries
|
Euclidean norm of the |
chi_inertial_mag |
(N,) TimeSeries
|
Euclidean norm of the |
chi_mag_inertial |
(N,) TimeSeries
|
Euclidean norm of the |
Methods:
Name | Description |
---|---|
__getitem__ |
Another interface for accessing the attributes, with more flexibility. See below for explanation. |
Notes
In addition to the standard attribute access, as in
horizon.coord_center_inertial
it is also possible to access that attribute equivalently via indexing as
horizon["coord_center_inertial"]
horizon["CoordCenterInertial"]
Here, the latter is simply an alias for the former. For backwards
compatibility, it is also possible to access the attributes "horizontally
stacked" (via np.hstack
) with the time data. That is, rather than being an
Nx3 vector-valued function of time as returned above, when an attribute ends
with ".dat" it returns an Nx4 array:
horizon["CoordCenterInertial.dat"]
The result of that call can be sliced as [:, 0]
to access the time data and
[:, 1:]
to access the 3-d vector as a function of time. Together with
related behavior in the Horizons
class, this provides full backward
compatibility with SpEC-format Horizons.h5 files, in the sense that a
Horizons
object can be indexed in exactly the same way as a Horizons.h5 file.
Source code in sxs/horizons/__init__.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|