
<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>frbpoppy &#8212; frbpoppy by David Gardenier</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/language_data.js"></script>
    <link rel="shortcut icon" href="_static/logo_small.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Get Started" href="get_started.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="frbpoppy">
<h1>frbpoppy<a class="headerlink" href="#frbpoppy" title="Permalink to this headline">¶</a></h1>
<div class="line-block">
<div class="line"><br /></div>
</div>
<p>Conduct Fast Radio Burst Population Synthesis | <strong>David Gardenier</strong> | ASTRON</p>
<div class="section" id="what-s-frbpoppy">
<h2>What’s frbpoppy?<a class="headerlink" href="#what-s-frbpoppy" title="Permalink to this headline">¶</a></h2>
<p>Establishing the origin and properties of Fast Radio Bursts (FRBs) is one of the biggest goals in radio astronomy. <code class="docutils literal notranslate"><span class="pre">frbpoppy</span></code> was called into life to help astronomers determine which FRB properties to expect. Designed to be simple in use and easy to adapt, <code class="docutils literal notranslate"><span class="pre">frbpoppy</span></code> continues the work of <code class="docutils literal notranslate"><span class="pre">psrpop</span></code> and <code class="docutils literal notranslate"><span class="pre">psrpoppy</span></code> in the realm of FRBs.</p>
</div>
<div class="section" id="how-can-i-install-it">
<h2>How can I install it?<a class="headerlink" href="#how-can-i-install-it" title="Permalink to this headline">¶</a></h2>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>git clone https://github.com/davidgardenier/frbpoppy
<span class="nb">cd</span> ./frbpoppy/
python3 setup.py develop
python3 examples/_starting_with_frbpoppy_.py
</pre></div>
</div>
<p>Things not going quite as smoothly? Check the <a class="reference internal" href="get_started.html"><span class="doc">Get Started</span></a> guide for additional information on common installation problems.</p>
</div>
<div class="section" id="how-do-i-use-it">
<h2>How do I use it?<a class="headerlink" href="#how-do-i-use-it" title="Permalink to this headline">¶</a></h2>
<p>Feeling confident? Start off with this:</p>
<div class="highlight-default notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 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</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="sd">&quot;&quot;&quot;Short example of how frbpoppy works.</span>

<span class="sd">The first time you run frbpoppy, a series of cosmological databases will be</span>
<span class="sd">constructed to set up subsequent runs. This first run can take ~2h on a 4 core</span>
<span class="sd">machine. Subsequent runs will take mere seconds.</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">frbpoppy</span> <span class="kn">import</span> <span class="n">CosmicPopulation</span><span class="p">,</span> <span class="n">Survey</span><span class="p">,</span> <span class="n">SurveyPopulation</span><span class="p">,</span> <span class="n">plot</span>

<span class="c1"># Set up an FRB population of one-offs</span>
<span class="c1"># Add repeaters=True to turn into an FRB population of repeaters</span>
<span class="n">cosmic_pop</span> <span class="o">=</span> <span class="n">CosmicPopulation</span><span class="o">.</span><span class="n">complex</span><span class="p">(</span><span class="mf">1e5</span><span class="p">,</span> <span class="n">n_days</span><span class="o">=</span><span class="mf">0.01</span><span class="p">)</span>

<span class="c1"># Generate your FRB population</span>
<span class="n">cosmic_pop</span><span class="o">.</span><span class="n">generate</span><span class="p">()</span>

<span class="c1"># Setup a survey</span>
<span class="n">survey</span> <span class="o">=</span> <span class="n">Survey</span><span class="p">(</span><span class="s1">&#39;parkes-htru&#39;</span><span class="p">)</span>
<span class="n">survey</span><span class="o">.</span><span class="n">set_beam</span><span class="p">(</span><span class="n">model</span><span class="o">=</span><span class="s1">&#39;parkes-htru&#39;</span><span class="p">)</span>

<span class="c1"># Observe the FRB population</span>
<span class="n">survey_pop</span> <span class="o">=</span> <span class="n">SurveyPopulation</span><span class="p">(</span><span class="n">cosmic_pop</span><span class="p">,</span> <span class="n">survey</span><span class="p">)</span>

<span class="c1"># Check the detection rates</span>
<span class="nb">print</span><span class="p">(</span><span class="n">survey_pop</span><span class="o">.</span><span class="n">source_rate</span><span class="p">)</span>

<span class="c1"># Plot populations in a browser</span>
<span class="n">plot</span><span class="p">(</span><span class="n">cosmic_pop</span><span class="p">,</span> <span class="n">survey_pop</span><span class="p">,</span> <span class="n">tns</span><span class="o">=</span><span class="s1">&#39;parkes&#39;</span><span class="p">)</span>
</pre></div>
</td></tr></table></div>
<p>Curious about additional functionality in <code class="docutils literal notranslate"><span class="pre">frbpoppy</span></code>? Check the <a class="reference internal" href="get_started.html"><span class="doc">Get Started</span></a> guide, the <a class="reference internal" href="documentation.html"><span class="doc">Documentation</span></a>, or the <a class="reference external" href="https://github.com/davidgardenier/frbpoppy/tree/master/tests">tests</a> directory in <code class="docutils literal notranslate"><span class="pre">frbpoppy</span></code>.</p>
</div>
<div class="section" id="how-can-i-help">
<h2>How can I help?<a class="headerlink" href="#how-can-i-help" title="Permalink to this headline">¶</a></h2>
<p>Spotted a bug, or want to add some functionality? Simply <a class="reference external" href="https://github.com/davidgardenier/frbpoppy/issues/new">open an issue</a> on github, or <a class="reference external" href="mailto:gardenier&#37;&#52;&#48;astron&#46;nl">contact me</a> directly. Any help is appreciated!</p>
</div>
<div class="section" id="who-are-the-authors">
<h2>Who are the authors?<a class="headerlink" href="#who-are-the-authors" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><dl class="simple">
<dt><strong>David Gardenier</strong></dt><dd><p>As a PhD student at the Netherlands Institute for Radio Astronomy (ASTRON) and the University of Amsterdam (UvA), I’m working with the APERTIF/ALERT team to establish the properties of FRBs. Get in touch with me via <a class="reference external" href="mailto:gardenier&#37;&#52;&#48;astron&#46;nl">email</a>, drop past my <a class="reference external" href="http://davidgardenier.com/#slide=4">office</a> or say hello at any <a class="reference external" href="http://davidgardenier.com/activities.html#slide=3">FRB conferences</a>!</p>
</dd>
</dl>
</li>
</ul>
</div>
<div class="section" id="looking-for-more">
<h2>Looking for more?<a class="headerlink" href="#looking-for-more" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="documentation.html">Documentation</a></li>
</ul>
</div>
</div>
<div class="section" id="or-try">
<h2>Or try:<a class="headerlink" href="#or-try" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li>
<li><p><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></p></li>
<li><p><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></p></li>
</ul>
</div>
</div>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="#">
              <img class="logo" src="_static/logo_150.png" alt="Logo"/>
            </a></p>
<h1 class="logo"><a href="#">frbpoppy</a></h1>



<p class="blurb">Fast Radio Burst Population Synthesis in Python</p>








<h3><a href="#">Contents</a></h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="get_started.html">Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="documentation.html">Documentation</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="#">Documentation overview</a><ul>
      <li>Next: <a href="get_started.html" title="next chapter">Get Started</a></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3>Search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <!-- <div><input type="submit" value="Go" /></div> -->
      <!-- <input type="hidden" name="check_keywords" value="yes" /> -->
      <!-- <input type="hidden" name="area" value="default" /> -->
    </form>
</div>
<script type="text/javascript" align="center">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      
      
    </div>

    

    
  </body>
</html>