Skip to content

Commit

Permalink
Merge branch 'nanograv:master' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
astrolamb authored Jul 12, 2024
2 parents 57fbe07 + d91baf2 commit 6289d56
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions enterprise_extensions/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@ def __init__(self, pta, snames=None, empirical_distr=None, f_stat_file=None, sav
self.ndim = sum(p.size or 1 for p in pta.params)
self.plist = [p.name for p in pta.params]

# parameter dictionary
self.params_dict = {}
for p in self.params:
if p.size:
for ii in range(0, p.size):
self.params_dict.update({p.name + "_{}".format(ii): p})
else:
self.params_dict.update({p.name: p})

# parameter map
self.pmap = {}
ct = 0
Expand Down Expand Up @@ -530,8 +539,8 @@ def draw_from_gwb_log_uniform_distribution(self, x, iter, beta):
# draw parameter from signal model
signal_name = [par for par in self.pnames
if ('gw' in par and 'log10_A' in par)][0]
idx = list(self.pnames).index(signal_name)
param = self.params[idx]

param = self.params_dict[signal_name]

q[self.pmap[str(param)]] = np.random.uniform(param.prior._defaults['pmin'], param.prior._defaults['pmax'])

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ scikit-sparse>=0.4.5
pint-pulsar>=0.8.2
libstempo>=2.4.0
enterprise-pulsar>=3.3.0
scikit-learn==0.24
scikit-learn==1.0.1
emcee
ptmcmcsampler
numdifftools

0 comments on commit 6289d56

Please sign in to comment.