Commit 7db5f530 authored by Martin Glatzle's avatar Martin Glatzle

Extend README, prepare for sphinx.

parent cb1b7abc
# A toolbox for cosmic dust.
# `cosmic_dustbox`
A package that aims at bringing models of cosmic dust to Python to make working
with them easier.
*Note:* very early development at the moment so it does not yet do too many
useful things and the API _will_ change.
## Installation
- Clone the repo: `git clone
git@gitlab.mpcdf.mpg.de:mglatzle/cosmic_dustbox.git`
- `cd cosmic_dustbox`
- `python setup.py install`
## Examples
Note: `cosmic_dustbox` uses `astropy.units` throughout.
Evaluating the Weingartner & Draine 2001 size distributions for carbonaceous
and silicate grains for R\_V=3.1 and b\_C=6.0e-5 in case 'A' at a range of
grain sizes between 1 nm and 1 $\mu$:
```
>>> import astropy.units as u
>>> import cosmic_dustbox as cb
>>> import numpy as np
>>> sd_car, sd_sil = cb.sdist.WD01(3.1, 6.0, 'A')
>>> sizes = np.logspace(-9, -6, num=10)*u.m
>>> sd_car(sizes)
<Quantity [7.39939133e+00, 9.02469859e-02, 1.94996300e-02, 1.07158763e-03,
1.18483502e-04, 1.30850238e-05, 1.24648409e-06, 9.43835731e-08,
2.41782877e-09, 2.43258206e-15] 1 / m>
>>> sd_sil(sizes)
<Quantity [7.86318728e+000, 6.70676535e-001, 5.73425242e-002,
4.92807748e-003, 4.28146066e-004, 3.80362296e-005,
3.52990312e-006, 3.09011411e-007, 7.19725776e-020,
9.29346597e-263] 1 / m>
```
## Philosophy
In 1930, after confirming that distant stars in the Milky Way are dimmed more
strongly than one would expect from geometry, Trumpler conjectured the
existence of "dust particles of various sizes" in the interstellar space of our
......@@ -32,14 +69,14 @@ other grains, grains that have similar chemical composition and so on. So if we
are fine with some level of abstraction and generalization, our grain
collection could be represented like this:
![](figs/grain-pop.png)
![](docs/figs/grain-pop.png)
with color-coded chemical composition. How do we go about categorizing these
grains so that we can think in these categories without worrying about
individual grains? Two obvious properties to group by are the chemical
composition and the shape:
![](figs/grain-species.png)
![](docs/figs/grain-species.png)
The "blueprint grain", which we can rescale to obtain any of the grains in one
of the groups, is referred to as a grain species. So one of our groups is
......@@ -58,8 +95,10 @@ So, to recap, what we need to describe a collection of grains are:
This approach can be refined as needed by simply splitting grain species. In
the extreme, we would have one species per grain and each species would have a
delta-peak size distribution and we would be back to the overwhelming diversity
we started out from.
we started out from. The approach also sounds like it can almost directly be
translated into software. The size distribution class in `sdist.py` is already
in a somewhat advanced state so feel free to check it out.
# Literature
## Literature
"Physics of the Interstellar and Intergalactic Medium" by B. Draine provides
a good introduction (and more than that) to cosmic dust.
# Welcome to MkDocs
For full documentation visit [mkdocs.org](https://mkdocs.org).
## Commands
* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs help` - Print this help message.
## Project layout
mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
site_name: cosmic_dustbox documentation
site_author: Martin Glatzle
theme: readthedocs
site_dir: docs/html_docs
pages:
- Introduction: 'index.md'
- Quick start: 'quickstart.md'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment