Skip to content

utils

inner_product(h1, h2, frequency, PSD) ¤

Do PSD interpolation outside the inner product loop to speed up the evaluation

Source code in jimgw/utils.py
 4
 5
 6
 7
 8
 9
10
11
12
@jit
def inner_product(h1, h2, frequency, PSD):
	"""
	Do PSD interpolation outside the inner product loop to speed up the evaluation
	"""
	#psd_interp = jnp.interp(frequency, PSD_frequency, PSD)
	df = frequency[1] - frequency[0]
	integrand = jnp.conj(h1)* h2 / PSD
	return 4. * jnp.real(jnp.trapz(integrand,dx=df))

m1m2_to_Mq(m1, m2) ¤

Transforming the primary mass m1 and secondary mass m2 to the Total mass M and mass ratio q.

Parameters:

Name Type Description Default
m1 float

Primary mass of the binary.

required
m2 float

Secondary mass of the binary.

required

Returns:

Type Description

A tuple containing both the total mass M and mass ratio q.

Source code in jimgw/utils.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@jit
def m1m2_to_Mq(m1: float,m2: float):
	"""
	Transforming the primary mass m1 and secondary mass m2 to the Total mass M
	and mass ratio q.

	Args:
		m1: Primary mass of the binary.
		m2: Secondary mass of the binary.

	Returns:
		A tuple containing both the total mass M and mass ratio q.
	"""
	M_tot = jnp.log(m1+m2)
	q = jnp.log(m2/m1)-jnp.log(1-m2/m1)
	return M_tot, q