Skip to content

Commit

Permalink
Merge pull request #236 from sblunt/plotting_bugfix
Browse files Browse the repository at this point in the history
fix #234. Also another possible bug.
  • Loading branch information
sblunt committed Jun 18, 2021
2 parents 36c16cd + 7f83bfe commit 94bc357
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions orbitize/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def plot_corner(self, param_list=None, **corner_kwargs):
index_num = np.where(np.array(self.labels) == param)[0][0]

# only plot non-fixed parameters
if np.std(self.post[:, i]) > 0:
if np.std(self.post[:, index_num]) > 0:
param_indices.append(index_num)
label_key = param
if label_key.startswith('aop') or label_key.startswith('pan') or label_key.startswith('inc'):
Expand All @@ -325,9 +325,9 @@ def plot_corner(self, param_list=None, **corner_kwargs):
secondary_mass_indices.append(i)


samples = copy.copy(self.post[:, param_indices]) # keep only chains for selected parameters
samples = np.copy(self.post[:, param_indices]) # keep only chains for selected parameters
samples[:, angle_indices] = np.degrees(
self.post[:, angle_indices]) # convert angles from rad to deg
samples[:, angle_indices]) # convert angles from rad to deg
samples[:, secondary_mass_indices] *= u.solMass.to(u.jupiterMass) # convert to Jupiter masses for companions

if 'labels' not in corner_kwargs: # use default labels if user didn't already supply them
Expand Down

0 comments on commit 94bc357

Please sign in to comment.