Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove labels of fixed parameters in plot_corner #380

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 9 additions & 7 deletions orbitize/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,23 @@ def plot_corner(results, param_list=None, **corner_kwargs):
param_indices = []
angle_indices = []
secondary_mass_indices = []
for i, param in enumerate(param_list):
index_num = results.param_idx[param]
fixed_indices = []
for i, label_key in enumerate(param_list):
index_num = results.param_idx[label_key]

# only plot non-fixed parameters
if np.std(results.post[:, index_num]) > 0:
if not np.isclose(0.0, np.std(results.post[:, index_num])):
param_indices.append(index_num)
label_key = param
if (
label_key.startswith("aop")
or label_key.startswith("pan")
or label_key.startswith("inc")
):
angle_indices.append(i)
angle_indices.append(i-len(fixed_indices))
if label_key.startswith("m") and label_key != "m0" and label_key != "mtot":
secondary_mass_indices.append(i)
secondary_mass_indices.append(i-len(fixed_indices))
else:
fixed_indices.append(i)

samples = np.copy(
results.post[:, param_indices]
Expand All @@ -137,7 +139,7 @@ def plot_corner(results, param_list=None, **corner_kwargs):
"labels" not in corner_kwargs
): # use default labels if user didn't already supply them
reduced_labels_list = []
for i in np.arange(len(param_indices)):
for i in param_indices:
label_key = param_list[i]
if label_key.startswith("m") and label_key != "m0" and label_key != "mtot":
body_num = label_key[1]
Expand Down
Loading