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

Add documentation about fitting planetary RVs #333

Open
sblunt opened this issue Feb 17, 2023 · 6 comments
Open

Add documentation about fitting planetary RVs #333

sblunt opened this issue Feb 17, 2023 · 6 comments
Assignees

Comments

@sblunt
Copy link
Owner

sblunt commented Feb 17, 2023

We should document better and add a tutorial about fitting planetary RVs. In particular, should emphasize that pl RV data is assumed to be relative to the barycenter in the current implementation.

@sblunt sblunt self-assigned this Feb 17, 2023
@sblunt
Copy link
Owner Author

sblunt commented Mar 1, 2023

^^ wrong! RV is relative to the star. More reason to make this clear in the documentation.

@chihchunhsu
Copy link
Collaborator

chihchunhsu commented Jul 15, 2023

Does the sampler.results.plot_orbits() support plotting the planet/companion RVs? I have issues with plotting it with version 2.1.3 (I have no issues with plotting the orbit if I don't include companion RVs)

>>> orbit_plot = betaPic_sampler.results.plot_orbits(start_mjd=betaPic_sampler.system.data_table['epoch'][0], rv_time_series=True)

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/var/folders/n5/99sz4kvx3dd1wmcsjdsj9xh00000gn/T/ipykernel_26636/4025753964.py in <module>
----> 1 orbit_plot = betaPic_sampler.results.plot_orbits(start_mjd=betaPic_sampler.system.data_table['epoch'][0], rv_time_series=True)

~/anaconda3/lib/python3.7/site-packages/orbitize/results.py in plot_orbits(self, object_to_plot, start_mjd, num_orbits_to_plot, num_epochs_to_plot, square_plot, show_colorbar, cmap, sep_pa_color, sep_pa_end_year, cbar_param, mod180, rv_time_series, plot_astrometry, plot_astrometry_insts, plot_errorbars, fig)
    336             plot_astrometry=plot_astrometry,
    337             plot_astrometry_insts=plot_astrometry_insts,
--> 338             plot_errorbars=plot_errorbars, fig=fig
    339         )
    340 

~/anaconda3/lib/python3.7/site-packages/orbitize/plot.py in plot_orbits(results, object_to_plot, start_mjd, num_orbits_to_plot, num_epochs_to_plot, square_plot, show_colorbar, cmap, sep_pa_color, sep_pa_end_year, cbar_param, mod180, rv_time_series, plot_astrometry, plot_astrometry_insts, plot_errorbars, fig)
    562 
    563             plt.sca(ax1)
--> 564             plt.errorbar(Time(astr_epochs,format='mjd').decimalyear,sep_data,yerr=serr,ms=5, linestyle='',marker='o',c='purple',zorder=2, capsize=2)
    565             plt.sca(ax2)
    566             plt.errorbar(Time(astr_epochs,format='mjd').decimalyear,pa_data,yerr=perr,ms=5, linestyle='',marker='o',c='purple',zorder=2, capsize=2)

~/anaconda3/lib/python3.7/site-packages/matplotlib/pyplot.py in errorbar(x, y, yerr, xerr, fmt, ecolor, elinewidth, capsize, barsabove, lolims, uplims, xlolims, xuplims, errorevery, capthick, data, **kwargs)
   2522         lolims=lolims, uplims=uplims, xlolims=xlolims,
   2523         xuplims=xuplims, errorevery=errorevery, capthick=capthick,
-> 2524         **({"data": data} if data is not None else {}), **kwargs)
   2525 
   2526 

~/anaconda3/lib/python3.7/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
   1412     def inner(ax, *args, data=None, **kwargs):
   1413         if data is None:
-> 1414             return func(ax, *map(sanitize_sequence, args), **kwargs)
   1415 
   1416         bound = new_sig.bind(ax, *args, **kwargs)

~/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_axes.py in errorbar(self, x, y, yerr, xerr, fmt, ecolor, elinewidth, capsize, barsabove, lolims, uplims, xlolims, xuplims, errorevery, capthick, **kwargs)
   3333         x, y = np.atleast_1d(x, y)  # Make sure all the args are iterable.
   3334         if len(x) != len(y):
-> 3335             raise ValueError("'x' and 'y' must have the same size")
   3336 
   3337         if isinstance(errorevery, Integral):

ValueError: 'x' and 'y' must have the same size

<Figure size 1400x600 with 0 Axes>

@semaphoreP
Copy link
Collaborator

@chihchunhsu can you check if the most recent updates to orbitize fix this? we just merged in a bugfix for this onto the main branch

@chihchunhsu
Copy link
Collaborator

I pulled the most recent version 2.2.2 but the issue still persists, unfortunately.

@semaphoreP
Copy link
Collaborator

Is this the most recent version on pip, or did you directly pull the most recent changes on the main branch? We have yet to formally release this version.

@chihchunhsu
Copy link
Collaborator

Ah right. Actually I used the pip version, and it is fixed with the version on github! Thanks for the catch!

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

3 participants