Skip to content

Commit

Permalink
the angle domain should be between (0, pi)
Browse files Browse the repository at this point in the history
  • Loading branch information
ismael-mendoza committed Nov 18, 2024
1 parent d9562a7 commit 9769cea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bpd/prior.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def sample_ellip_prior(rng_key, sigma: float, n: int = 1):
"""Sample n ellipticities isotropic components with Gary's prior from magnitude."""
key1, key2 = random.split(rng_key, 2)
e_mag = sample_mag_ellip_prior(key1, sigma=sigma, n=n)
e_phi = random.uniform(key2, shape=(n,), minval=0, maxval=2 * jnp.pi)
e_phi = random.uniform(key2, shape=(n,), minval=0, maxval=jnp.pi)
e1 = e_mag * jnp.cos(2 * e_phi)
e2 = e_mag * jnp.sin(2 * e_phi)
return jnp.stack((e1, e2), axis=1)
Expand Down

0 comments on commit 9769cea

Please sign in to comment.