California-Planet-Search / radvel

General Toolkit for Modeling Radial Velocity Data
http://radvel.readthedocs.io
MIT License
55 stars 54 forks source link

API for derived planetary parameters #301

Open shbhuk opened 4 years ago

shbhuk commented 4 years ago

Hi, I'm curious whether there currently exists an API hook for derived planetary parameters. I see the CLI commands to get this in the Optional Features section of the tutorial, however I would like to use the same functionality in the script, i.e. radvel derive, radvel plot -t derived, and then the model comparison..

Looking at radvel.driver, I see how to implement this, but before I did that I wanted to check if you have an example script / notebook for this. As far as I could tell the Jupyter notebook tutorials do not deal with derived planetary parameters (let me know if I missed something).

https://radvel.readthedocs.io/en/latest/quickstartcli.html#optional-features

shbhuk commented 4 years ago

Likewise the 'report' command for CLI

bjfultn commented 4 years ago

I do not have tutorials for this sort of thing. It would be great if you wanted to implement and add to the existing tutorial(s) or make new ones!

shbhuk commented 4 years ago

Is the standard just to use the CLI for this?

Shubham Kanodia

On Sun, 29 Mar 2020 at 12:51, BJ Fulton notifications@github.com wrote:

I do not have tutorials for this sort of thing. It would be great if you wanted to implement and add to the existing tutorial(s) or make new ones!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/California-Planet-Search/radvel/issues/301#issuecomment-605665694, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCCCYU673TAVXUMCM6VBSDRJ537JANCNFSM4LVVRRQQ .

bjfultn commented 4 years ago

Yeah, I personally use the CLI almost exclusively.

zhexingli commented 2 years ago

Not sure if this helps, but if you'd like to run the same commands in a python script instead of in the comand line (for reasons such as to incorporate the radvel commands and results in a bigger script that does other things), you could use a python subprocess with the same CLI command without using the API.

For example, the radvel derive -s filename command can be implemented as: import subprocess subprocess.check_output(['radvel','derive','-s','file']) If you assign it to a variable it saves all the command line outputs. With some cleaning you can make it to display nicely.

shbhuk commented 2 years ago

Hi @zhexingli, Thank you for the response. Yes, that's what I've been doing to use radvel, i.e. call the CLI commands through a python script.