GithubHelp home page GithubHelp logo

twobody's Introduction

twobody

A Python package for computing orbits and astronomical observables for binary stars, exoplanets, and other gravitational two-body systems.

Documentation Status Powered by Astropy Badge

License

This project is Copyright (c) Adrian Price-Whelan and licensed under the terms of the MIT license. See the licenses folder for more information.

twobody's People

Contributors

adrn avatar dependabot[bot] avatar davidwhogg avatar

Stargazers

Prasanth avatar Juan F Puerta avatar

Watchers

 avatar  avatar James Cloos avatar  avatar

twobody's Issues

Question Regarding Mean Anomaly Calculation Formula

Hi, I have a question regarding the function c_rv_from_elements in twobody.c. The function is defined as follows:

void c_rv_from_elements(double *t, double *rv, int N_t, double P, double K, double e, double omega, double M0, double t0, double tol, int maxiter) { /* Compute the RV of the primary w.r.t. the system barycenter */ double M, E, f; for (int n=0; n < N_t; n++) { M = 2 * M_PI * (t[n] - t0) / P - M0; E = c_eccentric_anomaly_from_mean_anomaly_Newton1(M, e, tol, maxiter); f = c_true_anomaly_from_eccentric_anomaly(E, e); rv[n] = K * (cos(omega + f) + e * cos(omega)); } }
Could you please explain why the formula M =2๐œ‹/P *(t-t0) -M0 is used instead of M =2๐œ‹/P *(t-t0) +M0 ?
Thank you very much for your help!

Can't install in python 2.7.15

Running pip install twobody yields the following:

It seems the function invalidate_caches is no longer available in python 2.7.15 and thus, twobody cannot be installed..

Collecting twobody
Using cached https://files.pythonhosted.org/packages/96/7e/5a63dd91f13f8c41f81601a011f0d6990b697ae436c60a8d4ce1f202444f/twobody-0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/_d/dsf3j7cs2x93bdljc73ljslm0000gn/T/pip-install-dT6MhF/twobody/setup.py", line 18, in
from astropy_helpers.setup_helpers import (register_commands, get_debug_option,
File "/private/var/folders/_d/dsf3j7cs2x93bdljc73ljslm0000gn/T/pip-install-dT6MhF/twobody/astropy_helpers/astropy_helpers/setup_helpers.py", line 25, in
from .distutils_helpers import (add_command_option, get_compiler_option,
File "/private/var/folders/_d/dsf3j7cs2x93bdljc73ljslm0000gn/T/pip-install-dT6MhF/twobody/astropy_helpers/astropy_helpers/distutils_helpers.py", line 18, in
from .utils import silence
File "/private/var/folders/_d/dsf3j7cs2x93bdljc73ljslm0000gn/T/pip-install-dT6MhF/twobody/astropy_helpers/astropy_helpers/utils.py", line 23, in
from importlib import invalidate_caches
ImportError: cannot import name invalidate_caches

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/_d/dsf3j7cs2x93bdljc73ljslm0000gn/T/pip-install-dT6MhF/twobody/

Add support for computing astrometric orbits

We should be able to output:

  • full, 6-space position/velocity in Cartesian coordinates
  • full, 6-space position/velocity in observed coordinates (astrometric + line-of-sight)
  • either (2-, RV, or 4-, astrometric) subspace independently (for speed)

Do we also want to be able to add Earth's parallax, velocity, or are we cool with assuming we'll get positions in the ICRS?

cc @davidwhogg

physical type labels

I think they should be ['ptype'], not [ptype], in order for numpydoc xref to link them to Astropy.

Input K

Hi Adrian,

Is there currently a way to input the semi-amplitude K in a KeplerOrbit?
Sorry if I missed it in the code.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.