From 159e85e983b0f892e7d9abda520050534588cf60 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:10:11 -0500 Subject: [PATCH] Update src/tdastro/math_nodes/ra_dec_sampler.py Co-authored-by: Konstantin Malanchev --- src/tdastro/math_nodes/ra_dec_sampler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tdastro/math_nodes/ra_dec_sampler.py b/src/tdastro/math_nodes/ra_dec_sampler.py index 795c2baa..ba7cac1d 100644 --- a/src/tdastro/math_nodes/ra_dec_sampler.py +++ b/src/tdastro/math_nodes/ra_dec_sampler.py @@ -49,7 +49,7 @@ def compute(self, graph_state, rng_info=None, **kwargs): # Generate the random (RA, dec) lists. ra = rng.uniform(0.0, 2.0 * np.pi, size=graph_state.num_samples) - dec = np.arccos(2.0 * rng.uniform(0.0, 1.0, size=graph_state.num_samples) - 1.0) - (np.pi / 2.0) + dec = np.arcsin(rng.uniform(-1.0, 1.0, size=graph_state.num_samples)) if self.use_degrees: ra = np.degrees(ra) dec = np.degrees(dec)