项目作者: jobovy

项目描述 :
Galactic chemical evolution in python
高级语言: Jupyter Notebook
项目地址: git://github.com/jobovy/kimmy.git
创建时间: 2018-07-06T17:24:27Z
项目社区:https://github.com/jobovy/kimmy

开源协议:MIT License

下载


kimmy

Galactic chemical evolution in python

image
Binder

Overview

kimmy contains simple tools to study chemical evolution in galaxies.

Author

Jo Bovy (University of Toronto): bovy - at - astro - dot - utoronto - dot - ca

Installation

Install the latest release with pip

  1. pip install kimmy

or install the latest version by cloning/forking/downloading the repository and installing using

  1. sudo python setup.py install

or locally using

  1. python setup.py install --user

Usage

For an example of usage, see the example notebook. You can also launch a Binder instance and directly play around with this notebook. Or you can use this pyodide-compatible version of the same notebook in JupyterLite.

Currently, the only implemented feature is a simple one-zone chemical model with two elements O (for oxygen) and Fe (for iron). Initialize this model as

  1. import kimmy
  2. oz= kimmy.OneZone()

then for example compute the evolution of the default model and plot the [O/Fe] vs. [Fe/H] sequence

  1. ts= numpy.linspace(0.001,10.,1001)*u.Gyr
  2. plot(oz.Fe_H(ts),oz.O_Fe(ts))

To compute the distribution of [Fe/H], do for example,

  1. FeHs= numpy.linspace(-1.525,1.225,56)
  2. FeH_dist= [oz.Fe_H_DF(f) for f in FeHs]

and similar for the distribution of [O/H] and [O/Fe]. You can directly update the main parameters of the model and the model will be re-computed. For example, to set the outflow mass-loading parameter to one and plot the [O/Fe] vs. [Fe/H] sequence, do

  1. ts= numpy.linspace(0.001,10.,1001)*u.Gyr
  2. oz.eta= 1.
  3. plot(oz.Fe_H(ts),oz.O_Fe(ts))

Keep in mind that once you change a parameter, it remains changed in the model. If you want to go back to the initial set of parameters that you used to initialize the instance, use oz.initial(); if you want to go back to the default set of parameters, use oz.default(). If you want to print the model you are using at any time, do

  1. print(oz)

which prints a nicely formatted list of all of the model parameters.