{ "info": { "author": "whiskie14142", "author_email": "whiskie14142@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# pytwobodyorbit\n**pytwobodyorbit** is a module that provides various computations about two-body orbits, including:\n* Defines the orbit by position and velocity of an object\n* Defines the orbit by classical orbital elements\n* Computes position and velocity of an object at a given time\n* Provides a series of points on orbital trajectory of an object for visualization\n* Solves so-called **Lambert's problem** (When two positions and flight time between them are given, the module computes initial and terminal velocity of the object).\n\nThe module contains **TwoBodyOrbit** class and **lambert** function.\n\n## TwoBodyOrbit (Class)\nA class that provides a two-body orbit of a celestial body, which orbits around or flies by a central body. \n\n#### Attributes\n* **bodyname**: The name of the celestial body\n* **mothername**: The name of the central body\n* **mu**: Gravitational parameter (mu) of the central body\n * The dimension of mu prescribes units of length and time used in the instance. For example, when you use the default value of mu (1.32712440041e20), the unit of length should be meters, and the unit of time should be seconds.\n\n#### Methods\n* **setOrbCart**: Define the orbit by Cartesian orbital elements (the position and velocity of the body). Arguments are as follows:\n * t: Time\n * pos: Position of the body [x, y, z]; an array-like object\n * vel: Velocity of the body [xd, yd,zd]; an array-like object\n* **setOrbKepl**: Define the orbit by classical orbital elements (Keplerian orbital elements). Arguments are as follows:\n * epoch: Epoch\n * a: Semi-major axis\n * e: Eccentricity; 1.0 is not allowed\n * i: Orbital inclination in degrees\n * LoAN: Longitude of ascending node in degrees; if inclination is zero, this value defines a reference longitude of AoP\n * AoP: Argument of periapsis in degrees; if inclination is zero, this value indicates an angle from the reference longitude; for a circular orbit, this value defines a imaginary periapsis\n * Following three keyword parameters (TA, T, MA) are mutually exclusive. You should specify one of them.\n * TA: True anomaly at epoch in degrees; for a circular orbit, this value indicates an angle from the imaginary periapsis\n * T: Periapsis passage time; for a circular orbit, this value indicates passage time for the imaginary periapsis\n * MA: Mean anomaly at epoch in degrees; for a hyperbolic trajectory, you cannot specify this argument; for a circular orbit, this value indicates anomaly form the imaginary periapsis\n\n* **posvel**: Returns position and velocity of the body for given true anomaly\n* **points**: Returns points on orbital trajectory for visualization\n* **posvelatt**: Returns position and velocity of the body for given time\n* **elmKepl**: Returns classical orbital elements (Keplerian orbital elements) of the orbit\n\n#### Usage\n\n from pytwobodyorbit import TwoBodyOrbit\n sunmu = 1.32712440041e20\n orbit = TwoBodyOrbit(\"Space Probe\", mu=sunmu) # create an instance\n t0 = 0.0 # epoch\n pos0 = [1e11, 1.2e11, 0.2e11] # position\n vel0 = [-2e4, 1.8e4, 0.0] # velocity\n orbit.setOrbCart(t0, pos0, vel0) # define the orbit\n t1 = 100.0 * 86400 # time after 100 days\n pos, vel = orbit.posvelatt(t1) # get position and velocity at t1\n xs, ys, zs, times = orbit.points(100) # get points (series of 100 points)\n kepl = orbit.elmKepl() # get classical orbital elements\n\nThe value for the gravitational parameter (1.32712440041e20) is for the Sun, and it prescribes units of length to meters and units of time to seconds.\n\n## lambert (Function)\nA function to solve **Lambert's Problem**. From given initial position and terminal position of a body and flight time, the function computes a two-body orbit and returns initial velocity and terminal velocity of the body. The function returns following two numpy arrays. The origin of axes is the central body.\n* ivel: Initial velocity of the body [xd, yd, zd]\n* tvel: Terminal velocity of the body [xd, yd, zd]\n\n#### Arguments\n* ipos: Initial position of an body [x, y, z]; an array-like object; origin of coordinates is the central body\n* tpos: Terminal position of an body [x, y, z]; an array-like object; origin of coordinates is the central body\n\n\n#### Usage\n\n from pytwobodyorbit import lambert\n P1 = [1.5e11, 0.0, 0.0] # initial position\n P2 = [-0.5e11, 1.3e11, 0.4e11] # terminal position\n Ft = 100.0 * 86400 # flight time in seconds\n sunmu = 1.32712440041e20 # mu of the Sun\n prog = True # Prograde orbit\n ivel, tvel = lambert(P1, P2, Ft, mu=sunmu, ccw=prog) # get initial velocity and terminal velocity\n\n## Install pytwobodyorbit\n**pytwobodyorbit** has been registered on PyPI (Python Package Index). You can install it by pip command of Python as follows.\n\n pip install pytwobodyorbit\n\n## Required environment\n* Python 3\n\n## Packages and Modules\n* Numpy\n\n## Modification Log\n#### v1.0.0 January 2, 2019\n* ##### TwoBodyOrbit class\n * Initiating method was changed its argument name (mmu to mu)\n * Method **setOrbKepl** was added to **TwoBodyOrbit** class\n * Method **elmKepl** was changed its returning data; keys of dictionary were modified\n\n* ##### lambert function\n * Function name was changed; from *solveGauss* to **lambert**\n * The argument \"mu\" became to have a default value\n\n#### v0.1.0 November 7, 2016\n* Initial release\n\n# Programs for testing and demonstration\nThe author prepaired two programs for testing and demonstration of **pytwobodyorbit** module. Those are **testConvert.py** and **testLambert.py**. You can find their scripts in a repository of GitHub. See https://github.com/whiskie14142/pytwobodyorbit\n\n## testConvert.py\nA program that demonstrates functionalities of the **TwoBodyOrbit** class of **pytwobodyorbit**. By utilizing the class, the program converts a set of classical orbital elements of a body that orbits around or flies by the Sun, into a set of Cartesian orbital elements, and vice versa. In addition, the program draws a 3D chart of the orbit, from classical orbital elements or Cartesian orbital elements.\n\nThe program requires **Numpy** and **matplotlib**.\n\n## testLambert.py\n\nA program that demonstrates the **lambert** function of pytwobodyorbit. By utilizing the function, the program compute a two-body orbit from initial position and terminal position of a body that orbit around or flies by the Sun and flight time between them. The program shows you classical orbital elements of the orbit, and draws the orbit into a 3D chart. For the computation of a two-body orbit, you can choose flight direction of the orbit, one is a direct (prograde) orbit and another is a retrograde orbit.\n\nThe program requires **Numpy** and **matplotlib**.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/whiskie14142/pytwobodyorbit", "keywords": "two-body orbit Keplerian Cartesian Lambert", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pytwobodyorbit", "package_url": "https://pypi.org/project/pytwobodyorbit/", "platform": "", "project_url": "https://pypi.org/project/pytwobodyorbit/", "project_urls": { "Homepage": "https://github.com/whiskie14142/pytwobodyorbit" }, "release_url": "https://pypi.org/project/pytwobodyorbit/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "A module that provides various computations about two-body orbits", "version": "1.0.0" }, "last_serial": 4651226, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "ce40eddbc6074b47d9ce7ee5e75b096f", "sha256": "5919dbe870bfdc299347d61acf68f112697a4c15d27d22099d646aa60f08eb89" }, "downloads": -1, "filename": "pytwobodyorbit-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ce40eddbc6074b47d9ce7ee5e75b096f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7649, "upload_time": "2016-10-07T05:46:24", "url": "https://files.pythonhosted.org/packages/c6/56/13f7d8bc39d456e0fad34255bb3403a1bfa1455924080d4decc16daba54a/pytwobodyorbit-0.1.0-py3-none-any.whl" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "9c1b39b294c0430c6695d5a37ca14dc5", "sha256": "1a40a5c93c85254f3aec65d22177a48591273a2b4f564c1ef937a5ce6b3ade6a" }, "downloads": -1, "filename": "pytwobodyorbit-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9c1b39b294c0430c6695d5a37ca14dc5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10792, "upload_time": "2019-01-02T00:07:23", "url": "https://files.pythonhosted.org/packages/a9/79/743be76f202213c9706ab4a24ccf9bda26694d3a53fb42d0bf34a474fd0b/pytwobodyorbit-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "624956e8b3a277b49e50db4499787b7b", "sha256": "04ed2bfc2d7b2d52039642c26003ae250c501f73b4a48653c587b1f86a4184bf" }, "downloads": -1, "filename": "pytwobodyorbit-1.0.0.tar.gz", "has_sig": false, "md5_digest": "624956e8b3a277b49e50db4499787b7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11106, "upload_time": "2019-01-02T00:07:25", "url": "https://files.pythonhosted.org/packages/7a/bf/f4235a4fcfe08abb84c4455fbe38c95c3d9fe333087db17cb1c02691845a/pytwobodyorbit-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9c1b39b294c0430c6695d5a37ca14dc5", "sha256": "1a40a5c93c85254f3aec65d22177a48591273a2b4f564c1ef937a5ce6b3ade6a" }, "downloads": -1, "filename": "pytwobodyorbit-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9c1b39b294c0430c6695d5a37ca14dc5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10792, "upload_time": "2019-01-02T00:07:23", "url": "https://files.pythonhosted.org/packages/a9/79/743be76f202213c9706ab4a24ccf9bda26694d3a53fb42d0bf34a474fd0b/pytwobodyorbit-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "624956e8b3a277b49e50db4499787b7b", "sha256": "04ed2bfc2d7b2d52039642c26003ae250c501f73b4a48653c587b1f86a4184bf" }, "downloads": -1, "filename": "pytwobodyorbit-1.0.0.tar.gz", "has_sig": false, "md5_digest": "624956e8b3a277b49e50db4499787b7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11106, "upload_time": "2019-01-02T00:07:25", "url": "https://files.pythonhosted.org/packages/7a/bf/f4235a4fcfe08abb84c4455fbe38c95c3d9fe333087db17cb1c02691845a/pytwobodyorbit-1.0.0.tar.gz" } ] }