LALSimulation  5.4.0.1-b72065a
NRSur3dq8Remnant.py
Go to the documentation of this file.
1 """
2 Class for NRSur3dq8Remnant model for the remnant mass, spin and kick velocity
3 for nonprecessing BBH systems. This model was called surfinBH3dq8 in the paper.
4 
5 Vijay Varma, 2019.
6 """
7 
8 import numpy as np
9 import lalsimulation as lalsim
10 import lal
11 
12 from .nrfits import NRFits
13 
15  r"""
16  Class for NRSur3dq8Remnant model for the remnant mass, spin and kick
17  velocity for nonprecessing BBH systems. This model was called surfinBH3dq8
18  in the paper.
19 
20  Paper: arxiv:1809.09125. The model is referred to as surfinBH3dq8 in the
21  paper.
22 
23  Parameter ranges for usage: \n
24  q = [1, 9.1] \n
25  \f$\chi_{1z}, \chi_{2z}\f$ = [-0.91, 0.91] \n
26  OR \n
27  q = [1, 10.1] \n
28  \f$\chi_{1z}, \chi_{2z}\f$ = [-0.81, 0.81]
29 
30  Training parameter ranges: \n
31  q = [1, 8] \n
32  \f$\chi_{1z}, \chi_{2z}\f$ = [-0.81, 0.81]
33 
34  But extrapolates reasonably to the above mass ratios and spins. However,
35  if a guarantee of accuracy is required, this model should be used within
36  the training parameter range.
37  """
38 
39  # ------------------------------------------------------------------------
40  def _get_fit_params(self, m1, m2, chiA_vec, chiB_vec, f_ref,
41  extra_params_dict):
42  """ No processing or spin evolution is required here, just returns the
43  mass ratio, total mass and spins along the z-direction.
44 
45  See eval_fits.eval_nrfit() for the definitions of the arguments of
46  this function.
47  """
48 
49  # f_ref is used to set the reference frame. For this model, only the
50  # final kick components depend on the reference frame. However, to set
51  # this at an arbitrary f_ref, we will need to know the orbital phase
52  # difference between f_ref and the time at which the fits are
53  # constructed, i.e. t=-100M from the peak of the total waveform
54  # amplitude. While this could be done using a waveform model, we don't
55  # expect the kick direction of this model to be very useful. So, we
56  # only allow f_ref = -1, which assumes that the reference epoch is at
57  # t=-100M. The kick direction can still be used, but it is always
58  # retured in this frame.
59  if f_ref != -1:
60  raise ValueError("This model only works for f_ref=-1.")
61 
62  q = m1/m2
63  fit_params = [q, chiA_vec[2], chiB_vec[2]]
64  return fit_params
65 
66  # ------------------------------------------------------------------------
67  def _eval_fit(self, fit_params, fit_type, extra_params_dict):
68  """ Evaluates a particular fit for NRSur3dq8Remnant using the fit_params
69  returned by _get_fit_params().
70  """
71  q, chiAz, chiBz = fit_params
72  LALParams = lal.CreateDict()
73  if extra_params_dict["unlimited_extrapolation"]:
74  lal.DictInsertUINT4Value(LALParams, "unlimited_extrapolation", 1)
75 
76  if fit_type == "FinalMass":
77  # FinalMass is given as a fraction of total mass
78  val = lalsim.NRSur3dq8Remnant(q, chiAz, chiBz, "mf", LALParams)
79  elif fit_type == "FinalSpin":
80  # chifx and chify are zero for aligned-spin systems
81  chifz = lalsim.NRSur3dq8Remnant(q, chiAz, chiBz, "chifz", LALParams)
82  val = [0,0,chifz]
83  elif fit_type == "RecoilKick":
84  # vfz is zero for aligned-spin systems
85  vfx = lalsim.NRSur3dq8Remnant(q, chiAz, chiBz, "vfx", LALParams)
86  vfy = lalsim.NRSur3dq8Remnant(q, chiAz, chiBz, "vfy", LALParams)
87  val = [vfx, vfy, 0]
88  else:
89  raise ValueError("Invalid fit_type=%s. This model only allows "
90  "'FinalMass', 'FinalSpin' and 'RecoilKick'."%fit_type)
91 
92  return np.atleast_1d(val)
Class for NRSur3dq8Remnant model for the remnant mass, spin and kick velocity for nonprecessing BBH s...
Base class for Numerical Relativity fits such as remnant BH mass, spin, etc.
Definition: nrfits.py:19