Skip to content

Commit

Permalink
update documentation and structure
Browse files Browse the repository at this point in the history
  • Loading branch information
vdumont86 committed Mar 22, 2017
1 parent 4813960 commit 1a6a6d6
Show file tree
Hide file tree
Showing 108 changed files with 7,496 additions and 2,915 deletions.
Binary file removed dist/gdas-0.2.9.tar.gz
Binary file not shown.
4 changes: 1 addition & 3 deletions docs/_modules/gdas/epower.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ <h1>Source code for gdas.epower</h1><div class="highlight"><pre>
<span class="c1">#print strain.insert_strain_option_group.__dict__</span>
<span class="c1">#print psd.insert_psd_option_group.__dict__</span>
<span class="n">sample_rate</span> <span class="o">=</span> <span class="n">ts_data</span><span class="o">.</span><span class="n">sample_rate</span>
<span class="nb">print</span> <span class="n">sample_rate</span>
<span class="n">quit</span><span class="p">()</span>
<span class="n">nchans</span><span class="p">,</span><span class="n">band</span><span class="p">,</span><span class="n">flow</span> <span class="o">=</span> <span class="n">check_filtering_settings</span><span class="p">(</span><span class="n">sample_rate</span><span class="p">,</span><span class="n">nchans</span><span class="p">,</span><span class="n">band</span><span class="p">,</span><span class="n">fmin</span><span class="p">,</span><span class="n">fmax</span><span class="p">)</span>
<span class="n">seg_len</span><span class="p">,</span><span class="n">fd_psd</span><span class="p">,</span><span class="n">lal_psd</span> <span class="o">=</span> <span class="n">calculate_psd</span><span class="p">(</span><span class="n">ts_data</span><span class="p">,</span><span class="n">sample_rate</span><span class="p">,</span><span class="n">psd_segment_length</span><span class="p">,</span><span class="n">psd_segment_stride</span><span class="p">,</span><span class="n">psd_estimation</span><span class="p">)</span>
<span class="n">window</span><span class="p">,</span> <span class="n">spec_corr</span> <span class="o">=</span> <span class="n">calculate_spectral_correlation</span><span class="p">(</span><span class="n">seg_len</span><span class="p">,</span><span class="s1">&#39;tukey&#39;</span><span class="p">,</span><span class="n">window_fraction</span><span class="o">=</span><span class="n">window_fraction</span><span class="p">)</span>
Expand Down Expand Up @@ -460,7 +458,7 @@ <h1>Source code for gdas.epower</h1><div class="highlight"><pre>
<span class="n">s_j_nb_avg</span> <span class="o">=</span> <span class="n">uw_ss_ii</span><span class="o">.</span><span class="n">sum</span><span class="p">()</span> <span class="o">/</span> <span class="mi">2</span> <span class="o">+</span> <span class="n">uw_ss_ij</span><span class="o">.</span><span class="n">sum</span><span class="p">()</span>
<span class="n">s_j_nb_avg</span> <span class="o">*=</span> <span class="n">delta_f</span>
<span class="n">s_j_nb_denom</span> <span class="o">=</span> <span class="n">s_j_b_avg</span><span class="o">.</span><span class="n">sum</span><span class="p">()</span> <span class="o">+</span> <span class="mi">2</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">/</span> <span class="n">filter_len</span> <span class="o">*</span> \
<span class="n">numpy</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">numpy</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">s_j_b_avg</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">*</span> <span class="n">s_j_b_avg</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span> <span class="o">*</span> <span class="n">w_ss_ij</span><span class="p">)</span>
<span class="n">numpy</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">numpy</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">s_j_b_avg</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">*</span> <span class="n">s_j_b_avg</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span> <span class="o">*</span> <span class="n">w_ss_ij</span><span class="p">)</span>
<span class="c1"># eqn. 62</span>
<span class="n">uw_ups_ratio</span> <span class="o">=</span> <span class="n">s_j_nb_avg</span> <span class="o">/</span> <span class="n">s_j_nb_denom</span>
<span class="c1"># eqn. 63 -- approximation of unwhitened signal energy time series</span>
Expand Down
49 changes: 48 additions & 1 deletion docs/_modules/gdas/plots.html

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions docs/_modules/gdas/retrieve.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ <h2 class="heading"><span>gdas.retrieve</span></h2>
<h1>Source code for gdas.retrieve</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot; Retrieving magnetic field data.&quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">os</span><span class="o">,</span><span class="nn">glob</span><span class="o">,</span><span class="nn">h5py</span><span class="o">,</span><span class="nn">astropy</span><span class="o">,</span><span class="nn">numpy</span><span class="o">,</span><span class="nn">astropy</span>
<span class="kn">import</span> <span class="nn">os</span><span class="o">,</span><span class="nn">glob</span><span class="o">,</span><span class="nn">h5py</span><span class="o">,</span><span class="nn">astropy</span><span class="o">,</span><span class="nn">numpy</span><span class="o">,</span><span class="nn">astropy</span><span class="o">,</span><span class="nn">scipy</span>
<span class="kn">from</span> <span class="nn">astropy.time</span> <span class="k">import</span> <span class="n">Time</span>
<span class="kn">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">datetime</span><span class="p">,</span><span class="n">timedelta</span>
<span class="kn">from</span> <span class="nn">glue.segments</span> <span class="k">import</span> <span class="n">segment</span><span class="p">,</span><span class="n">segmentlist</span>
<span class="kn">from</span> <span class="nn">gwpy.segments</span> <span class="k">import</span> <span class="n">DataQualityDict</span><span class="p">,</span><span class="n">DataQualityFlag</span>
<span class="kn">from</span> <span class="nn">gwpy.timeseries</span> <span class="k">import</span> <span class="n">TimeSeries</span><span class="p">,</span><span class="n">TimeSeriesList</span>
<span class="kn">from</span> <span class="nn">pycbc</span> <span class="k">import</span> <span class="n">types</span>

<div class="viewcode-block" id="magfield"><a class="viewcode-back" href="../../generated/gdas.retrieve.magfield.html#gdas.retrieve.magfield">[docs]</a><span class="k">def</span> <span class="nf">magfield</span><span class="p">(</span><span class="n">station</span><span class="p">,</span><span class="n">starttime</span><span class="p">,</span><span class="n">endtime</span><span class="p">,</span><span class="n">activity</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span><span class="n">rep</span><span class="o">=</span><span class="s1">&#39;/GNOMEDrive/gnome/serverdata/&#39;</span><span class="p">):</span>
<div class="viewcode-block" id="magfield"><a class="viewcode-back" href="../../generated/gdas.retrieve.magfield.html#gdas.retrieve.magfield">[docs]</a><span class="k">def</span> <span class="nf">magfield</span><span class="p">(</span><span class="n">station</span><span class="p">,</span><span class="n">starttime</span><span class="p">,</span><span class="n">endtime</span><span class="p">,</span><span class="n">activity</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span><span class="n">rep</span><span class="o">=</span><span class="s1">&#39;/GNOMEDrive/gnome/serverdata/&#39;</span><span class="p">,</span><span class="n">resample</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Glob all files withing user-defined period and extract data.</span>
<span class="sd"> </span>
Expand Down Expand Up @@ -107,8 +107,11 @@ <h1>Source code for gdas.retrieve</h1><div class="highlight"><pre>
<span class="n">ts_list</span> <span class="o">=</span> <span class="n">generate_timeseries</span><span class="p">(</span><span class="n">file_order</span><span class="p">,</span><span class="n">setname</span><span class="p">)</span>
<span class="c1"># Retrieve channel data for all the segments</span>
<span class="n">full_data</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">hstack</span><span class="p">([</span><span class="n">retrieve_channel_data</span><span class="p">(</span><span class="n">data_order</span><span class="p">[</span><span class="n">seg</span><span class="p">],</span><span class="n">setname</span><span class="p">)</span> <span class="k">for</span> <span class="n">seg</span> <span class="ow">in</span> <span class="n">seglist</span><span class="p">])</span>
<span class="n">new_sample_rate</span> <span class="o">=</span> <span class="n">sample_rate</span> <span class="k">if</span> <span class="n">resample</span><span class="o">==</span><span class="kc">None</span> <span class="k">else</span> <span class="n">resample</span>
<span class="n">new_data_length</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">full_data</span><span class="p">)</span><span class="o">/</span><span class="nb">float</span><span class="p">(</span><span class="n">sample_rate</span><span class="p">)</span><span class="o">*</span><span class="n">new_sample_rate</span>
<span class="n">full_data</span> <span class="o">=</span> <span class="n">scipy</span><span class="o">.</span><span class="n">signal</span><span class="o">.</span><span class="n">resample</span><span class="p">(</span><span class="n">full_data</span><span class="p">,</span><span class="nb">int</span><span class="p">(</span><span class="n">new_data_length</span><span class="p">))</span>
<span class="c1"># Models a time series consisting of uniformly sampled scalar values</span>
<span class="n">ts_data</span> <span class="o">=</span> <span class="n">types</span><span class="o">.</span><span class="n">TimeSeries</span><span class="p">(</span><span class="n">full_data</span><span class="p">,</span><span class="n">delta_t</span><span class="o">=</span><span class="mi">1</span><span class="o">/</span><span class="n">sample_rate</span><span class="p">,</span><span class="n">epoch</span><span class="o">=</span><span class="n">seglist</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span>
<span class="n">ts_data</span> <span class="o">=</span> <span class="n">types</span><span class="o">.</span><span class="n">TimeSeries</span><span class="p">(</span><span class="n">full_data</span><span class="p">,</span><span class="n">delta_t</span><span class="o">=</span><span class="mf">1.</span><span class="o">/</span><span class="n">new_sample_rate</span><span class="p">,</span><span class="n">epoch</span><span class="o">=</span><span class="n">seglist</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span>
<span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">data_order</span><span class="o">.</span><span class="n">values</span><span class="p">():</span>
<span class="n">v</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="k">return</span> <span class="n">ts_data</span><span class="p">,</span><span class="n">ts_list</span><span class="p">,</span><span class="n">activity</span></div>
Expand Down Expand Up @@ -226,7 +229,6 @@ <h1>Source code for gdas.retrieve</h1><div class="highlight"><pre>
<span class="n">sample_rate</span> <span class="o">=</span> <span class="n">dset</span><span class="o">.</span><span class="n">attrs</span><span class="p">[</span><span class="s2">&quot;SamplingRate(Hz)&quot;</span><span class="p">]</span>
<span class="n">gps_epoch</span> <span class="o">=</span> <span class="n">construct_utc_from_metadata</span><span class="p">(</span><span class="n">dset</span><span class="o">.</span><span class="n">attrs</span><span class="p">[</span><span class="s2">&quot;Date&quot;</span><span class="p">],</span> <span class="n">dset</span><span class="o">.</span><span class="n">attrs</span><span class="p">[</span><span class="s2">&quot;t0&quot;</span><span class="p">])</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">retrieve_channel_data</span><span class="p">(</span><span class="n">hfile</span><span class="p">,</span> <span class="n">setname</span><span class="p">)</span>
<span class="nb">print</span> <span class="n">sample_rate</span><span class="p">,</span><span class="n">gps_epoch</span><span class="p">,</span><span class="n">dset</span><span class="o">.</span><span class="n">attrs</span><span class="p">[</span><span class="s2">&quot;Date&quot;</span><span class="p">],</span><span class="n">dset</span><span class="o">.</span><span class="n">attrs</span><span class="p">[</span><span class="s2">&quot;t0&quot;</span><span class="p">],</span><span class="n">dset</span><span class="o">.</span><span class="n">attrs</span><span class="p">[</span><span class="s2">&quot;t1&quot;</span><span class="p">]</span>
<span class="n">ts_data</span> <span class="o">=</span> <span class="n">TimeSeries</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">sample_rate</span><span class="o">=</span><span class="n">sample_rate</span><span class="p">,</span> <span class="n">epoch</span><span class="o">=</span><span class="n">gps_epoch</span><span class="p">)</span>
<span class="k">return</span> <span class="n">ts_data</span></div>

Expand Down
16 changes: 13 additions & 3 deletions index.rst → docs/_sources/backup.rst.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
GNOME Data Analysis Software
============================

* :ref:`test2`

.. _test2:

.. toctree::
:maxdepth: 2
:caption: People & By-laws

test

.. toctree::
:maxdepth: 2

Expand Down Expand Up @@ -466,7 +476,7 @@ We present below a step-by-step procedure followed during the Excess Power searc

- :ref:`Exploring tiles with different duration <tileduration>`

For each given tile's bandwidth, one can investigate different tile's duration. This can be done by exploring different number of degrees of freedom, :math:`d$, which can be calculated as follows: :math:`d=2BT` where :math:`B` and :math:`T` are respectively the bandwidth and duration of the tile. Section 2.2.5 of `Brady et al. <http://www.lsc-group.phys.uwm.edu/~siemens/power.pdf>`_ gives a great description of how to interpret the number of degrees of freedom. Therefore, by changing the :math:`d$, one can explore multiple tile's duration for different bandwidth.
For each given tile's bandwidth, one can investigate different tile's duration. This can be done by exploring different number of degrees of freedom, :math:`d`, which can be calculated as follows: :math:`d=2BT` where :math:`B` and :math:`T` are respectively the bandwidth and duration of the tile. Section 2.2.5 of `Brady et al. <http://www.lsc-group.phys.uwm.edu/~siemens/power.pdf>`_ gives a great description of how to interpret the number of degrees of freedom. Therefore, by changing the :math:`d`, one can explore multiple tile's duration for different bandwidth.

- :ref:`Define triggering signal <triggerfinding>`

Expand Down Expand Up @@ -516,7 +526,7 @@ One can display the power measurements, frequency array and frequency between co
print 'Display the frequency separation between bins'
print fd_psd.delta_f

$\Delta f` corresponds to the inverse of a segment's length which is the smallest frequency (i.e. highest period) of detectable signals in each segment. The frequency range spans from 0 to the Nyquist frequency, i.e. half de the sampling rate.
:math:`\Delta f` corresponds to the inverse of a segment's length which is the smallest frequency (i.e. highest period) of detectable signals in each segment. The frequency range spans from 0 to the Nyquist frequency, i.e. half de the sampling rate.

Checking filtering settings
---------------------------
Expand Down Expand Up @@ -777,7 +787,7 @@ The undersampling rate for this tile can be calculated using the channel frequen
Explore multiple tile durations
-------------------------------

Now that we create a tile with a specific bandwidth, we can start exploring different durations for the tile. We will start checking if the user manually defined a value for the longest duration tile to compute, which can be done using the =--max-duration= argument. If not, the value will be set to 32. ::
Now that we create a tile with a specific bandwidth, we can start exploring different durations for the tile. We will start checking if the user manually defined a value for the longest duration tile to compute, which can be done using the ``--max-duration`` argument. If not, the value will be set to 32. ::

if args.max_duration is not None:
max_dof = 2 * args.max_duration * (band * (nc_sum+1))
Expand Down
Loading

0 comments on commit 1a6a6d6

Please sign in to comment.