Skip to content

Commit

Permalink
Add hyperbolic property to SimulationsDataFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
moble committed Oct 24, 2024
1 parent f73f69b commit 64e87a7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sxs/simulations/simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ def IMR(self):
np.isfinite(df["reference_eccentricity"])
& np.isfinite(df["remnant_mass"])
])

@property
def hyperbolic(self):
"""Restrict dataframe to just hyperbolic systems
The criterion used here is that the (normalized) ADM mass is
greater than 1.
"""
total_mass = self["initial_mass1"] + self["initial_mass2"]
normalized_ADM = self["initial_ADM_energy"] / total_mass
return type(self)(self[
np.isfinite(total_mass) & (total_mass > 0) & (normalized_ADM > 1)
])


class Simulations(collections.OrderedDict):
Expand Down

0 comments on commit 64e87a7

Please sign in to comment.