Skip to content
Chris Theissen edited this page Aug 13, 2016 · 2 revisions

Welcome to the LoKi wiki!

LoKi is a galactic model for low-mass stars. This model simulates both stellar counts and kinematics for a line-of-sight or a user-defined volume.

Loki can be installed through pip

pip install loki

A basic example of usage is the following:

# Import loki and numpy
from loki import loki
import numpy as np

# Choose some coordinates
ra, dec = 10, 40 

# Create an array of densities that span the entire luminosity function
# This creates 10000 random densities by default
densities = loki.densities()

# Pick a random density from the array
density = np.random.choice(densities, size = 1)

# Count the number of stars along the line-of-sight (defaults to an angular volume of 30')
# In "full" mode this also returns the distance bins and stellar counts for each bin
n, nums, dists = loki.count_nstars(ra, dec, rho0=density, full = True)

# Get parameters for all the stars
stars = loki.stars(ra, dec, n, nums, dists)

The stars class will have parameters for each star (stars.pmra, stars.U, stars.dist)

Clone this wiki locally