Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ imaged planets. A detailed description of how τ is related to other quantities

Our goal with the default prior is to have an isotropic distribution of the orbital plane.
To obtain this, we use inclination and position angle of the ascending node (PAN) to
define the orbital plane. They actually coorespond to the two angles in a spherical coordinate system:
inclinaion is the polar angle and PAN is the azimuthal angle. Becuase of this choice of coordinates,
define the orbital plane. They actually correspond to the two angles in a spherical coordinate system:
inclination is the polar angle and PAN is the azimuthal angle. Because of this choice of coordinates,
there are less orbital configurations near the poles (when inclination is near 0 or 180), so we use
a sine prior to downweigh those areas to give us an isotropic distribution.
a sine prior to downweight those areas to give us an isotropic distribution.
A more detailed discussion of this is here:

.. toctree::
Expand Down
4 changes: 3 additions & 1 deletion orbitize/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class Driver(object):
input_data: Either a relative path to data file or astropy.table.Table object
in the orbitize format. See ``orbitize.read_input``
sampler_str (str): algorithm to use for orbit computation. "MCMC" for
Markov Chain Monte Carlo, "OFTI" for Orbits for the Impatient
Markov Chain Monte Carlo, "OFTI" for Orbits for the Impatient,
"NestedSampler" for nested sampling with Dynesty, or "MultiNest"
for nested sampling with (Py)MultiNest.
num_secondary_bodies (int): number of secondary bodies in the system.
Should be at least 1.
stellar_or_system_mass (float): mass of the primary star (if fitting for
Expand Down
25 changes: 19 additions & 6 deletions orbitize/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def __init__(
self.lnlike = lnlike
self.curr_pos = curr_pos
self.version_number = version_number
self.ln_evidence = None
self.ln_evidence_err = None

if self.system is not None:
self.tau_ref_epoch = self.system.tau_ref_epoch
Expand Down Expand Up @@ -114,6 +116,12 @@ def save_results(self, filename):
hf.attrs['sampler_name'] = self.sampler_name
hf.attrs['version_number'] = self.version_number

if self.ln_evidence is not None:
hf.attrs['ln_evidence'] = self.ln_evidence

if self.ln_evidence_err is not None:
hf.attrs['ln_evidence_err'] = self.ln_evidence_err

# Now add post and lnlike from the results object as datasets
hf.create_dataset('post', data=self.post)
# hf.create_dataset('data', data=self.data)
Expand Down Expand Up @@ -147,19 +155,18 @@ def load_results(self, filename, append=False):
hf = h5py.File(filename, 'r') # Opens file for reading
# Load up each dataset from hdf5 file
sampler_name = str(hf.attrs['sampler_name'])
try:
if 'version_number' in hf.attrs:
version_number = str(hf.attrs['version_number'])
except KeyError:
else:
version_number = "<= 1.13"
post = np.array(hf.get('post'))
lnlike = np.array(hf.get('lnlike'))


try:
if 'num_secondary_bodies' in hf.attrs:
num_secondary_bodies = int(hf.attrs['num_secondary_bodies'])
except KeyError:
else:
# old, has to be single planet fit
num_secondary_bodies = 1
num_secondary_bodies = 1

try:
data_table = table.Table(np.array(hf.get('data')))
Expand Down Expand Up @@ -265,6 +272,12 @@ def load_results(self, filename, append=False):
self.param_idx = self.system.param_idx
self.standard_param_idx = self.basis.standard_basis_idx

if 'ln_evidence' in hf.attrs:
self.ln_evidence = hf.attrs['ln_evidence']

if 'ln_evidence_err' in hf.attrs:
self.ln_evidence_err = hf.attrs['ln_evidence_err']

try:
curr_pos = np.array(hf.get('curr_pos'))
except KeyError:
Expand Down
Loading
Loading