Skip to content
Snippets Groups Projects
Commit 80ca2c5f authored by Isaac McMahon's avatar Isaac McMahon Committed by Colm Talbot
Browse files

HealPixMapPriorDist Redundancy Fix

parent 80158c74
No related branches found
No related tags found
1 merge request!1323HealPixMapPriorDist Redundancy Fix
Pipeline #633940 failed
......@@ -29,6 +29,7 @@ Gregory Ashton
Hank Hua
Hector Estelles
Ignacio Magaña Hernandez
Isaac McMahon
Isobel Marguarethe Romero-Shaw
Jack Heinzel
Jacob Golomb
......
......@@ -1362,6 +1362,7 @@ class HealPixMapPriorDist(BaseJointPriorDist):
else:
self.distance = False
self.prob = self.hp.read_map(hp_file)
self.prob = self._check_norm(self.prob)
super(HealPixMapPriorDist, self).__init__(names=names, bounds=bounds)
self.distname = "hpmap"
......@@ -1501,9 +1502,7 @@ class HealPixMapPriorDist(BaseJointPriorDist):
sample : array_like
sample of ra, and dec (and distance if 3D=True)
"""
pixel_choices = np.arange(self.npix)
pixel_probs = self._check_norm(self.prob)
sample_pix = random.rng.choice(pixel_choices, size=size, p=pixel_probs, replace=True)
sample_pix = random.rng.choice(self.npix, size=size, p=self.prob, replace=True)
sample = np.empty((size, self.num_vars))
for samp in range(size):
theta, ra = self.hp.pix2ang(self.nside, sample_pix[samp])
......
......@@ -3,7 +3,7 @@
import re
import subprocess
special_cases = ["plasky", "thomas", "mj-will", "richard", "douglas"]
special_cases = ["plasky", "thomas", "mj-will", "richard", "douglas", "nixnyxnyx"]
AUTHORS_list = []
with open("AUTHORS.md", "r") as f:
AUTHORS_list = " ".join([line for line in f]).lower()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment