LALSimulation  5.4.0.1-b72065a
lalsimulation.nrfits.eval_fits Namespace Reference

Data Structures

class  FitAttributes
 Saves attributes of a particular fit. More...
 

Functions

def truncate_output_to_physical_limits (val_dict, behavior)
 Function to truncate fit values when they go beyond the following physical limits: More...
 
def check_extra_params_and_set_defaults (extra_params_dict)
 Does some sanity checks on extra_params_dict. More...
 
def eval_nrfit (m1, m2, chiA_vec, chiB_vec, model_name, fit_types_list, f_ref=-1, extra_params_dict=None)
 Evaluates Numerical Relativity fits for a given model. More...
 

Variables

dictionary fits_collection = {}
 
 fit_class
 
 desc
 
 refs
 
 model_keywords
 

Function Documentation

◆ truncate_output_to_physical_limits()

def lalsimulation.nrfits.eval_fits.truncate_output_to_physical_limits (   val_dict,
  behavior 
)

Function to truncate fit values when they go beyond the following physical limits:

  • FinalMass: 1, FinalMass is expected as a fraction of total mass here.
  • FinalSpin: magnitude = 1, the Kerr limit for dimensionless spins.
  • RecoilKick: magnitude = 1, as this is in units of c.

Inputs:

  • val_dict: A dictionary of fits with one or more of the above keys. See eval_nrfit.
  • behavior (str) can be one of the following:
    • "TRUNCATE": Rescale output magnitude to maximum limit, with an info message.
    • "TRUNCATESILENT": Rescale output magnitude to maximum limit, without info message
    • "KEEP": Keep output magnitude, even if unphysical, but still give the info message
    • "IGNORE": Keep output magnitude, even if unphysical, without info message
    • "ERROR": Abort with an error if output magnitude is unphysical.

Definition at line 93 of file eval_fits.py.

◆ check_extra_params_and_set_defaults()

def lalsimulation.nrfits.eval_fits.check_extra_params_and_set_defaults (   extra_params_dict)

Does some sanity checks on extra_params_dict.

If any of the default_keywords are not specified, sets them to the default values.

Definition at line 142 of file eval_fits.py.

◆ eval_nrfit()

def lalsimulation.nrfits.eval_fits.eval_nrfit (   m1,
  m2,
  chiA_vec,
  chiB_vec,
  model_name,
  fit_types_list,
  f_ref = -1,
  extra_params_dict = None 
)

Evaluates Numerical Relativity fits for a given model.

  • m1: mass of object 1 in kg.
    This needs to be in kg for models that allow f_ref != -1. When f_ref = -1, if other units are used for m1/m2, the remnant mass will be returned in the same units.
  • m2: mass of the object 2 in kg.
  • chiA_vec: dimensionless spin (3-vector) of object 1 at the reference epoch.
  • chiB_vec: dimensionless spin (3-vector) of object 2 at the reference epoch.
    This follows the same convention as the waveform interface (see https://dcc.ligo.org/T1800226/public), where the spin components are defined as:
    • \(\chi_z = \chi \cdot \hat{L}\), where \(L\) is the orbital angular momentum vector at the reference epoch.
    • \(\chi_x = \chi \cdot \hat{n}\), where \(n =\) body2 -> body1 is the separation vector pointing from body2 to body1 at the reference epoch.
    • \(\chi_y = \chi \cdot (\hat{L} \times \hat{n})\).
      These spin components are frame-independent as they are defined using vector inner products. One can also think of the above spins as being defined in the following reference frame: The positive z-axis is along the orbital angular momentum at the reference epoch. The separation vector from the object 2 to object 1 at the reference epoch is along the positive x-axis. The y-axis completes the right-handed triad. The returned vectors such as final spin and kick velocity are also defined in the same frame.
  • model_name: model used for fit.
    See lalsimulation.nrfits.eval_fits.fits_collection.keys() for all available fits. Details about a particular model, including its validity, can be found by doing the following:
    >> from lalsimulation.nrfits.eval_fits import fits_collection
    >> help(fits_collection[model_name].fit_class)
  • fit_types_list: List of fits to evaluate.
    Allowed values for elements are "FinalMass", "FinalSpin", "RecoilKick", and "PeakLuminosity".
    Example: fit_types_list = ["FinalMass", "FinalSpin"]
  • f_ref: reference frequency (in Hz) used to set the reference epoch.
    The reference epoch is set such that the orbital frequency is equal to f_ref/2. If f_ref = -1, the reference epoch is taken to be the time/frequency at which the fits were constructed. This can be different for different models, see the documentation for the specific model. Default: f_ref = -1.
  • extra_params_dict: Any additional parameters required for a specific model. Default: None.
    Allowed keys for extra_params_dict are:
    • Lambda1: Tidal deformability of object 1. Default: None.
    • Lambda2: Tidal deformability of object 2. Default: None.
    • eccentricity: Eccentricity at the reference epoch. Default: None.
    • mean_anomaly: Mean anomaly at the reference epoch. Default: None.
    • unlimited_extrapolation: Some models will raise an error if evaluated well outside their calibration range. If unlimited_extrapolation = True, then these errors are not raised and the model will still produce an output. USE AT YOUR OWN RISK!! Default: False.
    • physical_limit_violation_behavior: What to do if the fit values violate physical limits FinalMass > total mass, |FinalSpin| > 1, or |RecoilKick| > 1.
      Allowed options are (Default: "ERROR"):
      • "ERROR": Abort with an error message.
      • "TRUNCATE": Rescale output magnitude to maximum limit, with a warning.
      • "TRUNCATESILENT": Rescale output magnitude to maximum limit, without warning.
      • "KEEP": Keep output magnitude, but with a warning.
      • "IGNORE": Keep output magnitude, without warning.
  • Returns: return_dict.
    Dictionary of values corresponding to the keys in fit_types_list.
    Example: mf = return_dict["FinalMass"]

Definition at line 262 of file eval_fits.py.

Variable Documentation

◆ fits_collection

dictionary lalsimulation.nrfits.eval_fits.fits_collection = {}

Definition at line 48 of file eval_fits.py.

◆ fit_class

lalsimulation.nrfits.eval_fits.fit_class

Definition at line 51 of file eval_fits.py.

◆ desc

lalsimulation.nrfits.eval_fits.desc

Definition at line 52 of file eval_fits.py.

◆ refs

lalsimulation.nrfits.eval_fits.refs

Definition at line 55 of file eval_fits.py.

◆ model_keywords

lalsimulation.nrfits.eval_fits.model_keywords

Definition at line 56 of file eval_fits.py.