
<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>All Modules &#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="prev" title="Documentation" href="documentation.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="all-modules">
<h1>All Modules<a class="headerlink" href="#all-modules" title="Permalink to this headline">¶</a></h1>
<div class="section" id="module-beam_dists">
<span id="beam-dists"></span><h2>beam_dists<a class="headerlink" href="#module-beam_dists" title="Permalink to this headline">¶</a></h2>
<p>Functions for calculating the intensity of points in a beam.</p>
<dl class="py function">
<dt id="beam_dists.calc_max_offset">
<code class="sig-prename descclassname">beam_dists.</code><code class="sig-name descname">calc_max_offset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n</span></em>, <em class="sig-param"><span class="n">fwhm</span></em><span class="sig-paren">)</span><a class="headerlink" href="#beam_dists.calc_max_offset" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the maximum offset of an FRB in an Airy disk.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>n</strong> (<em>int</em>) – Maximum number of wanted sidelobes</p></li>
<li><p><strong>fwhm</strong> (<em>float</em>) – Size of the FWHM (note it’s a diameter) [deg]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Maximum offset from beam centre [deg]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>max_offset (float)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="beam_dists.get_beam_props">
<code class="sig-prename descclassname">beam_dists.</code><code class="sig-name descname">get_beam_props</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">fwhm</span></em><span class="sig-paren">)</span><a class="headerlink" href="#beam_dists.get_beam_props" title="Permalink to this definition">¶</a></dt>
<dd><p>Get beam properties.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>str</em>) – Which model to use.</p></li>
<li><p><strong>fwhm</strong> (<em>float</em>) – FWHM [frac. deg].</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>beam_size, pixel_scale, beam_array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="beam_dists.int_pro_fixed">
<code class="sig-prename descclassname">beam_dists.</code><code class="sig-name descname">int_pro_fixed</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ra</span></em>, <em class="sig-param"><span class="n">dec</span></em>, <em class="sig-param"><span class="n">ra_p</span></em>, <em class="sig-param"><span class="n">dec_p</span></em>, <em class="sig-param"><span class="n">lst</span></em>, <em class="sig-param"><span class="n">pattern</span><span class="o">=</span><span class="default_value">'perfect'</span></em>, <em class="sig-param"><span class="n">latitude</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">beam_array</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">pixel_scale</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">mount_type</span><span class="o">=</span><span class="default_value">'equatorial'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#beam_dists.int_pro_fixed" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate intensity profile for fixed location in beam.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ra</strong> (<em>array</em>) – Right ascension of objects [deg]</p></li>
<li><p><strong>dec</strong> (<em>array</em>) – Declination of objects [deg]</p></li>
<li><p><strong>ra_p</strong> (<em>float</em>) – Right ascension of pointing [deg]</p></li>
<li><p><strong>dec_p</strong> (<em>float</em>) – Declination of pointing [deg]</p></li>
<li><p><strong>lst</strong> (<em>float</em>) – Local Sidereal Time [deg]</p></li>
<li><p><strong>pattern</strong> (<em>str</em>) – Beam pattern types (Gaussian, perfect etc)</p></li>
<li><p><strong>latitude</strong> (<em>float</em>) – Latitude of survey [degree].</p></li>
<li><p><strong>beam_array</strong> (<em>array</em>) – Numpy array of beam pattern</p></li>
<li><p><strong>pixel_scale</strong> (<em>float</em>) – Degrees per pixel of beam_array [degree]</p></li>
<li><p><strong>mount_type</strong> (<em>str</em>) – Survey mount type</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>intensity, x offset [deg], y offset [deg]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array, array, array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="beam_dists.int_pro_random">
<code class="sig-prename descclassname">beam_dists.</code><code class="sig-name descname">int_pro_random</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1, 1</span></em>, <em class="sig-param"><span class="n">pattern</span><span class="o">=</span><span class="default_value">'perfect'</span></em>, <em class="sig-param"><span class="n">fwhm</span><span class="o">=</span><span class="default_value">2</span></em>, <em class="sig-param"><span class="n">max_offset</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">central_freq</span><span class="o">=</span><span class="default_value">1400</span></em>, <em class="sig-param"><span class="n">beam_array</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">pixel_scale</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#beam_dists.int_pro_random" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the intensity profile in random places of a beam pattern.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>shape</strong> (<em>tuple</em>) – The shape of the array with intensities that you need.</p></li>
<li><p><strong>pattern</strong> (<em>str</em>) – Beam pattern types (Gaussian, perfect etc)</p></li>
<li><p><strong>fwhm</strong> (<em>float</em>) – FWHM [degree].</p></li>
<li><p><strong>max_offset</strong> (<em>float</em>) – Maximum offset from centre of beam [degree].</p></li>
<li><p><strong>central_freq</strong> (<em>float</em>) – Central frequency [MHz].</p></li>
<li><p><strong>beam_array</strong> (<em>array</em>) – Numpy array of beam pattern</p></li>
<li><p><strong>pixel_scale</strong> (<em>float</em>) – Degrees per pixel of beam_array [degree]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>intensity, offset from beam [degree]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array, array</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-cosmic_pop">
<span id="cosmic-pop"></span><h2>cosmic_pop<a class="headerlink" href="#module-cosmic_pop" title="Permalink to this headline">¶</a></h2>
<p>Class to generate a cosmic population of FRBs.</p>
<dl class="py class">
<dt id="cosmic_pop.CosmicPopulation">
<em class="property">class </em><code class="sig-prename descclassname">cosmic_pop.</code><code class="sig-name descname">CosmicPopulation</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n_srcs</span><span class="o">=</span><span class="default_value">10000.0</span></em>, <em class="sig-param"><span class="n">n_days</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">name</span><span class="o">=</span><span class="default_value">'cosmic'</span></em>, <em class="sig-param"><span class="n">repeaters</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">generate</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">frbpoppy.population.Population</span></code></p>
<p>Generate a cosmic FRB population.</p>
<p>Generate a popuation of FRBs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>n_srcs</strong> (<em>int</em>) – Number of FRB sources to generate.</p></li>
<li><p><strong>n_days</strong> (<em>float</em>) – Number of days over which FRBs are to be generated.</p></li>
<li><p><strong>name</strong> (<em>str</em>) – Population name.</p></li>
<li><p><strong>repeaters</strong> (<em>bool</em>) – Whether to generate a repeater population.</p></li>
<li><p><strong>generate</strong> (<em>bool</em>) – Whether to create a population.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Population of FRBs</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#population.Population" title="population.Population">Population</a></p>
</dd>
</dl>
<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.complex">
<em class="property">classmethod </em><code class="sig-name descname">complex</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n_srcs</span></em>, <em class="sig-param"><span class="n">n_days</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">repeaters</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">generate</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.complex" title="Permalink to this definition">¶</a></dt>
<dd><p>Set up a complex population.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_direction">
<code class="sig-name descname">gen_direction</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_direction" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate the direction of frbs.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_dist">
<code class="sig-name descname">gen_dist</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_dist" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate source distances.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_dm">
<code class="sig-name descname">gen_dm</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_dm" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate total dispersion measure.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_dm_host">
<code class="sig-name descname">gen_dm_host</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_dm_host" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate host dispersion measure.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_dm_igm">
<code class="sig-name descname">gen_dm_igm</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_dm_igm" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate intergalactic dispersion measure.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_dm_mw">
<code class="sig-name descname">gen_dm_mw</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_dm_mw" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate Milky Way dispersion measure.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_gal_coords">
<code class="sig-name descname">gen_gal_coords</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_gal_coords" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate galactic coordinates.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_index">
<code class="sig-name descname">gen_index</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_index" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate indices for over each FRB source.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_lum">
<code class="sig-name descname">gen_lum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_lum" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate luminosities [ergs/s].</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_precalc">
<code class="sig-name descname">gen_precalc</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_precalc" title="Permalink to this definition">¶</a></dt>
<dd><p>Check whether pre-calculations have been run.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_si">
<code class="sig-name descname">gen_si</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_si" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate spectral indices.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_time">
<code class="sig-name descname">gen_time</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_time" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate time stamps.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.gen_w">
<code class="sig-name descname">gen_w</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.gen_w" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate pulse widths [ms].</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.generate">
<code class="sig-name descname">generate</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.generate" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a full CosmicPopulation.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.optimal">
<em class="property">classmethod </em><code class="sig-name descname">optimal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n_srcs</span></em>, <em class="sig-param"><span class="n">n_days</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">repeaters</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">generate</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.optimal" title="Permalink to this definition">¶</a></dt>
<dd><p>Set up a complex population.</p>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.set_direction">
<code class="sig-name descname">set_direction</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span><span class="o">=</span><span class="default_value">'uniform'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.set_direction" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the model for generating the directions of the frb sources.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>model</strong> (<em>str</em>) – Choice from (‘uniform’).</p>
</dd>
</dl>
<dl class="simple">
<dt>if model == ‘uniform’:</dt><dd><p>min_ra (float): Minimum right ascenion [frac deg].
max_ra (float): Maximum right ascenion [frac deg].
min_dec (float): Minimum declination [frac deg].
max_dec (float): Maximum declination [frac deg].</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.set_dist">
<code class="sig-name descname">set_dist</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span><span class="o">=</span><span class="default_value">'vol_co'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.set_dist" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the number density model for calculating distances.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>str</em>) – Number density model to use. Choice from
(‘vol_co’, ‘sfr’, ‘smd’).</p></li>
<li><p><strong>z_max</strong> (<em>float</em>) – Maximum redshift.</p></li>
<li><p><strong>H_0</strong> (<em>float</em>) – Hubble constant.</p></li>
<li><p><strong>W_m</strong> (<em>float</em>) – Density parameter Ω_m.</p></li>
<li><p><strong>W_v</strong> (<em>float</em>) – Cosmological constant Ω_Λ.</p></li>
<li><p><strong>alpha</strong> (<em>float</em>) – Desired log N log S slope for a perfect,
non-cosmological population.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.set_dm">
<code class="sig-name descname">set_dm</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mw</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">igm</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">host</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.set_dm" title="Permalink to this definition">¶</a></dt>
<dd><p>Set total dispersion measure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mw</strong> (<em>bool</em>) – Whether to include a Milky Way component</p></li>
<li><p><strong>igm</strong> (<em>bool</em>) – Whether to include an IGM component</p></li>
<li><p><strong>host</strong> (<em>bool</em>) – Whether to include a host galaxy component</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.set_dm_host">
<code class="sig-name descname">set_dm_host</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span><span class="o">=</span><span class="default_value">'gauss'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.set_dm_host" title="Permalink to this definition">¶</a></dt>
<dd><p>Set host galaxy dispersion measure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>model</strong> (<em>str</em>) – Options from (‘gauss’, ‘lognormal’).</p>
</dd>
</dl>
<dl class="simple">
<dt>if model in (‘gauss’, ‘lognormal’):</dt><dd><p>mean (float): Mean DM [pc/cm^3].
std (float): Standard deviation DM [pc/cm^3].</p>
</dd>
<dt>if model == ‘constant’:</dt><dd><p>value (float): Value to adopt [pc/cm^3].</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.set_dm_igm">
<code class="sig-name descname">set_dm_igm</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span><span class="o">=</span><span class="default_value">'ioka'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.set_dm_igm" title="Permalink to this definition">¶</a></dt>
<dd><p>Set intergalactic dispersion measure model.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>model</strong> (<em>str</em>) – Option of ‘ioka’.</p>
</dd>
</dl>
<dl class="simple">
<dt>if model == ‘ioka’:</dt><dd><p>slope (float): Slope of the DM-z relationship.
std (float): Spread around the DM-z relationship.
spread_dist (str): ‘normal’ or ‘lognormal’.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.set_dm_mw">
<code class="sig-name descname">set_dm_mw</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span><span class="o">=</span><span class="default_value">'ne2001'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.set_dm_mw" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the model for the Milky Way dispersion measure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>model</strong> (<em>str</em>) – Option of ‘ne2001’.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.set_emission_range">
<code class="sig-name descname">set_emission_range</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">low</span><span class="o">=</span><span class="default_value">100000000.0</span></em>, <em class="sig-param"><span class="n">high</span><span class="o">=</span><span class="default_value">10000000000.0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.set_emission_range" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the emission range [Hz].</p>
<p>The frequency range between which FRB sources should emit the given
bolometric luminosity.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>f_min</strong> (<em>float</em>) – Lowest source frequency [Hz].</p></li>
<li><p><strong>f_max</strong> (<em>float</em>) – Highest source frequency [Hz].</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.set_lum">
<code class="sig-name descname">set_lum</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span><span class="o">=</span><span class="default_value">'powerlaw'</span></em>, <em class="sig-param"><span class="n">per_source</span><span class="o">=</span><span class="default_value">'same'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.set_lum" title="Permalink to this definition">¶</a></dt>
<dd><p>Set luminosity function [ergs/s].</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>str</em>) – Options from (‘powerlaw’)</p></li>
<li><p><strong>per_source</strong> (<em>str</em>) – Model for a single source burst
distribution. Options from (‘same’, ‘different’)</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>If model == ‘powerlaw’:</dt><dd><p>low (float): Minimum bolometric luminosity [ergs/s]
high (float): Maximum bolometric luminosity [ergs/s]
power (float): Power of luminosity function</p>
</dd>
<dt>If model == ‘constant’:</dt><dd><p>value (float): Value for standard candle [ergs/s]</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.set_si">
<code class="sig-name descname">set_si</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span><span class="o">=</span><span class="default_value">'gauss'</span></em>, <em class="sig-param"><span class="n">per_source</span><span class="o">=</span><span class="default_value">'same'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.set_si" title="Permalink to this definition">¶</a></dt>
<dd><p>Set spectral index model.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>str</em>) – Options from (‘gauss’)</p></li>
<li><p><strong>per_source</strong> (<em>str</em>) – Model for a single source burst
distribution. Options from (‘same’, ‘different’)</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>If model == ‘constant’:</dt><dd><p>value (float): Default spectal index.</p>
</dd>
<dt>If model == ‘gauss’:</dt><dd><p>mean (float): Mean spectral index
std (float): Standard deviation spectral index</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.set_time">
<code class="sig-name descname">set_time</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span><span class="o">=</span><span class="default_value">'regular'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.set_time" title="Permalink to this definition">¶</a></dt>
<dd><p>Set model from which to generate time stamps.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>model</strong> (<em>str</em>) – Options from (‘single’, ‘regular’, ‘clustered’,
‘poisson’, ‘cyclic’)</p>
</dd>
</dl>
<dl class="simple">
<dt>If model == ‘regular’:</dt><dd><p>rate (float): Number of bursts per day</p>
</dd>
<dt>If model == ‘poisson’:</dt><dd><p>rate (float): Expected number of bursts per day</p>
</dd>
<dt>If model == ‘clustered’:</dt><dd><p>r (float): Rate parameter
k (float): Shape parameter</p>
</dd>
<dt>If model == ‘cyclic’:</dt><dd><p>rate (float): Number of bursts per day
period (float): Period of activity cycle (days)
frac (float): Fraction of activity cycle a source is active</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.set_w">
<code class="sig-name descname">set_w</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span><span class="o">=</span><span class="default_value">'uniform'</span></em>, <em class="sig-param"><span class="n">per_source</span><span class="o">=</span><span class="default_value">'same'</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.set_w" title="Permalink to this definition">¶</a></dt>
<dd><p>Set intrinsic pulse widths model [ms].</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>str</em>) – Options from (‘uniform’, ‘lognormal’)</p></li>
<li><p><strong>per_source</strong> (<em>str</em>) – Model for a single source burst
distribution. Options from ‘same’ or ‘different’</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>If model == ‘constant’:</dt><dd><p>value (float): Pulse width [ms].</p>
</dd>
<dt>If model == ‘uniform’:</dt><dd><p>low (float): Minimum pulse width [ms].
high (float): Maximum pulse width [ms].</p>
</dd>
<dt>If model == ‘lognormal’:</dt><dd><p>mean (float): Mean pulse width [ms].
std (float): Standard deviation pulse width [ms].</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="cosmic_pop.CosmicPopulation.simple">
<em class="property">classmethod </em><code class="sig-name descname">simple</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n_srcs</span></em>, <em class="sig-param"><span class="n">n_days</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">repeaters</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">generate</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cosmic_pop.CosmicPopulation.simple" title="Permalink to this definition">¶</a></dt>
<dd><p>Set up a simple, local population.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-direction_dists">
<span id="direction-dists"></span><h2>direction_dists<a class="headerlink" href="#module-direction_dists" title="Permalink to this headline">¶</a></h2>
<p>Spatial direction distributions for FRB sources.</p>
<dl class="py function">
<dt id="direction_dists.uniform">
<code class="sig-prename descclassname">direction_dists.</code><code class="sig-name descname">uniform</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">min_ra</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">max_ra</span><span class="o">=</span><span class="default_value">360</span></em>, <em class="sig-param"><span class="n">min_dec</span><span class="o">=</span><span class="default_value">- 90</span></em>, <em class="sig-param"><span class="n">max_dec</span><span class="o">=</span><span class="default_value">90</span></em>, <em class="sig-param"><span class="n">n_srcs</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#direction_dists.uniform" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a uniform distribution of pointings.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>min_ra</strong> (<em>float</em>) – Minimum right ascenion [frac deg].</p></li>
<li><p><strong>max_ra</strong> (<em>float</em>) – Maximum right ascenion [frac deg].</p></li>
<li><p><strong>min_dec</strong> (<em>float</em>) – Minimum declination [frac deg].</p></li>
<li><p><strong>max_dec</strong> (<em>float</em>) – Maximum declination [frac deg].</p></li>
<li><p><strong>n_srcs</strong> (<em>int</em>) – Number of sources for which to generate.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>RA, Dec arrays [frac deg]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-dm_dists">
<span id="dm-dists"></span><h2>dm_dists<a class="headerlink" href="#module-dm_dists" title="Permalink to this headline">¶</a></h2>
<p>Functions to generate dispersion measure distributions.</p>
<dl class="py function">
<dt id="dm_dists.constant">
<code class="sig-prename descclassname">dm_dists.</code><code class="sig-name descname">constant</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">value</span><span class="o">=</span><span class="default_value">100</span></em>, <em class="sig-param"><span class="n">n_srcs</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#dm_dists.constant" title="Permalink to this definition">¶</a></dt>
<dd><p>Adopt a constant DM value similar to Thorton.</p>
</dd></dl>

<dl class="py function">
<dt id="dm_dists.gauss">
<code class="sig-prename descclassname">dm_dists.</code><code class="sig-name descname">gauss</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span><span class="o">=</span><span class="default_value">100</span></em>, <em class="sig-param"><span class="n">std</span><span class="o">=</span><span class="default_value">200</span></em>, <em class="sig-param"><span class="n">n_srcs</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#dm_dists.gauss" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate dm host contributions similar to Tendulkar.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mean</strong> (<em>float</em>) – Mean DM [pc/cm^3].</p></li>
<li><p><strong>std</strong> (<em>float</em>) – Standard deviation DM [pc/cm^3].</p></li>
<li><p><strong>n_srcs</strong> (<em>int</em>) – Number of sources for which to generate values.</p></li>
<li><p><strong>z</strong> (<em>int</em>) – Redshift of sources.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>DM host [pc/cm^3]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="dm_dists.ioka">
<code class="sig-prename descclassname">dm_dists.</code><code class="sig-name descname">ioka</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">slope</span><span class="o">=</span><span class="default_value">950</span></em>, <em class="sig-param"><span class="n">std</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">spread_dist</span><span class="o">=</span><span class="default_value">'normal'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#dm_dists.ioka" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the contribution of the igm to the dispersion measure.</p>
<p>Follows Ioka (2003) and Inoue (2004), with default slope value falling
in between the Cordes and Petroff reviews.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>z</strong> (<em>array</em>) – Redshifts.</p></li>
<li><p><strong>slope</strong> (<em>float</em>) – Slope of the DM-z relationship.</p></li>
<li><p><strong>std</strong> (<em>float</em>) – Spread around the DM-z relationship.</p></li>
<li><p><strong>spread_dist</strong> (<em>str</em>) – Spread function option. Choice from
(‘normal’, ‘lognormal’, ‘log10normal’)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Dispersion measure of intergalactic medium [pc/cm^3]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>dm_igm (array)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="dm_dists.log10normal">
<code class="sig-prename descclassname">dm_dists.</code><code class="sig-name descname">log10normal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span><span class="o">=</span><span class="default_value">100</span></em>, <em class="sig-param"><span class="n">std</span><span class="o">=</span><span class="default_value">200</span></em>, <em class="sig-param"><span class="n">n_srcs</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#dm_dists.log10normal" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a log10 normal dm host distribution.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mean</strong> (<em>float</em>) – Mean DM [pc/cm^3].</p></li>
<li><p><strong>std</strong> (<em>float</em>) – Standard deviation DM [pc/cm^3].</p></li>
<li><p><strong>n_srcs</strong> (<em>int</em>) – Number of sources for which to generate values.</p></li>
<li><p><strong>z</strong> (<em>int</em>) – Redshift of sources.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>DM host [pc/cm^3]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="dm_dists.lognormal">
<code class="sig-prename descclassname">dm_dists.</code><code class="sig-name descname">lognormal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span><span class="o">=</span><span class="default_value">100</span></em>, <em class="sig-param"><span class="n">std</span><span class="o">=</span><span class="default_value">200</span></em>, <em class="sig-param"><span class="n">n_srcs</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#dm_dists.lognormal" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a lognormal dm host distribution.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mean</strong> (<em>float</em>) – Mean DM [pc/cm^3].</p></li>
<li><p><strong>std</strong> (<em>float</em>) – Standard deviation DM [pc/cm^3].</p></li>
<li><p><strong>n_srcs</strong> (<em>int</em>) – Number of sources for which to generate values.</p></li>
<li><p><strong>z</strong> (<em>int</em>) – Redshift of sources.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>DM host [pc/cm^3]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-do_hist">
<span id="do-hist"></span><h2>do_hist<a class="headerlink" href="#module-do_hist" title="Permalink to this headline">¶</a></h2>
<p>Bin up Pandas DataFrames into histograms ready for Bokeh plotting.</p>
<dl class="py function">
<dt id="do_hist.histogram">
<code class="sig-prename descclassname">do_hist.</code><code class="sig-name descname">histogram</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dfs</span></em>, <em class="sig-param"><span class="n">n_bins</span><span class="o">=</span><span class="default_value">50</span></em>, <em class="sig-param"><span class="n">log</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">mc</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">cum</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#do_hist.histogram" title="Permalink to this definition">¶</a></dt>
<dd><p>Quick function to ‘histogram’ each column of each dataframe.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dfs</strong> (<em>list</em>) – List of dataframes</p></li>
<li><p><strong>n_bins</strong> (<em>int</em>) – Number of bins</p></li>
<li><p><strong>log</strong> (<em>bool</em>) – Bin in log space or not</p></li>
<li><p><strong>mc</strong> (<em>bool</em>) – Whether running for a Monte Carlo plot</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of histogramed dataframes</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>hists (list)</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-do_plot">
<span id="do-plot"></span><h2>do_plot<a class="headerlink" href="#module-do_plot" title="Permalink to this headline">¶</a></h2>
<p>Start up Bokeh server.</p>
<dl class="py function">
<dt id="do_plot.plot">
<code class="sig-prename descclassname">do_plot.</code><code class="sig-name descname">plot</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">pops</span></em>, <em class="sig-param"><span class="n">files</span><span class="o">=</span><span class="default_value">[]</span></em>, <em class="sig-param"><span class="n">tns</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">show</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">mute</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">port</span><span class="o">=</span><span class="default_value">5006</span></em>, <em class="sig-param"><span class="n">print_command</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#do_plot.plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot populations with bokeh. Has to save populations before plotting.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>*pops</strong> (<a class="reference internal" href="#population.Population" title="population.Population"><em>Population</em></a><em>, </em><em>optional</em>) – Add the populations you would like to
see plotted</p></li>
<li><p><strong>files</strong> (<em>list</em><em>, </em><em>optional</em>) – List of population files to plot.</p></li>
<li><p><strong>tns</strong> (<em>bool</em><em>, </em><em>optional</em>) – Whether to plot tns parameters. Defaults to
True</p></li>
<li><p><strong>show</strong> (<em>bool</em><em>, </em><em>optional</em>) – Whether to display the plot or not. Mainly used
for debugging purposes. Defaults to True.</p></li>
<li><p><strong>mute</strong> (<em>bool</em>) – Show output from Bokeh or not</p></li>
<li><p><strong>port</strong> (<em>int</em>) – The port on which to launch Bokeh</p></li>
<li><p><strong>print_command</strong> (<em>bool</em>) – Whether to show the command do_plot is running</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-frbcatpoppy">
<span id="frbcatpoppy"></span><h2>frbcatpoppy<a class="headerlink" href="#module-frbcatpoppy" title="Permalink to this headline">¶</a></h2>
<p>Do things with frbcat.</p>
<dl class="py class">
<dt id="frbcatpoppy.Frbcat">
<em class="property">class </em><code class="sig-prename descclassname">frbcatpoppy.</code><code class="sig-name descname">Frbcat</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">frbpoppy</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">repeat_bursts</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">mute</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#frbcatpoppy.Frbcat" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">frbcat.frbcat_file.Frbcat</span></code></p>
<p>Add frbpoppy functionality to Frbcat.</p>
<p>Get the pandas dataframe with Frbcat().df</p>
<p>Initialize.</p>
<dl class="py method">
<dt id="frbcatpoppy.Frbcat.frbpoppify">
<code class="sig-name descname">frbpoppify</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#frbcatpoppy.Frbcat.frbpoppify" title="Permalink to this definition">¶</a></dt>
<dd><p>Prep data for frbpoppy.</p>
</dd></dl>

<dl class="py method">
<dt id="frbcatpoppy.Frbcat.match_surveys">
<code class="sig-name descname">match_surveys</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">interrupt</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#frbcatpoppy.Frbcat.match_surveys" title="Permalink to this definition">¶</a></dt>
<dd><p>Match up frbs with surveys.</p>
</dd></dl>

<dl class="py method">
<dt id="frbcatpoppy.Frbcat.to_pop">
<code class="sig-name descname">to_pop</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">df</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#frbcatpoppy.Frbcat.to_pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert to a Population object.</p>
<p>Please ensure self.clean() has been run first.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-frbs">
<span id="frbs"></span><h2>frbs<a class="headerlink" href="#module-frbs" title="Permalink to this headline">¶</a></h2>
<p>Class to hold FRB source properties.</p>
<dl class="py class">
<dt id="frbs.FRBs">
<em class="property">class </em><code class="sig-prename descclassname">frbs.</code><code class="sig-name descname">FRBs</code><a class="headerlink" href="#frbs.FRBs" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class containing FRB properties.</p>
<p>Initializing.</p>
<dl class="py method">
<dt id="frbs.FRBs.apply">
<code class="sig-name descname">apply</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mask</span></em><span class="sig-paren">)</span><a class="headerlink" href="#frbs.FRBs.apply" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply a Numpy array to all parameters.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mask</strong> (<em>array</em>) – Masking array to apply to all frb parameters.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="frbs.FRBs.calc_logn_logs">
<code class="sig-name descname">calc_logn_logs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">parameter</span><span class="o">=</span><span class="default_value">'fluence'</span></em>, <em class="sig-param"><span class="n">min_p</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">max_p</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#frbs.FRBs.calc_logn_logs" title="Permalink to this definition">¶</a></dt>
<dd><p>Rough method to retrive the slope of a LogNlogS distribution.</p>
</dd></dl>

<dl class="py method">
<dt id="frbs.FRBs.clean_up">
<code class="sig-name descname">clean_up</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#frbs.FRBs.clean_up" title="Permalink to this definition">¶</a></dt>
<dd><p>Clean up 2D parameter arrays by left justifying them.</p>
</dd></dl>

<dl class="py method">
<dt id="frbs.FRBs.to_csv">
<code class="sig-name descname">to_csv</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">path</span></em><span class="sig-paren">)</span><a class="headerlink" href="#frbs.FRBs.to_csv" title="Permalink to this definition">¶</a></dt>
<dd><p>Export properties to a csv file.</p>
</dd></dl>

<dl class="py method">
<dt id="frbs.FRBs.to_df">
<code class="sig-name descname">to_df</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#frbs.FRBs.to_df" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert properties to a Pandas DataFrame.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-galacticops">
<span id="galacticops"></span><h2>galacticops<a class="headerlink" href="#module-galacticops" title="Permalink to this headline">¶</a></h2>
<p>Series of galactic operations (doesn’t that sound cool?!).</p>
<p>…as in converting coordinates, calculating DM etc.</p>
<dl class="py class">
<dt id="galacticops.Redshift">
<em class="property">class </em><code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">Redshift</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">z</span></em>, <em class="sig-param"><span class="n">H_0</span><span class="o">=</span><span class="default_value">67.74</span></em>, <em class="sig-param"><span class="n">W_m</span><span class="o">=</span><span class="default_value">0.3089</span></em>, <em class="sig-param"><span class="n">W_v</span><span class="o">=</span><span class="default_value">0.6911</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.Redshift" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class for converting redshift to other distance measures.</p>
<p>Convert redshift to a various measures.</p>
<p>Based on James Schombert’s python implementation of Edward L. Wright’s
cosmology calculator.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>z</strong> (<em>array</em>) – Redshift</p></li>
<li><p><strong>self.H_0</strong> (<em>float</em><em>, </em><em>optional</em>) – Hubble parameter.</p></li>
<li><p><strong>self.W_m</strong> (<em>float</em><em>, </em><em>optional</em>) – Omega matter.</p></li>
<li><p><strong>self.W_v</strong> (<em>float</em><em>, </em><em>optional</em>) – Omega vacuum.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl class="simple">
<dt>One of the distance measures [Gpc], or comoving volume from</dt><dd><p>Earth to the source [Gpc^3]</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
<dl class="py method">
<dt id="galacticops.Redshift.dist_co">
<code class="sig-name descname">dist_co</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.Redshift.dist_co" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the corresponding comoving distance [Gpc].</p>
</dd></dl>

<dl class="py method">
<dt id="galacticops.Redshift.dist_lum">
<code class="sig-name descname">dist_lum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.Redshift.dist_lum" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the corresponding luminosity distance [Gpc].</p>
</dd></dl>

<dl class="py method">
<dt id="galacticops.Redshift.vol_co">
<code class="sig-name descname">vol_co</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.Redshift.vol_co" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the corresponding comoving volume [Gpc^3].</p>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt id="galacticops.calc_sky_area">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">calc_sky_area</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">radius</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.calc_sky_area" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine the area [sq. degree] of a radius [deg] along the sky.</p>
</dd></dl>

<dl class="py function">
<dt id="galacticops.calc_sky_radius">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">calc_sky_radius</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">area</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.calc_sky_radius" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine the radius [deg] along the sky of an area [sq. degrees].</p>
</dd></dl>

<dl class="py function">
<dt id="galacticops.coord_to_offset">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">coord_to_offset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">xref</span></em>, <em class="sig-param"><span class="n">yref</span></em>, <em class="sig-param"><span class="n">x</span></em>, <em class="sig-param"><span class="n">y</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.coord_to_offset" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert point (x, y) to projected offset from reference (xref, yref).</p>
<dl class="simple">
<dt>Makes use of a gnomonic projection: see both</dt><dd><p><a class="reference external" href="https://github.com/LSSTDESC/Coord/blob/master/coord/celestial.py">https://github.com/LSSTDESC/Coord/blob/master/coord/celestial.py</a>
<a class="reference external" href="http://mathworld.wolfram.com/GnomonicProjection.html">http://mathworld.wolfram.com/GnomonicProjection.html</a></p>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xref</strong> (<em>array</em>) – Reference RA or Az [rad]</p></li>
<li><p><strong>yref</strong> (<em>array</em>) – Reference Dec or Alt [rad]</p></li>
<li><p><strong>x</strong> (<em>array</em>) – Target RA or Az [rad]</p></li>
<li><p><strong>y</strong> (<em>array</em>) – Target Dec or Alt [rad]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>x and y offset [rad]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array, array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.datetime_to_gmst">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">datetime_to_gmst</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">date</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.datetime_to_gmst" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate Greenwich Mean Sidereal Time.</p>
<p>See <a class="reference external" href="https://aa.usno.navy.mil/faq/docs/GAST.php">https://aa.usno.navy.mil/faq/docs/GAST.php</a> for more info.</p>
</dd></dl>

<dl class="py function">
<dt id="galacticops.datetime_to_julian">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">datetime_to_julian</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">date</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.datetime_to_julian" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a datetime object into julian float.</p>
<p>See <a class="reference external" href="https://aa.usno.navy.mil/faq/docs/JD_Formula.php">https://aa.usno.navy.mil/faq/docs/JD_Formula.php</a> for more info.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>date</strong> (<em>datetime-object</em>) – Date in question</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Julian calculated datetime.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.dist_to_z">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">dist_to_z</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dist</span></em>, <em class="sig-param"><span class="n">H_0</span><span class="o">=</span><span class="default_value">67.74</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.dist_to_z" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate redshift from a distance in Gpc.</p>
<p>Only holds for z &lt;= 2. Formulas from ‘An Introduction to Modern
Astrophysics (2nd Edition)’ by Bradley W. Carroll, Dale A. Ostlie.
(Eq. 27.7)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dist</strong> (<em>float</em>) – Distance [Gpc].</p></li>
<li><p><strong>H_0</strong> (<em>float</em><em>, </em><em>optional</em>) – Hubble parameter. Defaults to 67.74</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Associated redshift</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>z (float)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.frac_deg">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">frac_deg</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ra</span></em>, <em class="sig-param"><span class="n">dec</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.frac_deg" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert coordinates expressed in hh:mm:ss to fractional degrees.</p>
</dd></dl>

<dl class="py function">
<dt id="galacticops.hadec_to_azalt">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">hadec_to_azalt</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ha</span></em>, <em class="sig-param"><span class="n">dec</span></em>, <em class="sig-param"><span class="n">lat</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.hadec_to_azalt" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert hour angle and declination to azimuth and altitude.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ha</strong> (<em>array</em>) – Hour angle [rad]</p></li>
<li><p><strong>dec</strong> (<em>array</em>) – Declination [rad]</p></li>
<li><p><strong>lat</strong> (<em>float</em>) – Latitude [rad]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>az, alt [rad]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array, array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.in_region">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">in_region</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ra</span></em>, <em class="sig-param"><span class="n">dec</span></em>, <em class="sig-param"><span class="n">gl</span></em>, <em class="sig-param"><span class="n">gb</span></em>, <em class="sig-param"><span class="n">ra_min</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">ra_max</span><span class="o">=</span><span class="default_value">360</span></em>, <em class="sig-param"><span class="n">dec_min</span><span class="o">=</span><span class="default_value">- 90</span></em>, <em class="sig-param"><span class="n">dec_max</span><span class="o">=</span><span class="default_value">90</span></em>, <em class="sig-param"><span class="n">gl_min</span><span class="o">=</span><span class="default_value">- 180</span></em>, <em class="sig-param"><span class="n">gl_max</span><span class="o">=</span><span class="default_value">180</span></em>, <em class="sig-param"><span class="n">gb_min</span><span class="o">=</span><span class="default_value">- 90</span></em>, <em class="sig-param"><span class="n">gb_max</span><span class="o">=</span><span class="default_value">90</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.in_region" title="Permalink to this definition">¶</a></dt>
<dd><p>Check if the given frbs are within the survey region.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>dec</strong><strong>, </strong><strong>gl</strong><strong>, </strong><strong>gb</strong> (<em>ra</em><em>,</em>) – Coordinates to check whether in region</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Boolean mask denoting whether frbs are within survey region</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.lb_to_radec">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">lb_to_radec</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">l</span></em>, <em class="sig-param"><span class="n">b</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.lb_to_radec" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert galactic coordinates to RA, Dec.</p>
<p>Formulas from ‘An Introduction to Modern Astrophysics (2nd Edition)’ by
Bradley W. Carroll, Dale A. Ostlie (Eq. 24.19 onwards).</p>
<p>NOTE: This function is not as accurate as the astropy conversion, nor as
the Javascript calculators found online. However, as using astropy was
prohibitively slow while running over large populations, frbpoppy uses this
function. While this function is not as accurate, the under/over
estimations of the coordinates are equally distributed meaning the errors
cancel each other in the limit of large populations.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>l</strong> (<em>float</em>) – Galactic longitude [fractional degrees]</p></li>
<li><p><strong>b</strong> (<em>float</em>) – Galactic latitude [fractional degrees]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Right ascension and declination [fractional degrees]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>ra, dec (float)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.lb_to_xyz">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">lb_to_xyz</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">gl</span></em>, <em class="sig-param"><span class="n">gb</span></em>, <em class="sig-param"><span class="n">dist</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.lb_to_xyz" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert galactic coordinates to galactic XYZ.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>l</strong> (<em>float</em>) – Galactic longitude [fractional degrees]</p></li>
<li><p><strong>b</strong> (<em>float</em>) – Galactic latitude [fractional degrees]</p></li>
<li><p><strong>dist</strong> (<em>float</em>) – Distance to source [Gpc]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Galactic XYZ [Gpc]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>gx, gy, gz</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.load_T_sky">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">load_T_sky</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.load_T_sky" title="Permalink to this definition">¶</a></dt>
<dd><p>Read the Haslam sky temperature map into a list.</p>
<p>… from which temperatures can
be retrieved. The temperature sky map is given in the weird units of
HealPix, and despite looking up info on this coordinate system, I don’t
have the foggiest idea of how to transform these to galactic coordinates. I
have therefore directly copied the following code from psrpoppy in the
assumption Sam Bates managed to figure it out.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>List of sky temperatures in HealPix? coordinates?</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>t_sky_list (list)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.ne2001_dist_to_dm">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">ne2001_dist_to_dm</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dist</span></em>, <em class="sig-param"><span class="n">gl</span></em>, <em class="sig-param"><span class="n">gb</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.ne2001_dist_to_dm" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert position to a dispersion measure using NE2001.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dist</strong> (<em>float</em>) – Distance to source [Gpc]. Distance will be cut at 100kpc,
as NE2001 can not cope with larger distances. This value
should be more than enough to clear the Milky Way.</p></li>
<li><p><strong>gl</strong> (<em>float</em>) – Galactic longitude [fractional degrees]</p></li>
<li><p><strong>gb</strong> (<em>float</em>) – Galactic latitude [fractional degrees]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Dispersion measure [pc*cm^-3]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>dm (float)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.ne2001_get_smtau">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">ne2001_get_smtau</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dist</span></em>, <em class="sig-param"><span class="n">gl</span></em>, <em class="sig-param"><span class="n">gb</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.ne2001_get_smtau" title="Permalink to this definition">¶</a></dt>
<dd><p>Use the NE2001 model to calculate scattering measure.</p>
<p>Calculations based on work presented in Cordes &amp; Lazio
(1991, DOI: 10.1086/170261)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dist</strong> (<em>array</em>) – Distance to source [kpc]. Distance will be cut at 100 kpc
as NE2001 can not cope with larger distances. Therefore
the calculated scattering will only be that from the
Milky Way.</p></li>
<li><p><strong>gl</strong> (<em>array</em>) – Galactic longitude [fractional degrees]</p></li>
<li><p><strong>gb</strong> (<em>array</em>) – Galactic latitude [fractional degrees]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Scattering measure
smtau (array): Scattering measure, but unsure why different to sm</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>sm (array)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.ne2001_scint_time_bw">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">ne2001_scint_time_bw</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dist</span></em>, <em class="sig-param"><span class="n">gl</span></em>, <em class="sig-param"><span class="n">gb</span></em>, <em class="sig-param"><span class="n">freq</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.ne2001_scint_time_bw" title="Permalink to this definition">¶</a></dt>
<dd><p>Use the NE2001 model to get the diffractive scintillation timescale.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dist</strong> (<em>array</em>) – Distance to source [Gpc]. Distance will be cut at 100 kpc
as NE2001 can not cope with larger distances. Therefore
the calculated scintillation timescale will only be that
from the Milky Way.</p></li>
<li><p><strong>gl</strong> (<em>array</em>) – Galactic longitude [fractional degrees]</p></li>
<li><p><strong>gb</strong> (<em>array</em>) – Galactic latitude [fractional degrees]</p></li>
<li><p><strong>freq</strong> (<em>float</em>) – Observing frequency [MHz]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Diffractive scintillation timescale [Hz]
scint_bw (float): Scintillation bandwidth [Hz]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>scint_time (float)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.radec_to_lb">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">radec_to_lb</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ra</span></em>, <em class="sig-param"><span class="n">dec</span></em>, <em class="sig-param"><span class="n">frac</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.radec_to_lb" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert from ra, dec to galactic coordinates.</p>
<p>Formulas from ‘An Introduction to Modern Astrophysics (2nd Edition)’ by
Bradley W. Carroll, Dale A. Ostlie (Eq. 24.16 onwards).</p>
<p>NOTE: This function is not as accurate as the astropy conversion, nor as
the Javascript calculators found online. However, as using astropy was
prohibitively slow while running over large populations, we use this
function. While this function is not as accurate, the under/over
estimations of the coordinates are equally distributed meaning the errors
cancel each other in the limit of large populations.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ra</strong> (<em>string</em>) – Right ascension given in the form ‘19:06:53’</p></li>
<li><p><strong>dec</strong> (<em>string</em>) – Declination given in the form ‘-40:37:14’</p></li>
<li><p><strong>frac</strong> (<em>bool</em>) – Denote whether coordinates are already fractional or not</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Galactic longitude and latitude [fractional degrees]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>gl, gb (float)</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.random_date">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">random_date</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">start</span></em>, <em class="sig-param"><span class="n">end</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.random_date" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a random datetime between two datetime objects.</p>
</dd></dl>

<dl class="py function">
<dt id="galacticops.scatter_bhat">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">scatter_bhat</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dm</span></em>, <em class="sig-param"><span class="n">offset</span><span class="o">=</span><span class="default_value">- 6.46</span></em>, <em class="sig-param"><span class="n">scindex</span><span class="o">=</span><span class="default_value">- 3.86</span></em>, <em class="sig-param"><span class="n">freq</span><span class="o">=</span><span class="default_value">1400.0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.scatter_bhat" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate scattering timescale (values default to those from Bhat et al.
(2004, DOI:10.1086/382680) and to simluate the scatter around this
relationship, draw from a Gaussian around this value.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dm</strong> (<em>array</em>) – Dispersion measure [pc*cm^-3]</p></li>
<li><p><strong>offset</strong> (<em>float</em>) – Offset of scattering relationship. Defaults to -6.46</p></li>
<li><p><strong>scindex</strong> (<em>float</em>) – Scattering index. Defaults to -3.86</p></li>
<li><p><strong>freq</strong> (<em>float</em>) – Frequency at which to evaluate scattering time [MHz].
Defaults to 1400 MHz</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Scattering timescale [ms]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="galacticops.separation">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">separation</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ra_1</span></em>, <em class="sig-param"><span class="n">dec_1</span></em>, <em class="sig-param"><span class="n">ra_2</span></em>, <em class="sig-param"><span class="n">dec_2</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.separation" title="Permalink to this definition">¶</a></dt>
<dd><p>Separation between points on sky [degrees].</p>
<p>Using a special case of the Vincenty formula for an ellipsoid with equal
major and minor axes.</p>
<p>See <a class="reference external" href="https://en.wikipedia.org/wiki/Great-circle_distance">https://en.wikipedia.org/wiki/Great-circle_distance</a> for more info.</p>
</dd></dl>

<dl class="py function">
<dt id="galacticops.z_to_d_approx">
<code class="sig-prename descclassname">galacticops.</code><code class="sig-name descname">z_to_d_approx</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">z</span></em>, <em class="sig-param"><span class="n">H_0</span><span class="o">=</span><span class="default_value">67.74</span></em><span class="sig-paren">)</span><a class="headerlink" href="#galacticops.z_to_d_approx" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate distance in Gpc from a redshift.</p>
<p>Only holds for z &lt;= 2. Formulas from ‘An Introduction to Modern
Astrophysics (2nd Edition)’ by Bradley W. Carroll, Dale A. Ostlie.
(Eq. 27.7)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>z</strong> (<em>float</em>) – Redshift</p></li>
<li><p><strong>H_0</strong> (<em>float</em><em>, </em><em>optional</em>) – Hubble parameter. Defaults to 67.74</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Associated distance [Gpc]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>dist (float)</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-gen_dists">
<span id="gen-dists"></span><h2>gen_dists<a class="headerlink" href="#module-gen_dists" title="Permalink to this headline">¶</a></h2>
<p>Define general distributions from which to get random numbers.</p>
<dl class="py function">
<dt id="gen_dists.calc_lognormal_input">
<code class="sig-prename descclassname">gen_dists.</code><code class="sig-name descname">calc_lognormal_input</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean_x</span></em>, <em class="sig-param"><span class="n">std_x</span></em><span class="sig-paren">)</span><a class="headerlink" href="#gen_dists.calc_lognormal_input" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the mean and std of a lognormal distribution.</p>
<p>See
<a class="reference external" href="https://en.wikipedia.org/wiki/Log-normal_distribution">https://en.wikipedia.org/wiki/Log-normal_distribution</a></p>
</dd></dl>

<dl class="py function">
<dt id="gen_dists.log10normal">
<code class="sig-prename descclassname">gen_dists.</code><code class="sig-name descname">log10normal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span></em>, <em class="sig-param"><span class="n">std</span></em>, <em class="sig-param"><span class="n">shape</span></em><span class="sig-paren">)</span><a class="headerlink" href="#gen_dists.log10normal" title="Permalink to this definition">¶</a></dt>
<dd><p>Random values from a normal distribution in the log space.</p>
<p>I could never quite figure out what to expect of a lognormal distribution,
so I implemented a log10normal distribution which looks like a normal
distribution when binned in the log10 space.</p>
</dd></dl>

<dl class="py function">
<dt id="gen_dists.lognormal">
<code class="sig-prename descclassname">gen_dists.</code><code class="sig-name descname">lognormal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span></em>, <em class="sig-param"><span class="n">std</span></em>, <em class="sig-param"><span class="n">shape</span></em><span class="sig-paren">)</span><a class="headerlink" href="#gen_dists.lognormal" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the mean and std from the underlying distribution.</p>
<p>See
<a class="reference external" href="https://en.wikipedia.org/wiki/Log-normal_distribution">https://en.wikipedia.org/wiki/Log-normal_distribution</a></p>
</dd></dl>

<dl class="py function">
<dt id="gen_dists.powerlaw">
<code class="sig-prename descclassname">gen_dists.</code><code class="sig-name descname">powerlaw</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">low</span></em>, <em class="sig-param"><span class="n">high</span></em>, <em class="sig-param"><span class="n">power</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#gen_dists.powerlaw" title="Permalink to this definition">¶</a></dt>
<dd><p>Return random variables distributed according to power law.</p>
<p>The power law distribution power is simply the power, not including a minus
sign (N(x) scales with x^p with p the power). A flat powerlaw can therefore
be created by taking setting power to zero.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>low</strong> (<em>float</em>) – low limit of distribution</p></li>
<li><p><strong>high</strong> (<em>float</em>) – Higher limit of distribution</p></li>
<li><p><strong>power</strong> (<em>float</em>) – Power of power law distribution</p></li>
<li><p><strong>shape</strong> (<em>int/tuple</em>) – Shape of array to be generated. Can also be a int.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Random variable picked from power law distribution</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="gen_dists.trunc_norm">
<code class="sig-prename descclassname">gen_dists.</code><code class="sig-name descname">trunc_norm</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span></em>, <em class="sig-param"><span class="n">std</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">low</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">high</span><span class="o">=</span><span class="default_value">inf</span></em><span class="sig-paren">)</span><a class="headerlink" href="#gen_dists.trunc_norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw from a truncated normal distribution.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mean</strong> (<em>number</em>) – Mean of the normal distribution.</p></li>
<li><p><strong>std</strong> (<em>number</em>) – Standard deviation of the distribution.</p></li>
<li><p><strong>shape</strong> (<em>number</em>) – Number to generate.</p></li>
<li><p><strong>low</strong> (<em>number</em>) – Lower limit.</p></li>
<li><p><strong>high</strong> (<em>number</em>) – Higher limit.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Numpy of required length</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-large_pop">
<span id="large-pop"></span><h2>large_pop<a class="headerlink" href="#module-large_pop" title="Permalink to this headline">¶</a></h2>
<p>Methods to deal with large populations.</p>
<dl class="py class">
<dt id="large_pop.LargePopulation">
<em class="property">class </em><code class="sig-prename descclassname">large_pop.</code><code class="sig-name descname">LargePopulation</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">pop</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">surveys</span></em>, <em class="sig-param"><span class="n">max_size</span><span class="o">=</span><span class="default_value">1000000.0</span></em>, <em class="sig-param"><span class="n">run</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#large_pop.LargePopulation" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Method to deal with a large population.</p>
<p>Basically splits it up, and merges the results.</p>
<p>Set arguments.</p>
<dl class="py method">
<dt id="large_pop.LargePopulation.merge">
<code class="sig-name descname">merge</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#large_pop.LargePopulation.merge" title="Permalink to this definition">¶</a></dt>
<dd><p>Merge populations.</p>
</dd></dl>

<dl class="py method">
<dt id="large_pop.LargePopulation.run">
<code class="sig-name descname">run</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#large_pop.LargePopulation.run" title="Permalink to this definition">¶</a></dt>
<dd><p>Run the generating and surveying of a large population.</p>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt id="large_pop.main">
<code class="sig-prename descclassname">large_pop.</code><code class="sig-name descname">main</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#large_pop.main" title="Permalink to this definition">¶</a></dt>
<dd><p>Compare a standard Survey Population with a Large Survey Population.</p>
</dd></dl>

</div>
<div class="section" id="module-lum_dists">
<span id="lum-dists"></span><h2>lum_dists<a class="headerlink" href="#module-lum_dists" title="Permalink to this headline">¶</a></h2>
<p>Spectral index distributions.</p>
<dl class="py function">
<dt id="lum_dists.constant">
<code class="sig-prename descclassname">lum_dists.</code><code class="sig-name descname">constant</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">value</span><span class="o">=</span><span class="default_value">1e+40</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lum_dists.constant" title="Permalink to this definition">¶</a></dt>
<dd><p>Good for standard candles.</p>
</dd></dl>

<dl class="py function">
<dt id="lum_dists.gauss">
<code class="sig-prename descclassname">lum_dists.</code><code class="sig-name descname">gauss</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span><span class="o">=</span><span class="default_value">1e+35</span></em>, <em class="sig-param"><span class="n">std</span><span class="o">=</span><span class="default_value">100.0</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lum_dists.gauss" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate luminosties from a Gaussian/Normal distribution.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mean</strong> (<em>float</em>) – Mean luminosity [ergs/s]</p></li>
<li><p><strong>std</strong> (<em>float</em>) – Standard deviation [ergs/s]</p></li>
<li><p><strong>shape</strong> (<em>tuple</em>) – Required array shape</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Luminosties</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="lum_dists.log10normal">
<code class="sig-prename descclassname">lum_dists.</code><code class="sig-name descname">log10normal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span><span class="o">=</span><span class="default_value">1e+40</span></em>, <em class="sig-param"><span class="n">std</span><span class="o">=</span><span class="default_value">100.0</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lum_dists.log10normal" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw luminosity from a log10normal distribution.</p>
</dd></dl>

<dl class="py function">
<dt id="lum_dists.powerlaw">
<code class="sig-prename descclassname">lum_dists.</code><code class="sig-name descname">powerlaw</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">low</span><span class="o">=</span><span class="default_value">1e+40</span></em>, <em class="sig-param"><span class="n">high</span><span class="o">=</span><span class="default_value">1e+45</span></em>, <em class="sig-param"><span class="n">power</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lum_dists.powerlaw" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw luminosities from powerlaw distribution.</p>
</dd></dl>

</div>
<div class="section" id="module-misc">
<span id="misc"></span><h2>misc<a class="headerlink" href="#module-misc" title="Permalink to this headline">¶</a></h2>
<p>Convenience functions.</p>
<dl class="py function">
<dt id="misc.hist">
<code class="sig-prename descclassname">misc.</code><code class="sig-name descname">hist</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">parameter</span></em>, <em class="sig-param"><span class="n">bin_type</span><span class="o">=</span><span class="default_value">'lin'</span></em>, <em class="sig-param"><span class="n">n_bins</span><span class="o">=</span><span class="default_value">25</span></em>, <em class="sig-param"><span class="n">norm</span><span class="o">=</span><span class="default_value">'max'</span></em>, <em class="sig-param"><span class="n">edges</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">bins</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#misc.hist" title="Permalink to this definition">¶</a></dt>
<dd><p>Bin up a parameter either in a lin or log space.</p>
<p>Why is this not a standard option in numpy or matplotlib?</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>parameter</strong> (<em>array</em>) – To be binned</p></li>
<li><p><strong>bin_type</strong> (<em>str</em>) – Either ‘lin’, ‘log’ or ‘ln’</p></li>
<li><p><strong>n_bins</strong> (<em>int</em>) – Number of bins. Can be overriden internally</p></li>
<li><p><strong>norm</strong> (<em>bool</em>) – Whether to normalise to ‘max’ or ‘prob’ or none</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>bin centers, values per bin</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="misc.poisson_interval">
<code class="sig-prename descclassname">misc.</code><code class="sig-name descname">poisson_interval</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">k</span></em>, <em class="sig-param"><span class="n">sigma</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#misc.poisson_interval" title="Permalink to this definition">¶</a></dt>
<dd><p>Use chi-squared info to get the poisson interval.</p>
<p>Given a number of observed events, which range of observed events would
have been just as likely given a particular interval?</p>
<p>Based off <a class="reference external" href="https://stackoverflow.com/questions/14813530/">https://stackoverflow.com/questions/14813530/</a>
poisson-confidence-interval-with-numpy</p>
</dd></dl>

<dl class="py function">
<dt id="misc.pprint">
<code class="sig-prename descclassname">misc.</code><code class="sig-name descname">pprint</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">s</span></em>, <em class="sig-param"><span class="n">output</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#misc.pprint" title="Permalink to this definition">¶</a></dt>
<dd><p>Hack to make for more informative print statements.</p>
</dd></dl>

<dl class="py function">
<dt id="misc.progressbar">
<code class="sig-prename descclassname">misc.</code><code class="sig-name descname">progressbar</code><span class="sig-paren">(</span><em class="sig-param">it</em>, <em class="sig-param">prefix=''</em>, <em class="sig-param">size=69</em>, <em class="sig-param">file=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='utf-8'&gt;</em><span class="sig-paren">)</span><a class="headerlink" href="#misc.progressbar" title="Permalink to this definition">¶</a></dt>
<dd><p>Progressbar from adapted from Stack Overflow.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>it</strong> (<em>generator</em>) – range of values</p></li>
<li><p><strong>prefix</strong> (<em>str</em>) – Words displayed before the progress bar</p></li>
<li><p><strong>size</strong> (<em>int</em>) – Display width</p></li>
<li><p><strong>file</strong> – Where to direct output</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Description of returned object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>type</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-number_density">
<span id="number-density"></span><h2>number_density<a class="headerlink" href="#module-number_density" title="Permalink to this headline">¶</a></h2>
<p>Group together various number density descriptors.</p>
<dl class="py class">
<dt id="number_density.NumberDensity">
<em class="property">class </em><code class="sig-prename descclassname">number_density.</code><code class="sig-name descname">NumberDensity</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span><span class="o">=</span><span class="default_value">'vol_co'</span></em>, <em class="sig-param"><span class="n">z_max</span><span class="o">=</span><span class="default_value">2.0</span></em>, <em class="sig-param"><span class="n">H_0</span><span class="o">=</span><span class="default_value">67.74</span></em>, <em class="sig-param"><span class="n">W_m</span><span class="o">=</span><span class="default_value">0.3089</span></em>, <em class="sig-param"><span class="n">W_v</span><span class="o">=</span><span class="default_value">0.6911</span></em>, <em class="sig-param"><span class="n">alpha</span><span class="o">=</span><span class="default_value">- 1.5</span></em><span class="sig-paren">)</span><a class="headerlink" href="#number_density.NumberDensity" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class for cosmic number density.</p>
<p>Draw from particular number density distributions.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>str</em>) – Which number density model to follow.</p></li>
<li><p><strong>z_max</strong> (<em>float</em>) – Maximum redshift.</p></li>
<li><p><strong>H_0</strong> (<em>float</em>) – Hubble constant.</p></li>
<li><p><strong>W_m</strong> (<em>float</em>) – Density parameter Ω_m.</p></li>
<li><p><strong>W_v</strong> (<em>float</em>) – Cosmological constant Ω_Λ.</p></li>
<li><p><strong>alpha</strong> (<em>float</em><em>, </em><em>optional</em>) – Desired log N log S slope for a perfect,
non-cosmological population.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="number_density.NumberDensity.from_sfr">
<code class="sig-name descname">from_sfr</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n_gen</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#number_density.NumberDensity.from_sfr" title="Permalink to this definition">¶</a></dt>
<dd><p>Get sources to follow star forming rate.</p>
<p>Return a random redshift for sources following the Star Formation Rate.</p>
<p>Follows Madau &amp; Dickinson (2014), eq. 15. For more info see
<a class="reference external" href="https://arxiv.org/pdf/1403.0007.pdf">https://arxiv.org/pdf/1403.0007.pdf</a></p>
</dd></dl>

<dl class="py method">
<dt id="number_density.NumberDensity.from_smd">
<code class="sig-name descname">from_smd</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n_gen</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#number_density.NumberDensity.from_smd" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a random redshift for sources following Stellar Mass Density.</p>
<p>Follows Madau &amp; Dickinson (2014), eq. 2 &amp; 15. For more info see
<a class="reference external" href="https://arxiv.org/pdf/1403.0007.pdf">https://arxiv.org/pdf/1403.0007.pdf</a></p>
</dd></dl>

<dl class="py method">
<dt id="number_density.NumberDensity.from_vol_co">
<code class="sig-name descname">from_vol_co</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n_gen</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#number_density.NumberDensity.from_vol_co" title="Permalink to this definition">¶</a></dt>
<dd><p>Use constant number density of sources per comoving volume.</p>
<p>Can be influenced by changing alpha.</p>
</dd></dl>

<dl class="py method">
<dt id="number_density.NumberDensity.sloped_dist">
<code class="sig-name descname">sloped_dist</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n_gen</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#number_density.NumberDensity.sloped_dist" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw from a sloped distribution to create a logNlogS slope.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-paths">
<span id="paths"></span><h2>paths<a class="headerlink" href="#module-paths" title="Permalink to this headline">¶</a></h2>
<p>Set all possible needed paths.</p>
<dl class="py class">
<dt id="paths.Paths">
<em class="property">class </em><code class="sig-prename descclassname">paths.</code><code class="sig-name descname">Paths</code><a class="headerlink" href="#paths.Paths" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>All directory paths.</p>
<p>Initialise.</p>
<dl class="py method">
<dt id="paths.Paths.check">
<code class="sig-name descname">check</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">path</span></em><span class="sig-paren">)</span><a class="headerlink" href="#paths.Paths.check" title="Permalink to this definition">¶</a></dt>
<dd><p>Perform checks on path.</p>
</dd></dl>

<dl class="py method">
<dt id="paths.Paths.data">
<code class="sig-name descname">data</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em><span class="sig-paren">)</span><a class="headerlink" href="#paths.Paths.data" title="Permalink to this definition">¶</a></dt>
<dd><p>Where all results are to be stored.</p>
</dd></dl>

<dl class="py method">
<dt id="paths.Paths.frbcat">
<code class="sig-name descname">frbcat</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em><span class="sig-paren">)</span><a class="headerlink" href="#paths.Paths.frbcat" title="Permalink to this definition">¶</a></dt>
<dd><p>Where all frbcatalogues are to be stored.</p>
</dd></dl>

<dl class="py method">
<dt id="paths.Paths.models">
<code class="sig-name descname">models</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em><span class="sig-paren">)</span><a class="headerlink" href="#paths.Paths.models" title="Permalink to this definition">¶</a></dt>
<dd><p>Where all models are to be stored.</p>
</dd></dl>

<dl class="py method">
<dt id="paths.Paths.populations">
<code class="sig-name descname">populations</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em><span class="sig-paren">)</span><a class="headerlink" href="#paths.Paths.populations" title="Permalink to this definition">¶</a></dt>
<dd><p>Where all populations are to be stored.</p>
</dd></dl>

<dl class="py method">
<dt id="paths.Paths.store">
<code class="sig-name descname">store</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span></em>, <em class="sig-param"><span class="n">default</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">args</span></em><span class="sig-paren">)</span><a class="headerlink" href="#paths.Paths.store" title="Permalink to this definition">¶</a></dt>
<dd><p>Where files are to be stored.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<em>str</em>) – Which group of files, populations, results etc</p></li>
<li><p><strong>default</strong> (<em>str</em>) – Default path for the group</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The path of the group</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>path (str)</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="paths.Paths.surveys">
<code class="sig-name descname">surveys</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em><span class="sig-paren">)</span><a class="headerlink" href="#paths.Paths.surveys" title="Permalink to this definition">¶</a></dt>
<dd><p>Where all surveys are to be stored.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-plot">
<span id="plot"></span><h2>plot<a class="headerlink" href="#module-plot" title="Permalink to this headline">¶</a></h2>
<p>Allow FRB populations to be explored interactively.</p>
<p>Can be run with:</p>
<blockquote>
<div><p>$ bokeh serve –show code/plot.py –args &lt;pop_example.csv&gt;</p>
</div></blockquote>
<p>in which all csv-files with populations can be given after <code class="docutils literal notranslate"><span class="pre">--args</span></code>, and as
well as the optional arguments of <code class="docutils literal notranslate"><span class="pre">-noshow</span></code> and <code class="docutils literal notranslate"><span class="pre">-notns</span></code>, to
respectively not show the resulting plot, and to not overplot tns</p>
<dl class="py class">
<dt id="plot.Plot">
<em class="property">class </em><code class="sig-prename descclassname">plot.</code><code class="sig-name descname">Plot</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">files</span><span class="o">=</span><span class="default_value">[]</span></em>, <em class="sig-param"><span class="n">tns</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#plot.Plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Gather plotting options.</p>
<p>Initializing.</p>
<dl class="py method">
<dt id="plot.Plot.get_data">
<code class="sig-name descname">get_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#plot.Plot.get_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Read in populations.</p>
</dd></dl>

<dl class="py method">
<dt id="plot.Plot.make_histogram">
<code class="sig-name descname">make_histogram</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">kind</span><span class="o">=</span><span class="default_value">'lin'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#plot.Plot.make_histogram" title="Permalink to this definition">¶</a></dt>
<dd><p>Set up a histogram plot.</p>
</dd></dl>

<dl class="py method">
<dt id="plot.Plot.make_scatter">
<code class="sig-name descname">make_scatter</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#plot.Plot.make_scatter" title="Permalink to this definition">¶</a></dt>
<dd><p>Set up a scatter plot.</p>
</dd></dl>

<dl class="py method">
<dt id="plot.Plot.set_colours">
<code class="sig-name descname">set_colours</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#plot.Plot.set_colours" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine which colours need to be used.</p>
</dd></dl>

<dl class="py method">
<dt id="plot.Plot.set_layout">
<code class="sig-name descname">set_layout</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#plot.Plot.set_layout" title="Permalink to this definition">¶</a></dt>
<dd><p>Create the plot layout.</p>
</dd></dl>

<dl class="py method">
<dt id="plot.Plot.set_widgets">
<code class="sig-name descname">set_widgets</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#plot.Plot.set_widgets" title="Permalink to this definition">¶</a></dt>
<dd><p>Set up widget details.</p>
</dd></dl>

<dl class="py method">
<dt id="plot.Plot.update">
<code class="sig-name descname">update</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#plot.Plot.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Update plots when interacted with.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="plot.Tab">
<em class="property">class </em><code class="sig-prename descclassname">plot.</code><code class="sig-name descname">Tab</code><a class="headerlink" href="#plot.Tab" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Gather all elements needed for a plot.</p>
<p>Initializing.</p>
</dd></dl>

</div>
<div class="section" id="module-plot_config">
<span id="plot-config"></span><h2>plot_config<a class="headerlink" href="#module-plot_config" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-pointings">
<span id="pointings"></span><h2>pointings<a class="headerlink" href="#module-pointings" title="Permalink to this headline">¶</a></h2>
<p>Functions to generate pointings.</p>
<dl class="py function">
<dt id="pointings.tracking">
<code class="sig-prename descclassname">pointings.</code><code class="sig-name descname">tracking</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n_gen</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pointings.tracking" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate RA, Dec pointing coordinates for a tracking telescope.</p>
<p>Uses a try-accept algorithm to generate pointings with a survey. For
details on the sunflower algoritm used to distribute pointings see
See <a class="reference external" href="https://stackoverflow.com/a/44164075/11922471">https://stackoverflow.com/a/44164075/11922471</a>. Pointings are not
always optimumly placed in the limit of small numbers. Takes no account
of source surveying time, merely creates a grid on the sky, and follows
that grid.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>n_gen</strong> (<em>int</em>) – Number of pointings.</p></li>
<li><p><strong>**kwargs</strong> (<em>dict</em>) – Keyword arguments of go.in_region</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Numpy arrays with coordinates of pointings</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>ra, dec</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="pointings.transit">
<code class="sig-prename descclassname">pointings.</code><code class="sig-name descname">transit</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n_gen</span></em>, <em class="sig-param"><span class="n">lat</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">lon</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">t_obs</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pointings.transit" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate RA and Dec pointing coordinates for a transit telescope.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>n_gen</strong> (<em>int</em>) – Number of pointings wanted.</p></li>
<li><p><strong>lat</strong> (<em>float</em>) – Latitude of telescope.</p></li>
<li><p><strong>lon</strong> (<em>float</em>) – Longitude of telescope (minus for west).</p></li>
<li><p><strong>t_obs</strong> (<em>type</em>) – Time for each pointing.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Numpy arrays with coordinates of pointings</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>ra, dec</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-population">
<span id="population"></span><h2>population<a class="headerlink" href="#module-population" title="Permalink to this headline">¶</a></h2>
<p>Define a class to hold a population of FRBs.</p>
<dl class="py class">
<dt id="population.Population">
<em class="property">class </em><code class="sig-prename descclassname">population.</code><code class="sig-name descname">Population</code><a class="headerlink" href="#population.Population" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class to hold a population of FRBs.</p>
<p>Initializing.</p>
<dl class="py method">
<dt id="population.Population.n_bursts">
<code class="sig-name descname">n_bursts</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#population.Population.n_bursts" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the number of bursts.</p>
</dd></dl>

<dl class="py method">
<dt id="population.Population.n_one_offs">
<code class="sig-name descname">n_one_offs</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#population.Population.n_one_offs" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the numer of one-offs in a population.</p>
</dd></dl>

<dl class="py method">
<dt id="population.Population.n_oneoffs">
<code class="sig-name descname">n_oneoffs</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#population.Population.n_oneoffs" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the numer of one-offs in a population.</p>
</dd></dl>

<dl class="py method">
<dt id="population.Population.n_rep">
<code class="sig-name descname">n_rep</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#population.Population.n_rep" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="population.Population.n_repeaters">
<code class="sig-name descname">n_repeaters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#population.Population.n_repeaters" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the numer of repeaters in a population.</p>
</dd></dl>

<dl class="py method">
<dt id="population.Population.n_sources">
<code class="sig-name descname">n_sources</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#population.Population.n_sources" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the number of FRB sources.</p>
</dd></dl>

<dl class="py method">
<dt id="population.Population.n_srcs">
<code class="sig-name descname">n_srcs</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#population.Population.n_srcs" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="population.Population.save">
<code class="sig-name descname">save</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">path</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#population.Population.save" title="Permalink to this definition">¶</a></dt>
<dd><p>Write out source properties as data file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>path</strong> (<em>str</em>) – Path to which to save.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="population.Population.to_csv">
<code class="sig-name descname">to_csv</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">path</span></em><span class="sig-paren">)</span><a class="headerlink" href="#population.Population.to_csv" title="Permalink to this definition">¶</a></dt>
<dd><p>Write a population to a csv file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>path</strong> (<em>str</em>) – Path to which to write</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="population.Population.to_df">
<code class="sig-name descname">to_df</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#population.Population.to_df" title="Permalink to this definition">¶</a></dt>
<dd><p>Gather source values into a pandas dataframe.</p>
</dd></dl>

<dl class="py method">
<dt id="population.Population.to_pickle">
<code class="sig-name descname">to_pickle</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">path</span></em><span class="sig-paren">)</span><a class="headerlink" href="#population.Population.to_pickle" title="Permalink to this definition">¶</a></dt>
<dd><p>Write a population to a pickled file for future use.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>path</strong> (<em>str</em>) – Path to which to write</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt id="population.merge_pop">
<code class="sig-prename descclassname">population.</code><code class="sig-name descname">merge_pop</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="n">random</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#population.merge_pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Merge populations.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>to merge</strong> (<em>Populations</em>) – </p></li>
<li><p><strong>random</strong> (<em>bool</em>) – If wishing to shuffle the frbs from different pops</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Population</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="population.split_pop">
<code class="sig-prename descclassname">population.</code><code class="sig-name descname">split_pop</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">pop</span></em>, <em class="sig-param"><span class="n">mask</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#population.split_pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Split a population.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>pop</strong> (<a class="reference internal" href="#population.Population" title="population.Population"><em>Population</em></a>) – Population to be split</p></li>
<li><p><strong>mask</strong> (<em>array</em>) – Numpy boolean mask. If none, split into repeaters and
one_offs in that order</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Tuple of population classes</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="population.unpickle">
<code class="sig-prename descclassname">population.</code><code class="sig-name descname">unpickle</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">filename</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">uid</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#population.unpickle" title="Permalink to this definition">¶</a></dt>
<dd><p>Quick function to unpickle a population.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename</strong> (<em>str</em><em>, </em><em>optional</em>) – Define the path to the pickled population,
or give the population name</p></li>
<li><p><strong>uid</strong> (<em>str</em><em>, </em><em>optional</em>) – Unique Identifier</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Population class</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#population.Population" title="population.Population">Population</a></p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-precalc">
<span id="precalc"></span><h2>precalc<a class="headerlink" href="#module-precalc" title="Permalink to this headline">¶</a></h2>
<p>Create a lookup tables for redshift and the NE2001 dispersion measure.</p>
<dl class="py class">
<dt id="precalc.DistanceTable">
<em class="property">class </em><code class="sig-prename descclassname">precalc.</code><code class="sig-name descname">DistanceTable</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">H_0</span><span class="o">=</span><span class="default_value">67.74</span></em>, <em class="sig-param"><span class="n">W_m</span><span class="o">=</span><span class="default_value">0.3089</span></em>, <em class="sig-param"><span class="n">W_v</span><span class="o">=</span><span class="default_value">0.6911</span></em>, <em class="sig-param"><span class="n">test</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#precalc.DistanceTable" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Create/use a lookup table for comoving distance, volume, redshift etc.</p>
<p>Create a list of tuples to lookup the corresponding redshift for a comoving
distance [Gpc] (or the other way around). Uses formulas from
Hoggs et al. (1999) for the cosmological calculations. To avoid long
calculation times, it will check if a previous run with the same parameters
has been done, which it will then load it. If not, it will calculate a new
table, and save the table for later runs. Covers z, dist, vol, dvol,
cdf_sfr and cdf_smd.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>H_0</strong> (<em>float</em><em>, </em><em>optional</em>) – Hubble parameter. Defaults to 67.74 km/s/Mpc</p></li>
<li><p><strong>W_m</strong> (<em>float</em><em>, </em><em>optional</em>) – Omega matter. Defaults to 0.3089</p></li>
<li><p><strong>W_k</strong> (<em>float</em><em>, </em><em>optional</em>) – Omega vacuum. Defaults to 0.6911</p></li>
</ul>
</dd>
</dl>
<p>Initializing.</p>
<dl class="py method">
<dt id="precalc.DistanceTable.create_table">
<code class="sig-name descname">create_table</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#precalc.DistanceTable.create_table" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a lookup table for distances.</p>
</dd></dl>

<dl class="py method">
<dt id="precalc.DistanceTable.lookup">
<code class="sig-name descname">lookup</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">dist_co</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">vol_co</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">dvol_co</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">cdf_sfr</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">cdf_smd</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#precalc.DistanceTable.lookup" title="Permalink to this definition">¶</a></dt>
<dd><p>Look up associated values with input values.</p>
</dd></dl>

<dl class="py method">
<dt id="precalc.DistanceTable.set_file_name">
<code class="sig-name descname">set_file_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#precalc.DistanceTable.set_file_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine filename.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="precalc.NE2001Table">
<em class="property">class </em><code class="sig-prename descclassname">precalc.</code><code class="sig-name descname">NE2001Table</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">test</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#precalc.NE2001Table" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Create/use a NE2001 lookup table for dispersion measure.</p>
<p>Initializing.</p>
<dl class="py method">
<dt id="precalc.NE2001Table.create_table">
<code class="sig-name descname">create_table</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">parallel</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#precalc.NE2001Table.create_table" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a lookup table for dispersion measure.</p>
</dd></dl>

<dl class="py method">
<dt id="precalc.NE2001Table.lookup">
<code class="sig-name descname">lookup</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">gal</span></em>, <em class="sig-param"><span class="n">gab</span></em><span class="sig-paren">)</span><a class="headerlink" href="#precalc.NE2001Table.lookup" title="Permalink to this definition">¶</a></dt>
<dd><p>Look up associated milky way dispersion measure with gal coords.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>gl</strong> (<em>array</em>) – Galactic longitude [fractional degrees]</p></li>
<li><p><strong>gb</strong> (<em>array</em>) – Galactic latitude [fractional degrees]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Galactic dispersion measure [pc*cm^-3]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>dm_mw (float)</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="precalc.NE2001Table.set_file_name">
<code class="sig-name descname">set_file_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#precalc.NE2001Table.set_file_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine filename.</p>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt id="precalc.sfr">
<code class="sig-prename descclassname">precalc.</code><code class="sig-name descname">sfr</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">z</span></em><span class="sig-paren">)</span><a class="headerlink" href="#precalc.sfr" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the number density of star forming rate at redshift z.</p>
<p>Follows Madau &amp; Dickinson (2014), eq. 15. For more info see
<a class="reference external" href="https://arxiv.org/pdf/1403.0007.pdf">https://arxiv.org/pdf/1403.0007.pdf</a></p>
</dd></dl>

<dl class="py function">
<dt id="precalc.smd">
<code class="sig-prename descclassname">precalc.</code><code class="sig-name descname">smd</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">z</span></em>, <em class="sig-param"><span class="n">H_0</span><span class="o">=</span><span class="default_value">67.74</span></em>, <em class="sig-param"><span class="n">W_m</span><span class="o">=</span><span class="default_value">0.3089</span></em>, <em class="sig-param"><span class="n">W_v</span><span class="o">=</span><span class="default_value">0.6911</span></em><span class="sig-paren">)</span><a class="headerlink" href="#precalc.smd" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the number density of Stellar Mass Density at redshift z.</p>
<p>Follows Madau &amp; Dickinson (2014), eq. 2 &amp; 15. For more info see
<a class="reference external" href="https://arxiv.org/pdf/1403.0007.pdf">https://arxiv.org/pdf/1403.0007.pdf</a></p>
</dd></dl>

</div>
<div class="section" id="module-rates">
<span id="rates"></span><h2>rates<a class="headerlink" href="#module-rates" title="Permalink to this headline">¶</a></h2>
<p>Classes to hold rate counters.</p>
<dl class="py class">
<dt id="rates.Rates">
<em class="property">class </em><code class="sig-prename descclassname">rates.</code><code class="sig-name descname">Rates</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">object_type</span><span class="o">=</span><span class="default_value">'source'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#rates.Rates" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class to hold rate counters.</p>
<p>Initialize.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>object_type</strong> (<em>str</em>) – Type of object of which to keep track.</p>
</dd>
</dl>
<dl class="py method">
<dt id="rates.Rates.exp">
<em class="property">property </em><code class="sig-name descname">exp</code><a class="headerlink" href="#rates.Rates.exp" title="Permalink to this definition">¶</a></dt>
<dd><p>Days before an FRB is detected.</p>
</dd></dl>

<dl class="py method">
<dt id="rates.Rates.scale_by_area">
<code class="sig-name descname">scale_by_area</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#rates.Rates.scale_by_area" title="Permalink to this definition">¶</a></dt>
<dd><p>Scale rates.</p>
</dd></dl>

<dl class="py method">
<dt id="rates.Rates.sum">
<code class="sig-name descname">sum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#rates.Rates.sum" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the total number of rates.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-si_dists">
<span id="si-dists"></span><h2>si_dists<a class="headerlink" href="#module-si_dists" title="Permalink to this headline">¶</a></h2>
<p>Spectral index distributions.</p>
<dl class="py function">
<dt id="si_dists.constant">
<code class="sig-prename descclassname">si_dists.</code><code class="sig-name descname">constant</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">value</span><span class="o">=</span><span class="default_value">- 1.4</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#si_dists.constant" title="Permalink to this definition">¶</a></dt>
<dd><p>Good for adopting a single value.</p>
</dd></dl>

<dl class="py function">
<dt id="si_dists.gauss">
<code class="sig-prename descclassname">si_dists.</code><code class="sig-name descname">gauss</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span><span class="o">=</span><span class="default_value">- 1.4</span></em>, <em class="sig-param"><span class="n">std</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#si_dists.gauss" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate spectral indices from a Gaussian distribution.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mean</strong> (<em>float</em>) – Mean spectral index</p></li>
<li><p><strong>std</strong> (<em>float</em>) – Spread of spectral index</p></li>
<li><p><strong>shape</strong> (<em>tuple</em>) – Required array shape</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>spectral indices</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-survey">
<span id="survey"></span><h2>survey<a class="headerlink" href="#module-survey" title="Permalink to this headline">¶</a></h2>
<p>Class holding survey properties.</p>
<dl class="py class">
<dt id="survey.Survey">
<em class="property">class </em><code class="sig-prename descclassname">survey.</code><code class="sig-name descname">Survey</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span><span class="o">=</span><span class="default_value">'perfect'</span></em>, <em class="sig-param"><span class="n">n_days</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Method containing survey parameters and functions.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<em>str</em>) – Name of survey with which to observe population. Can
either be a predefined survey present in frbpoppy or a path name to
a new survey filename</p></li>
<li><p><strong>n_days</strong> (<em>float</em>) – Time spent surveying [days]</p></li>
</ul>
</dd>
</dl>
<p>Initializing.</p>
<dl class="py method">
<dt id="survey.Survey.calc_T_sky">
<code class="sig-name descname">calc_T_sky</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">gl</span></em>, <em class="sig-param"><span class="n">gb</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.calc_T_sky" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the sky temperature from the Haslam table.</p>
<p>Afterwards scale to the survey frequency. The temperature sky map is
given in the weird units of HealPix and despite looking up info on this
coordinate system, I don’t have the foggiest idea of how to transform
these to galactic coordinates. I have therefore directly copied the
following code from psrpoppy in the assumption Sam Bates managed to
figure it out.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>gl</strong> (<em>array</em>) – Galactic longitude [deg]</p></li>
<li><p><strong>gb</strong> (<em>array</em>) – Galactic latitude [deg]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Sky temperature [K]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.calc_Ts">
<code class="sig-name descname">calc_Ts</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">gl</span></em>, <em class="sig-param"><span class="n">gb</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.calc_Ts" title="Permalink to this definition">¶</a></dt>
<dd><p>Set temperatures for frbs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>gl</strong> (<em>array</em>) – Galactic longitude [deg]</p></li>
<li><p><strong>gb</strong> (<em>array</em>) – Galactic latitude [deg]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>T_sky, T_sys [K]</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.calc_beam">
<code class="sig-name descname">calc_beam</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repeaters</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">ra</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">dec</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">ra_p</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">dec_p</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">lst</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.calc_beam" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate intensity profile.</p>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.calc_dm_smear">
<code class="sig-name descname">calc_dm_smear</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dm</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.calc_dm_smear" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate delay in pulse across a channel due to dm smearing.</p>
<p>Formula’s based on ‘Handbook of Pulsar Astronomy” by Duncan Lorimer
&amp; Michael Kramer, section A2.4. Note the power of the forefactor has
changed due to the central frequency being given in MHz.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>dm</strong> (<em>array</em>) – Dispersion measure [pc/cm^3]</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Time of delay [ms] at central band frequency</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>t_dm (array)</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.calc_fluence">
<code class="sig-name descname">calc_fluence</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">s_peak</span></em>, <em class="sig-param"><span class="n">w_eff</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.calc_fluence" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate fluence [Jy ms].</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>s_peak</strong> (<em>array</em>) – Peak flux</p></li>
<li><p><strong>w_eff</strong> (<em>array</em>) – Effective pulse width</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Fluence in Jy*ms</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.calc_fluence_limit">
<code class="sig-name descname">calc_fluence_limit</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">w_eff</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.calc_fluence_limit" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the fluence limit.</p>
<p>Read Keane, Petroff (2015) for more details on how this is calculated.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>w_eff</strong> – Pulse width at which to calculate the fluence limit [ms].
Default sets this to be at the maximum searched pulse width.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Fluence limit for a maximum pulse width burst [Jy ms]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.calc_s_peak">
<code class="sig-name descname">calc_s_peak</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">si</span></em>, <em class="sig-param"><span class="n">lum_bol</span></em>, <em class="sig-param"><span class="n">z</span></em>, <em class="sig-param"><span class="n">dist_co</span></em>, <em class="sig-param"><span class="n">w_arr</span></em>, <em class="sig-param"><span class="n">w_eff</span></em>, <em class="sig-param"><span class="n">f_low</span><span class="o">=</span><span class="default_value">100000000.0</span></em>, <em class="sig-param"><span class="n">f_high</span><span class="o">=</span><span class="default_value">10000000000.0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.calc_s_peak" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the mean spectral flux density.</p>
<p>Following Lorimer et al, 2013, eq. 9., at the central frequency
of the survey.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>si</strong> (<em>array</em>) – Spectral index</p></li>
<li><p><strong>lum_bol</strong> (<em>array</em>) – Bolometric luminosity within emission band</p></li>
<li><p><strong>z</strong> (<em>array</em>) – Redshift</p></li>
<li><p><strong>dist_co</strong> (<em>array</em>) – Comoving distance [Gpc]</p></li>
<li><p><strong>w_arr</strong> (<em>array</em>) – Pulse width at Earth [ms]</p></li>
<li><p><strong>w_eff</strong> (<em>array</em>) – Pulse width at point of detection [ms]</p></li>
<li><p><strong>f_low</strong> (<em>float</em>) – Source emission lower frequency limit [Hz].</p></li>
<li><p><strong>f_high</strong> (<em>float</em>) – Source emission higher frequency limit [Hz].</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Mean spectral flux density [Jy]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.calc_scat">
<code class="sig-name descname">calc_scat</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dm</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.calc_scat" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate scattering timescale for FRBs.</p>
<p>Offset according to Lorimer et al. (doi:10.1093/mnrasl/slt098)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>dm</strong> (<em>array</em>) – Dispersion Measure</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Scattering timescales [ms]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.calc_scint">
<code class="sig-name descname">calc_scint</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">t_scat</span></em>, <em class="sig-param"><span class="n">dist_co</span></em>, <em class="sig-param"><span class="n">gl</span></em>, <em class="sig-param"><span class="n">gb</span></em>, <em class="sig-param"><span class="n">snr</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.calc_scint" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate scintillation effect on the signal to noise ratio.</p>
<p>(Rather than adapting the flux, as the snr can change per survey
attempt). Formulas based on ‘Handbook of Pulsar Astronomy” by Duncan
Lorimer &amp; Michael Kramer, section 4.2. Test this before applying - no
rigorous testing has been applied to this.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>t_scat</strong> (<em>array</em>) – Scattering timescale for frbs [ms]
(can use self.calc_scat to calculate this)</p></li>
<li><p><strong>dist_co</strong> (<em>array</em>) – Comoving distance array [Gpc]</p></li>
<li><p><strong>gl</strong> (<em>array</em>) – Galactic longitude [deg]</p></li>
<li><p><strong>gb</strong> (<em>array</em>) – Galactic latitude [deg]</p></li>
<li><p><strong>snr</strong> (<em>array</em>) – Signal to Noise array to modify</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Signal to noise ratio modulation factors for scintillation</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.calc_snr">
<code class="sig-name descname">calc_snr</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">s_peak</span></em>, <em class="sig-param"><span class="n">w_arr</span></em>, <em class="sig-param"><span class="n">T_sys</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.calc_snr" title="Permalink to this definition">¶</a></dt>
<dd><p>Caculate the SNR of several frbs.</p>
<p>Radiometer equation for single pulse (Dewey et al., 1984), but
adapted to allow for a degradation factor reducing the peak flux
as a pulse is stretched</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>s_peak</strong> (<em>array</em>) – Peak flux [Jy]</p></li>
<li><p><strong>w_arr</strong> (<em>array</em>) – Pulse width at Earth [ms]</p></li>
<li><p><strong>T_sys</strong> (<em>array</em>) – System temperature [K]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl class="simple">
<dt>Signal to noise ratio based on the radiometer</dt><dd><p>equation for a single pulse.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.calc_w_eff">
<code class="sig-name descname">calc_w_eff</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">w_arr</span></em>, <em class="sig-param"><span class="n">t_dm</span></em>, <em class="sig-param"><span class="n">t_scat</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.calc_w_eff" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate effective pulse width [ms].</p>
<p>From Narayan (1987, DOI: 10.1086/165442), and also Cordes &amp; McLaughlin
(2003, DOI: 10.1086/378231). For details see p. 30 of Emily Petroff’s
thesis (2016), found here: <a class="reference external" href="http://hdl.handle.net/1959.3/417307">http://hdl.handle.net/1959.3/417307</a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>w_arr</strong> (<em>array</em>) – Pulse width [ms]</p></li>
<li><p><strong>t_dm</strong> (<em>array</em>) – Time delay due to dispersion [ms]</p></li>
<li><p><strong>t_scat</strong> (<em>array</em>) – Time delay due to scattering [ms]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Effective pulse width [ms]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.gen_pointings">
<code class="sig-name descname">gen_pointings</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.gen_pointings" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate pointings.</p>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.in_region">
<code class="sig-name descname">in_region</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ra</span></em>, <em class="sig-param"><span class="n">dec</span></em>, <em class="sig-param"><span class="n">gl</span></em>, <em class="sig-param"><span class="n">gb</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.in_region" title="Permalink to this definition">¶</a></dt>
<dd><p>Check if the given frbs are within the survey region.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>dec</strong><strong>, </strong><strong>gl</strong><strong>, </strong><strong>gb</strong> (<em>ra</em><em>,</em>) – Coordinates to check whether in region</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Boolean mask denoting whether frbs are within survey region</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.read_survey_parameters">
<code class="sig-name descname">read_survey_parameters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.read_survey_parameters" title="Permalink to this definition">¶</a></dt>
<dd><p>Read in survey parameters.</p>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.set_beam">
<code class="sig-name descname">set_beam</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span><span class="o">=</span><span class="default_value">'perfect'</span></em>, <em class="sig-param"><span class="n">size</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">random_loc</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">n_sidelobes</span><span class="o">=</span><span class="default_value">0.5</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.set_beam" title="Permalink to this definition">¶</a></dt>
<dd><p>Set intensity profile.</p>
<p>Set properties for int pro</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>str</em>) – Beam pattern. Choice from ‘wsrt-apertif’,
‘parkes-htru’, ‘chime-frb’, ‘gaussian’, ‘airy’.</p></li>
<li><p><strong>size</strong> (<em>float</em>) – Beam size at FWHM [sq. deg].
Defaults to that of the survey file</p></li>
<li><p><strong>random_loc</strong> (<em>bool</em>) – Whether to calculate the precise or random
location of each burst in the beam.</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>if model in (‘gaussian’, ‘airy’):</dt><dd><dl class="simple">
<dt>n_sidelobes (int): Number of sidelobes to include. Defaults to</dt><dd><p>cutting at the FWHM when set to 0.5.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="survey.Survey.set_pointings">
<code class="sig-name descname">set_pointings</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mount_type</span><span class="o">=</span><span class="default_value">'tracking'</span></em>, <em class="sig-param"><span class="n">n_pointings</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">ra</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">dec</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey.Survey.set_pointings" title="Permalink to this definition">¶</a></dt>
<dd><p>Set pointing properties.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-survey_pop">
<span id="survey-pop"></span><h2>survey_pop<a class="headerlink" href="#module-survey_pop" title="Permalink to this headline">¶</a></h2>
<p>Class to generate a survey population of FRBs.</p>
<dl class="py class">
<dt id="survey_pop.SurveyPopulation">
<em class="property">class </em><code class="sig-prename descclassname">survey_pop.</code><code class="sig-name descname">SurveyPopulation</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cosmic_pop</span></em>, <em class="sig-param"><span class="n">survey</span></em>, <em class="sig-param"><span class="n">scat</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">scin</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">mute</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">scale_by_area</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey_pop.SurveyPopulation" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">frbpoppy.population.Population</span></code></p>
<p>Class to create a survey population of FRBs.</p>
<p>Run a survey to detect FRB sources.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cosmic_pop</strong> (<a class="reference internal" href="#population.Population" title="population.Population"><em>Population</em></a>) – Population class of FRB sources to observe</p></li>
<li><p><strong>survey</strong> (<a class="reference internal" href="#survey.Survey" title="survey.Survey"><em>Survey</em></a>) – Survey class with which to observe</p></li>
<li><p><strong>scat</strong> (<em>bool</em><em>, </em><em>optional</em>) – Whether to include scattering in signal to
noise calculations.</p></li>
<li><p><strong>scin</strong> (<em>bool</em><em>, </em><em>optional</em>) – Whether to apply scintillation to
observations.</p></li>
<li><p><strong>mute</strong> (<em>bool</em>) – Whether to suppress printing to terminal</p></li>
<li><p><strong>scale_by_area</strong> (<em>bool</em>) – Whether to scale detection rates to the sky
area visible to a survey. Only relevant for one-offs.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="survey_pop.SurveyPopulation.calc_rates">
<code class="sig-name descname">calc_rates</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">survey</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey_pop.SurveyPopulation.calc_rates" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the relative detection rates.</p>
</dd></dl>

<dl class="py method">
<dt id="survey_pop.SurveyPopulation.det_oneoffs">
<code class="sig-name descname">det_oneoffs</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#survey_pop.SurveyPopulation.det_oneoffs" title="Permalink to this definition">¶</a></dt>
<dd><p>Detect one-off frbs.</p>
</dd></dl>

<dl class="py method">
<dt id="survey_pop.SurveyPopulation.det_repeaters">
<code class="sig-name descname">det_repeaters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#survey_pop.SurveyPopulation.det_repeaters" title="Permalink to this definition">¶</a></dt>
<dd><p>Detect repeating frbs.</p>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt id="survey_pop.fast_where">
<code class="sig-prename descclassname">survey_pop.</code><code class="sig-name descname">fast_where</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">a</span></em>, <em class="sig-param"><span class="n">min_v</span></em>, <em class="sig-param"><span class="n">max_v</span></em><span class="sig-paren">)</span><a class="headerlink" href="#survey_pop.fast_where" title="Permalink to this definition">¶</a></dt>
<dd><p>Faster implementation of np.where(((a &gt;= min_v) &amp; (a &lt;= max_v))).</p>
</dd></dl>

</div>
<div class="section" id="module-time_dists">
<span id="time-dists"></span><h2>time_dists<a class="headerlink" href="#module-time_dists" title="Permalink to this headline">¶</a></h2>
<p>Distributions with which burst times can be generated.</p>
<dl class="py function">
<dt id="time_dists.clustered">
<code class="sig-prename descclassname">time_dists.</code><code class="sig-name descname">clustered</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#time_dists.clustered" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate burst times following a Weibull distribution.</p>
<p>Wrapper to iteratively generate from _weibull_dist</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>from iteratively_gen_times</strong> (<em>Kwargs</em>) – </p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="time_dists.cyclic">
<code class="sig-prename descclassname">time_dists.</code><code class="sig-name descname">cyclic</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">rate</span><span class="o">=</span><span class="default_value">2</span></em>, <em class="sig-param"><span class="n">n_days</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">n_srcs</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">period</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">frac</span><span class="o">=</span><span class="default_value">0.1</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#time_dists.cyclic" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a series of uniform burst times within an activity cycle.”</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>rate</strong> (<em>float/array</em>) – Number of events per day</p></li>
<li><p><strong>n_days</strong> (<em>int</em>) – Number of days</p></li>
<li><p><strong>n_srcs</strong> (<em>int</em>) – Number of sources</p></li>
<li><p><strong>period</strong> (<em>float/array</em>) – Period of activity cycle (days)</p></li>
<li><p><strong>frac</strong> (<em>float/array</em>) – Fraction of activity cycle a source is active</p></li>
<li><p><strong>z</strong> (<em>float/array</em>) – Redshift of sources</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="time_dists.iteratively_gen_times">
<code class="sig-prename descclassname">time_dists.</code><code class="sig-name descname">iteratively_gen_times</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dist</span></em>, <em class="sig-param"><span class="n">n_srcs</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">n_days</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#time_dists.iteratively_gen_times" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate burst times in an iterative manner using a distribution.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dist</strong> (<em>func</em>) – Distribution from which to draw burst times</p></li>
<li><p><strong>n_srcs</strong> (<em>int</em>) – Number of sources</p></li>
<li><p><strong>n_days</strong> (<em>int</em>) – Number of days</p></li>
<li><p><strong>z</strong> (<em>array</em>) – Redshift of sources</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="time_dists.poisson">
<code class="sig-prename descclassname">time_dists.</code><code class="sig-name descname">poisson</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#time_dists.poisson" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a series of poisson times.</p>
<p>Wrapper to iteratively generate from _poisson_dist</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>from iteratively_gen_times</strong> (<em>Kwargs</em>) – </p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="time_dists.regular">
<code class="sig-prename descclassname">time_dists.</code><code class="sig-name descname">regular</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">rate</span><span class="o">=</span><span class="default_value">2</span></em>, <em class="sig-param"><span class="n">n_srcs</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">n_days</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#time_dists.regular" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a series of regular spaced burst times.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>rate</strong> (<em>float</em>) – Number of events per day</p></li>
<li><p><strong>n_srcs</strong> (<em>int</em>) – Number of sources</p></li>
<li><p><strong>n_days</strong> (<em>int</em>) – Number of days</p></li>
<li><p><strong>z</strong> (<em>array</em>) – Redshift of sources</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="time_dists.single">
<code class="sig-prename descclassname">time_dists.</code><code class="sig-name descname">single</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n_srcs</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">n_days</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#time_dists.single" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a series of one-off burst times.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>n_srcs</strong> (<em>int</em>) – Number of sources</p></li>
<li><p><strong>n_days</strong> (<em>int</em>) – Number of days</p></li>
<li><p><strong>z</strong> (<em>array</em>) – Redshift of sources</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-w_dists">
<span id="w-dists"></span><h2>w_dists<a class="headerlink" href="#module-w_dists" title="Permalink to this headline">¶</a></h2>
<p>Pulse width distributions.</p>
<dl class="py function">
<dt id="w_dists.calc_w_arr">
<code class="sig-prename descclassname">w_dists.</code><code class="sig-name descname">calc_w_arr</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">w_int</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#w_dists.calc_w_arr" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the pulse width upon arrival to Earth.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>w_int</strong> (<em>array</em>) – Intrinsic pulse duration</p></li>
<li><p><strong>z</strong> (<em>array</em>) – Redshift of pulses</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Pulse width at arrival to Earth</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="w_dists.constant">
<code class="sig-prename descclassname">w_dists.</code><code class="sig-name descname">constant</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">value</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#w_dists.constant" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate pulse widths at a constant value.</p>
</dd></dl>

<dl class="py function">
<dt id="w_dists.gauss">
<code class="sig-prename descclassname">w_dists.</code><code class="sig-name descname">gauss</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">std</span><span class="o">=</span><span class="default_value">2</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#w_dists.gauss" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate pulse widths from a Gaussian/Normal distribution.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mean</strong> (<em>float</em>) – Mean pulse width [ms]</p></li>
<li><p><strong>std</strong> (<em>float</em>) – Standard deviation of the pulse widths [ms]</p></li>
<li><p><strong>shape</strong> (<em>tuple</em>) – Required array shape</p></li>
<li><p><strong>z</strong> (<em>array</em>) – Redshift of pulses</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>intrinsic pulse widths, pulse widths at Earth</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="w_dists.log10normal">
<code class="sig-prename descclassname">w_dists.</code><code class="sig-name descname">log10normal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span><span class="o">=</span><span class="default_value">0.1</span></em>, <em class="sig-param"><span class="n">std</span><span class="o">=</span><span class="default_value">0.5</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#w_dists.log10normal" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw burst from log10normal distribution.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>shape</strong> (<em>tuple</em>) – Required array shape</p></li>
<li><p><strong>z</strong> (<em>array</em>) – Redshift of pulses</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Description of returned object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>type</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="w_dists.lognormal">
<code class="sig-prename descclassname">w_dists.</code><code class="sig-name descname">lognormal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mean</span><span class="o">=</span><span class="default_value">0.1</span></em>, <em class="sig-param"><span class="n">std</span><span class="o">=</span><span class="default_value">0.5</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#w_dists.lognormal" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw burst from lognormal distribution.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>shape</strong> (<em>tuple</em>) – Required array shape</p></li>
<li><p><strong>z</strong> (<em>array</em>) – Redshift of pulses</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Description of returned object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>type</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="w_dists.uniform">
<code class="sig-prename descclassname">w_dists.</code><code class="sig-name descname">uniform</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">low</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">high</span><span class="o">=</span><span class="default_value">10</span></em>, <em class="sig-param"><span class="n">shape</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">z</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#w_dists.uniform" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate pulse widths from a uniform distribution.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>low</strong> (<em>float</em>) – Minimum pulse width [ms]</p></li>
<li><p><strong>high</strong> (<em>float</em>) – Maximum pulse width [ms]</p></li>
<li><p><strong>shape</strong> (<em>tuple</em>) – Required array shape</p></li>
<li><p><strong>z</strong> (<em>array</em>) – Redshift of pulses</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Description of returned object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>type</p>
</dd>
</dl>
</dd></dl>

</div>
</div>


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



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








<h3><a href="index.html">Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="get_started.html">Get Started</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="documentation.html">Documentation</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
  <li><a href="documentation.html">Documentation</a><ul>
      <li>Previous: <a href="documentation.html" title="previous chapter">Documentation</a></li>
  </ul></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>