Skip to content

Commit

Permalink
more polishing of documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
md-arif-shaikh committed Jun 12, 2024
1 parent 34b4555 commit f509a92
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 31 deletions.
51 changes: 33 additions & 18 deletions examples/gw_eccentricity_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@
" \n",
" Eccentricity is measured using the GW frequency omega_gw(t) =\n",
" d(phase_gw)/dt, where phase_gw(t) is the phase of the (2, 2) waveform mode\n",
" for nonprecessing systems. See `eccDefinition.get_amp_phase_omega_gw` for\n",
" more details. We currently only allow time-domain, nonprecessing\n",
" waveforms. We evaluate omega_gw(t) at pericenter times, t_pericenters, and\n",
" build a spline interpolant omega_gw_pericenters(t) using those data\n",
" points. Similarly, we build omega_gw_apocenters(t) using omega_gw(t) at the\n",
" apocenter times, t_apocenters.\n",
" for nonprecessing systems. For precessing systems, phase_gw is obtained\n",
" using an antisymmetric combination of (2, 2) and (2, -2) mode phases in the\n",
" coprecessing frame. See `eccDefinition.get_amp_phase_omega_gw` for more\n",
" details. We currently only allow time-domain, nonprecessing waveforms. We\n",
" evaluate omega_gw(t) at pericenter times, t_pericenters, and build a spline\n",
" interpolant omega_gw_pericenters(t) using those data points. Similarly, we\n",
" build omega_gw_apocenters(t) using omega_gw(t) at the apocenter times,\n",
" t_apocenters.\n",
" \n",
" Using omega_gw_pericenters(t) and omega_gw_apocenters(t), we first\n",
" compute e_omega_gw(t), as described in Eq.(4) of arXiv:2302.11257. We\n",
Expand All @@ -74,11 +76,12 @@
" \n",
" To find t_pericenters/t_apocenters, one can look for extrema in different\n",
" waveform data, like omega_gw(t) or amp_gw(t), the amplitude of the (2, 2)\n",
" mode for nonprecessing systems. See `eccDefinition.get_amp_phase_omega_gw`\n",
" for more details on amp_gw. Pericenters correspond to the local maxima,\n",
" while apocenters correspond to the local minima in the data. The method\n",
" option (described below) lets the user pick which waveform data to use to\n",
" find t_pericenters/t_apocenters.\n",
" mode for nonprecessing systems or a symmetric combination of amplitude of\n",
" (2, 2) and (2, -2) modes in the coprecessing frame for precessing systems,\n",
" see `get_amp_phase_omega_gw` for more details. Pericenters correspond to\n",
" the local maxima, while apocenters correspond to the local minima in the\n",
" data. The method option (described below) lets the user pick which waveform\n",
" data to use to find t_pericenters/t_apocenters.\n",
" \n",
" Parameters\n",
" ----------\n",
Expand Down Expand Up @@ -272,6 +275,18 @@
" https://github.com/vijayvarma392/gw_eccentricity/wiki/NR-investigation-to-set-default-number-of-orbits-to-exclude-before-merger\n",
" Default: 2.\n",
" \n",
" precessing: bool, default=False\n",
" Whether the system is precessing or not. For precessing systems, the\n",
" `dataDict` should contain modes computed in the intertial frame which\n",
" are rotated internally to obtain the same in the coprecessing\n",
" frame. Finally the modes in the coprecessing frame are used for\n",
" measuring eccentricity.\n",
" \n",
" For nonprecessing systems, there is no distiction between the inertial\n",
" and co-precessing frame since they are the same.\n",
" \n",
" Default is False which implies the system to be nonprecessing.\n",
" \n",
" extra_kwargs: A dict of any extra kwargs to be passed. Allowed kwargs are:\n",
" spline_kwargs:\n",
" Dictionary of arguments to be passed to the spline interpolation\n",
Expand Down Expand Up @@ -733,7 +748,7 @@
"metadata": {},
"source": [
"### **$\\omega_{\\mathrm{gw}}$ with the locations of apocenters and pericenters:**\n",
"This plot shows the $\\omega_{\\mathrm{gw}} = \\omega_{22}(t)$ with the locations of the apocenters and pericenters that are being used for measuring eccentricity indicated by circles.<br>\n",
"This plot shows the $\\omega_{\\mathrm{gw}} = \\omega_{22}(t)$ (because the system is nonprecessing) with the locations of the apocenters and pericenters that are being used for measuring eccentricity indicated by circles.<br>\n",
"This would show if the method is missing any local extrema or selecting spuriois extrema."
]
},
Expand Down Expand Up @@ -859,15 +874,15 @@
"source": [
"### **Averaged frequency vs Time:**\n",
"\n",
"Because $\\omega_{\\mathrm{gw}} = \\omega_{22}$ is nonmonotonic for eccentric binaries, we use omega_gw_average to get the reference time $t_{\\mathrm{ref}}$ given a reference\n",
"frequency $f_{\\mathrm{ref}}$ using omega_gw_average $(t_{\\mathrm{ref}}) = 2\\pi f_{\\mathrm{ref}}$. To enable a one-to-one map between $f_{\\mathrm{ref}}$ and the $t_{\\mathrm{ref}}$, omega22_average must be a monotonically increasing function of time.\n",
"Because $\\omega_{\\mathrm{gw}} = \\omega_{22}$ is nonmonotonic for eccentric binaries, we use `omega_gw_average` to get the reference time $t_{\\mathrm{ref}}$ given a reference\n",
"frequency $f_{\\mathrm{ref}}$ using `omega_gw_average` $(t_{\\mathrm{ref}}) = 2\\pi f_{\\mathrm{ref}}$. To enable a one-to-one map between $f_{\\mathrm{ref}}$ and the $t_{\\mathrm{ref}}$, `omega_gw_average` must be a monotonically increasing function of time.\n",
"\n",
"omega22_average defaults to $\\langle \\omega_{\\mathrm{gw}}\\rangle $, the orbit average of $\\omega_{\\mathrm{gw}} = \\omega_{22}$. See the documentation and Sec. IID of the PAPER for other options."
"`omega_gw_average` defaults to $\\langle \\omega_{\\mathrm{gw}}\\rangle $, the orbit average of $\\omega_{\\mathrm{gw}} = \\omega_{22}$. See the documentation and Sec. IID of the PAPER for other options."
]
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 10,
"id": "d82210d7-c612-496e-8f0b-ab67bb2f9b89",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -901,7 +916,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 11,
"id": "d35f06b1-a47c-497c-8bca-f8081f5f78a1",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -935,7 +950,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 12,
"id": "6cb5a05a-d584-4af4-a9d7-193af678da45",
"metadata": {},
"outputs": [
Expand Down
22 changes: 12 additions & 10 deletions gw_eccentricity/eccDefinition.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,10 @@ def __init__(self, dataDict, num_orbits_to_exclude_before_merger=2,
precessing: bool, default=False
Whether the system is precessing or not. For precessing systems,
the dataDict should contain modes computed in the intertial frame
which needs are transformed internally to co-precessing frame
before using it for measuring eccentricity.
the `dataDict` should contain modes computed in the intertial frame
which are rotated internally to obtain the same in the coprecessing
frame. Finally the modes in the coprecessing frame are used for
measuring eccentricity.
For nonprecessing systems, there is no distiction between the
inertial and co-precessing frame since they are the same.
Expand Down Expand Up @@ -289,12 +290,13 @@ def __init__(self, dataDict, num_orbits_to_exclude_before_merger=2,
raise Exception("Input time array must have uniform time steps.\n"
f"Time steps are {self.t_diff}")
# get amplitude, phase, omega to be used for eccentricity measurement.
# For precessing systems, even in the co-precessing frame, the (2, 2) mode
# quantities shows oscillations. To reduce the oscillations further,
# we use a combination of (2, 2) and (2, -2) mode to define new quantities
# amp_gw, phase_gw and omega_gw. For nonprecessing systems, these quantities
# reduce to the (2, 2) mode values. See `get_amp_phase_omega_gw` for more
# details
# For precessing systems, even in the coprecessing frame, the (2, 2)
# mode quantities show some oscillations due to the precession
# effect. To reduce these oscillations further, we use a combination of
# (2, 2) and (2, -2) mode in the coprecessing frame to define new
# quantities amp_gw, phase_gw and omega_gw. For nonprecessing systems,
# these quantities reduce to their respective (2, 2) mode values. See
# `get_amp_phase_omega_gw` for more details.
self.amp_gw, self.phase_gw, self.omega_gw \
= self.get_amp_phase_omega_gw()
# Sanity check various kwargs and set default values
Expand Down Expand Up @@ -552,7 +554,7 @@ def process_data_dict(self,
and (2, -2) mode in the coprecessing frame. See `get_amp_phase_omega_gw`
for more details.
This needs to be computed before the modes are truncated.
# TODO: Maybe we should use the ampitude from al modes and use the
# TODO: Maybe we should use the ampitude from all modes and use
# it's max value.
min_width_for_extrema : float
Minimum width for the `find_peaks` function. This is computed
Expand Down
7 changes: 4 additions & 3 deletions gw_eccentricity/gw_eccentricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,10 @@ def measure_eccentricity(tref_in=None,
precessing: bool, default=False
Whether the system is precessing or not. For precessing systems, the
dataDict should contain modes computed in the intertial frame which
needs are transformed internally to co-precessing frame before using it
for measuring eccentricity.
`dataDict` should contain modes computed in the intertial frame which
are rotated internally to obtain the same in the coprecessing
frame. Finally the modes in the coprecessing frame are used for
measuring eccentricity.
For nonprecessing systems, there is no distiction between the inertial
and co-precessing frame since they are the same.
Expand Down

0 comments on commit f509a92

Please sign in to comment.