Skip to main content

Easily make Monte Carlo simulations of binary or triple orbits.

Project description

This package allows for easy and very quick Monte Carlo simulation of populations of orbits, giving instantly distributions of projected separations, relative RVs between components, etc. Includes calculations for eccentric orbits. Handy for simulating imaging or RV observations.

Makes occasional use of the astropy Quantity object to keep track of some quantities, and the astropy SkyCoord object to keep track of coordinates. Also uses pandas to save/restore populations.

See below for a quick intro, and the notebook demo for more.

Installation

$ pip install [--user] orbitutils

Or clone the repository and install:

$ git clone https://github.com/timothydmorton/orbitutils.git
$ cd orbitutils
$ python setup.py install [--user]

Basic usage

Simulate a population for given primary and secondary mass(es), and orbital periods. Eccentricity is zero by default, but can be set.

from orbitutils import OrbitPopulation
pop = OrbitPopulation(1,1,1000,n=1e4) #Primary mass, secondary mass, orbital period (d)

You can also create a distribution of secondary masses, and/or a distribution of periods:

import numpy as np
from orbitutils import OrbitPopulation
N=1e4
M2s = np.linspace(0.1,1,N)
Ps = np.logspace(1,3,N) #periods evenly log-spaced from 10 to 1000 days
pop = OrbitPopulation(1,M2s,Ps)

OrbitPopulation objects can be saved using the save_hdf method:

pop.save_hdf('mypop.h5')

and then read back in/restored as follows:

from orbitutils import OrbitPopulation_FromH5
pop_again = OrbitPopulation_FromH5('mypop.h5')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orbitutils-0.1.1.tar.gz (734.6 kB view details)

Uploaded Source

File details

Details for the file orbitutils-0.1.1.tar.gz.

File metadata

  • Download URL: orbitutils-0.1.1.tar.gz
  • Upload date:
  • Size: 734.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for orbitutils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 44656de8e23d56a537212af0689c754a07dcf4cbb0e80d0f7be13f639f7cf066
MD5 0ef097576a987f4e90e8f773c2567859
BLAKE2b-256 b8a986deee5b9a32819334956431fbd79176d130c20532c1589fd4788778c98b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page