Skip to content

Sub6Resources/astro-sampler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Astro Sampler

Sample from distributions commonly used in astronomy.

Installation

pip install astrosampler

Dependencies

  • numpy

Usage

from astrosampler import SalpeterIMF

# Sample 1000 stellar masses from the Salpeter (1955) IMF
imf = SalpeterIMF(mass_range=(0.08, 100))
masses = imf.sample(1000)