From 1892c60636bd71df53e04fc40eae43076f547741 Mon Sep 17 00:00:00 2001 From: Tito Dal Canton Date: Wed, 18 Dec 2024 09:37:31 +0000 Subject: [PATCH] Fix errors --- pycbc/distributions/sky_location.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pycbc/distributions/sky_location.py b/pycbc/distributions/sky_location.py index 6398e51d502..3e3f4df5348 100644 --- a/pycbc/distributions/sky_location.py +++ b/pycbc/distributions/sky_location.py @@ -241,7 +241,7 @@ def pixel_corners(self, indices): [self.healpix_map.boundaries(pi, step=1) for pi in indices] ) - def normalize_azimuth(phi): + def normalize_azimuth(self, phi): """Helper function to ensure the azimuthal coordinate stays within [0,2π). """ @@ -269,7 +269,7 @@ def rvs(self, size): # especially for MOC maps. For MOC maps, I obtain around one million # samples per minute. - boundaries_vec = pixel_corners(pix_indices) + boundaries_vec = self.pixel_corners(pix_indices) boundaries_z_min = boundaries_vec[:,2,:].min(axis=1) boundaries_z_max = boundaries_vec[:,2,:].max(axis=1) @@ -289,7 +289,7 @@ def rvs(self, size): # We will shift the corresponding samples back after drawing them. straddler_mask = (boundaries_phi_max - boundaries_phi_min) > numpy.pi / 2 boundaries_phi[straddler_mask,:] -= numpy.pi / 2 - boundaries_phi[straddler_mask,:] = normalize_azimuth( + boundaries_phi[straddler_mask,:] = self.normalize_azimuth( boundaries_phi[straddler_mask,:] ) boundaries_phi_min[straddler_mask] = boundaries_phi[straddler_mask,:].min(axis=1) @@ -310,7 +310,7 @@ def rvs(self, size): # Now we can undo the shift for the straddlers. Ugly! random_phis[straddler_mask] += numpy.pi / 2 - random_phis[straddler_mask] = normalize_azimuth( + random_phis[straddler_mask] = self.normalize_azimuth( random_phis[straddler_mask] )