Commit 3c38198d authored by Karl Wette's avatar Karl Wette
Browse files

Merge branch 'master' into 'master'

pulsarpputils.py: fix bug in conversion from Q22 to h0

See merge request !179
parents 2e9be355 b5cc8774
Pipeline #14508 passed with stages
in 25 minutes and 59 seconds
...@@ -2491,7 +2491,7 @@ def pulsar_nest_to_posterior(postfile, nestedsamples=False, removeuntrig=True): ...@@ -2491,7 +2491,7 @@ def pulsar_nest_to_posterior(postfile, nestedsamples=False, removeuntrig=True):
posfreqs = pos[pname].samples[0] posfreqs = pos[pname].samples[0]
elif pname == 'dist': elif pname == 'dist':
# try getting a fixed distance value (for calculating h0 from Q22 if required) # try getting a fixed distance value (for calculating h0 from Q22 if required)
posdist = pos[pname].samples[0] posdist = pos[pname].samples[0]/KPC
pos.pop(pname) pos.pop(pname)
else: else:
...@@ -2559,11 +2559,11 @@ def pulsar_nest_to_posterior(postfile, nestedsamples=False, removeuntrig=True): ...@@ -2559,11 +2559,11 @@ def pulsar_nest_to_posterior(postfile, nestedsamples=False, removeuntrig=True):
posQ22 = pos['q22'].samples posQ22 = pos['q22'].samples
if 'dist' in pos.names: if 'dist' in pos.names:
posdist = pos['dist'].samples # distance in metre (for use in converting Q22 to h0) posdist = pos['dist'].samples/KPC # distance in kpc (for use in converting Q22 to h0)
# convert distance samples to kpc # convert distance samples to kpc
pos.pop('dist') pos.pop('dist')
distpos = bppu.PosteriorOneDPDF('dist', posdist/KPC) distpos = bppu.PosteriorOneDPDF('dist', posdist)
pos.append(distpos) pos.append(distpos)
if 'f0' in pos.names: if 'f0' in pos.names:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment