forked from sncosmo/sncosmo.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
70 lines (49 loc) · 3.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="description" content="sncosmo : A Python Library for Supernova Cosmology" />
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<title>sncosmo</title>
</head>
<body>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<a id="forkme_banner" href="https://github.com/sncosmo">View on GitHub</a>
<h1 id="project_title">sncosmo</h1>
<h2 id="project_tagline">A Python Library for Supernova Cosmology</h2>
</header>
</div>
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<p>SNCosmo is a Python library for simulating, fitting and typing supernova light curves, built on NumPy, SciPy and AstroPy.</p>
<h3>
<a name="example" class="anchor" href="#example"><span class="octicon octicon-link"></span></a>Example</h3>
<p>Generate observed photometric data from a light curve model:</p>
<div class="highlight highlight-python"><pre><span class="o">>>></span> <span class="kn">import</span> <span class="nn">sncosmo</span>
<span class="o">>>></span> <span class="n">model</span> <span class="o">=</span> <span class="n">sncosmo</span><span class="o">.</span><span class="n">Model</span><span class="p">(</span><span class="n">source</span><span class="o">=</span><span class="s">'salt2'</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">model</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">x0</span><span class="o">=</span><span class="mf">1.e-7</span><span class="p">,</span> <span class="n">x1</span><span class="o">=</span><span class="mf">0.5</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="mf">0.05</span><span class="p">,</span> <span class="n">z</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">t0</span><span class="o">=</span><span class="mf">55100.</span><span class="p">)</span>
<span class="o">>>></span> <span class="n">model</span><span class="o">.</span><span class="n">bandmag</span><span class="p">(</span><span class="s">'sdssr'</span><span class="p">,</span> <span class="s">'ab'</span><span class="p">,</span> <span class="n">times</span><span class="o">=</span><span class="p">[</span><span class="mf">55075.</span><span class="p">,</span> <span class="mf">55100.</span><span class="p">,</span> <span class="mf">55140.</span><span class="p">])</span>
<span class="n">array</span><span class="p">([</span> <span class="mf">27.1180182</span> <span class="p">,</span> <span class="mf">25.68243714</span><span class="p">,</span> <span class="mf">28.28456537</span><span class="p">])</span>
</pre></div>
<h3>
<a name="install" class="anchor" href="#install"><span class="octicon octicon-link"></span></a>Install</h3>
<p>Assuming you have already installed the <code>astropy</code> package:</p>
<pre><code>$ pip install sncosmo
</code></pre>
<p>The <a href="http://sncosmo.readthedocs.org">documentation</a> contains more details on installing and using the package.</p>
<p>To report bugs and request features, please use the <a href="https://github.com/sncosmo/sncosmo/issues">issue tracker</a>. To contact me directly, please use kylebarbary [at] gmail dot com.</p>
<p>We welcome comments and contributions. To follow the development and get a copy of the latest development code, visit the <a href="https://github.com/sncosmo/sncosmo">GitHub</a> repository page.</p>
</section>
</div>
<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
<p>Published with <a href="http://pages.github.com">GitHub Pages</a></p>
</footer>
</div>
</body>
</html>