Skip to content

Commit

Permalink
Merge pull request #65 from zipengwang98/fix_Sphere_bounds
Browse files Browse the repository at this point in the history
Update prior.py
  • Loading branch information
kazewong authored Feb 2, 2024
2 parents 309a22d + 79f0cb4 commit c4f10dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/jimgw/prior.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,11 @@ def sample(
return self.add_name(jnp.stack([theta, phi, mag], axis=1).T)

def log_prob(self, x: dict[str, Float]) -> Float:
theta = x[self.naming[0]]
phi = x[self.naming[1]]
mag = x[self.naming[2]]
output = jnp.where(
(mag > 1) | (mag < 0),
(mag > 1) | (mag < 0) | (phi > 2* jnp.pi) | (phi < 0) | (theta > 1) | (theta < -1),
jnp.zeros_like(0) - jnp.inf,
jnp.log(mag**2 * jnp.sin(x[self.naming[0]])),
)
Expand Down

0 comments on commit c4f10dc

Please sign in to comment.