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

octoplot() ignoring flags in julia terminal #54

Open
mkenworthy opened this issue Jan 4, 2025 · 3 comments
Open

octoplot() ignoring flags in julia terminal #54

mkenworthy opened this issue Jan 4, 2025 · 3 comments

Comments

@mkenworthy
Copy link

I'm learning octofitter and I want to get predicted positions of an orbital fit for an observing run.

octoplot() displays a 3x3 panel by default, but trying to limit the panels using:

fig = octoplot(model, chain; show_astrom=true, # Show orbit in sky plane (mas) show_physical_orbit=false, # Show orbit in physical units (AU) show_astrom_time=true, # Show sep/PA vs time show_rv=false, # Show stellar RV show_relative_rv=false, # Show planet-star relative RV show_hgca=false, # Show proper motion anomaly show_mass=false # Show mass posterior )

...results in the same 3x3 plot - octoplot() seems to be ignoring the command line options.

epochs = [ mjd("2024-01-01"), mjd("2025-01-01"), mjd("2026-01-01") ]

and

octoplot(model, chain, mark_epochs_mjd=epochs)

similarly doesn't adjust the time axes on the plots.

@sefffal
Copy link
Owner

sefffal commented Jan 13, 2025

Hi @mkenworthy , thanks for giving octofitter a try.

A couple questions for you:

  1. Are you using octofitter through Python or Julia? (I assume Julia from the above)
  2. Could you post images of the results from the above commands?

To adjust the time range shown in the plots, you can use the argument:

fig = octoplot(model, chain, ...., ts=range(start=mjd("2024"), stop=mjd("2026"), length=150))`

If you need to fine tune the limits, you can also use the xlims! and ylims! functions on the resulting figure. E.g.:

fig = octoplot(model, chain,)
xlims!(fig.content[1], low=mjd("2021"), high=mjd("2026"))
fig

Finally, you can also try switching to GLMakie from CairoMakie. This creates an interactive figure that you can zoom around on until you have the limits just right. You can then run save("fname.png", fig) to output the file.

Please do let me know how it goes, and if you have any feature requests for the plot output.

@sefffal
Copy link
Owner

sefffal commented Jan 13, 2025

Ah @mkenworthy -- you mentioned that octoplot creates a 3x3 panel by default. This was the behaviour of a much older version of Octofitter.

Could you please share the version of Octofitter that you are currently using?
E.g.

using Pkg
Pkg.status()

@sefffal
Copy link
Owner

sefffal commented Jan 13, 2025

I should also add, that if you're just looking for predicted positions you can use this calculation:

# Create an orbit object from each draw in the chains
els = Octofitter.construct_elements(chain, :b, :) # use name of planet as second argument
# Solve each orbit object at a particular date
sols = orbitsolve.(els, mjd("2026")
# Calculate position, etc
xs = raoff.(sols)
ys = decoff.(sols)
println(mean(xs), " ", mean(ys))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants