Skip to content

Commit

Permalink
more plotting tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sblunt committed Aug 28, 2024
1 parent 89a3a58 commit b3ab054
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
23 changes: 13 additions & 10 deletions orbitize/hipparcos.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,51 +521,54 @@ def log_prob(model_pars):
myHipLogProb.plx0 + 3 * myHipLogProb.plx0_err,
1000,
)
axes[0].hist(sampler.flatchain[:, 0], bins=50, density=True, color="r")
axes[0].hist(sampler.flatchain[:, 0], bins=50, density=True, color="grey")
axes[0].plot(
xs, norm(myHipLogProb.plx0, myHipLogProb.plx0_err).pdf(xs), color="k"
)
axes[0].set_xlabel("plx [mas]")
axes[0].set_xlabel("$\pi$ [mas]")

# PM RA
xs = np.linspace(
myHipLogProb.pm_ra0 - 3 * myHipLogProb.pm_ra0_err,
myHipLogProb.pm_ra0 + 3 * myHipLogProb.pm_ra0_err,
1000,
)
axes[1].hist(sampler.flatchain[:, 1], bins=50, density=True, color="r")
axes[1].hist(sampler.flatchain[:, 1], bins=50, density=True, color="grey")
axes[1].plot(
xs, norm(myHipLogProb.pm_ra0, myHipLogProb.pm_ra0_err).pdf(xs), color="k"
)
axes[1].set_xlabel("PM RA [mas/yr]")
axes[1].set_xlabel("$\mu_{{\\alpha_0^*}}$ [mas/yr]")

# PM Dec
xs = np.linspace(
myHipLogProb.pm_dec0 - 3 * myHipLogProb.pm_dec0_err,
myHipLogProb.pm_dec0 + 3 * myHipLogProb.pm_dec0_err,
1000,
)
axes[2].hist(sampler.flatchain[:, 2], bins=50, density=True, color="r")
axes[2].hist(sampler.flatchain[:, 2], bins=50, density=True, color="grey")
axes[2].plot(
xs, norm(myHipLogProb.pm_dec0, myHipLogProb.pm_dec0_err).pdf(xs), color="k"
)
axes[2].set_xlabel("PM Dec [mas/yr]")
axes[2].set_xlabel("$\mu_{{\\delta_0}}$ [mas/yr]")

# RA offset
axes[3].hist(sampler.flatchain[:, 3], bins=50, density=True, color="r")
axes[3].hist(sampler.flatchain[:, 3], bins=50, density=True, color="grey")
xs = np.linspace(
-3 * myHipLogProb.alpha0_err, 3 * myHipLogProb.alpha0_err, 1000
)
axes[3].plot(xs, norm(0, myHipLogProb.alpha0_err).pdf(xs), color="k")
axes[3].set_xlabel("RA Offset [mas]")
axes[3].set_xlabel("$\\alpha_0^*$ [mas]")

# Dec offset
xs = np.linspace(
-3 * myHipLogProb.delta0_err, 3 * myHipLogProb.delta0_err, 1000
)
axes[4].hist(sampler.flatchain[:, 4], bins=50, density=True, color="r")
axes[4].hist(sampler.flatchain[:, 4], bins=50, density=True, color="grey")
axes[4].plot(xs, norm(0, myHipLogProb.delta0_err).pdf(xs), color="k")
axes[4].set_xlabel("Dec Offset [mas]")
axes[4].set_xlabel("$\delta_0$ [mas]")

for a in axes:
a.set_ylabel('relative prob.')

plt.tight_layout()
plt.savefig(saveplot, dpi=250)
Expand Down
14 changes: 7 additions & 7 deletions orbitize/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,24 @@ def plot_corner(results, param_list=None, **corner_kwargs):
default_labels = {

"sma": "$a_{{B}}$ [au]",
"ecc": "$ecc_{{B}}$",
"inc": "$inc_{{B}}$ [$^\\circ$]",
"ecc": "$ecc$",
"inc": "$i$ [$^\\circ$]",
"aop": "$\\omega_{{B}}$ [$^\\circ$]",
"pan": "$\\Omega_{{B}}$ [$^\\circ$]",
"tau": "$\\tau_{{B}}$",
"pan": "$\\Omega$ [$^\\circ$]",
"tau": "$\\tau$",
"tp": "$T_{{\\mathrm{{P}}}}$",
"plx": "$\\pi$ [mas]",
"gam": "$\\gamma$ [km/s]",
"sig": "$\\sigma$ [km/s]",
"mtot": "$M_T$ [M$_{{\\odot}}$]",
"m0": "$M_{{A}}$ [M$_{{\\odot}}$]",
"m": "$M_{{B}}$ [M$_{{\\odot}}$]",
"m0": "$M_{{a}}$ [M$_{{\\odot}}$]",
"m": "$M_{{b}}$ [M$_{{\\odot}}$]",
"pm_ra": "$\\mu_{{\\alpha^{{*}}}}$ [mas/yr]",
"pm_dec": "$\\mu_{{\\delta}}$ [mas/yr]",
"alpha0": "$\\alpha^{{*}}_{{0}}$ [mas]",
"delta0": "$\\delta_0$ [mas]",
# "m": "$M_{0}$ [M$_{{\\rm Jup}}$]",
"per": "$P_{{B}}$ [yr]",
"per": "$P$ [yr]",
"K": "$K_{0}$ [km/s]",
"x": "$X_{0}$ [AU]",
"y": "$Y_{0}$ [AU]",
Expand Down

0 comments on commit b3ab054

Please sign in to comment.