From c6b4c6b8aa61ec81b2e10c84b7f5e87953a1a894 Mon Sep 17 00:00:00 2001
From: Gregory Ashton <gregory.ashton@ligo.org>
Date: Mon, 24 Oct 2016 09:24:04 +0200
Subject: [PATCH] Updates to docsumantion to get all links and images
 displaying

---
 README.md                                     |  6 ++-
 ...tch_search_using_MCMC_on_glitching_data.md |  8 +++-
 ...o_glitches_using_MCMC_on_glitching_data.md | 47 +++++++++++++++++++
 ...i_coherent_twoglitch_search_using_MCMC.py} |  0
 4 files changed, 57 insertions(+), 4 deletions(-)
 rename examples/{semi_coherent_twoglitch_search.py => semi_coherent_twoglitch_search_using_MCMC.py} (100%)

diff --git a/README.md b/README.md
index d33c596..60152e7 100644
--- a/README.md
+++ b/README.md
@@ -12,8 +12,10 @@ output which we list below. Before running any of the search examples, be sure
 to have run the [script to generate fake data](examples/make_fake_data.py).
 
 * [Making fake data with and without glitches](docs/make_fake_data.md)
-* [Fully coherent MCMC search](docs/fully_coherent_search_using_MCMC.md)
-* [Fully coherent MCMC search on data containing glitching signals](docs/fully_coherent_search_using_MCMC_on_glitching_data.md)
+* [Fully-coherent MCMC search](docs/fully_coherent_search_using_MCMC.md)
+* [Fully-coherent MCMC search on data containing a single glitch](docs/fully_coherent_search_using_MCMC_on_glitching_data.md)
+* [Semi-coherent MCMC glitch-search on data containing a single glitch](docs/semi_coherent_glitch_search_using_MCMC_on_glitching_data.md)
+* [Semi-coherent MCMC glitch-search on data containing two glitches](docs/semi_coherent_glitch_search_with_two_glitches_using_MCMC_on_glitching_data.md)
 
 ## Installation
 
diff --git a/docs/semi_coherent_glitch_search_using_MCMC_on_glitching_data.md b/docs/semi_coherent_glitch_search_using_MCMC_on_glitching_data.md
index cb376e8..d0f5025 100644
--- a/docs/semi_coherent_glitch_search_using_MCMC_on_glitching_data.md
+++ b/docs/semi_coherent_glitch_search_using_MCMC_on_glitching_data.md
@@ -55,5 +55,9 @@ mcmc.plot_corner(add_prior=True)
 mcmc.print_summary()
 ```
 
-The posterior for this search demonstrates that we recover the input parameters:
-![](img/semi_coherent_search_using_MCMC_corner.png)
+The output png's for the initialisation and burnin/production steps:
+![](img/semi_coherent_glitch_search_using_MCMC_init_0_walkers.png)
+![](img/semi_coherent_glitch_search_using_MCMC_walkers.png)
+
+and the final posterior estimates:
+![](img/semi_coherent_glitch_search_using_MCMC_corner.png)
diff --git a/docs/semi_coherent_glitch_search_with_two_glitches_using_MCMC_on_glitching_data.md b/docs/semi_coherent_glitch_search_with_two_glitches_using_MCMC_on_glitching_data.md
index 10eca7a..878910d 100644
--- a/docs/semi_coherent_glitch_search_with_two_glitches_using_MCMC_on_glitching_data.md
+++ b/docs/semi_coherent_glitch_search_with_two_glitches_using_MCMC_on_glitching_data.md
@@ -1,4 +1,51 @@
 # Semi-coherent glitch search on data with two-glitches using MCMC
 
+In this example, based on [this
+script](../examples/semi_coherent_twoglitch_search_using_MCMC.py), we show the
+basic setup for a two-glitch search. We begin by defining the prior:
+
+```python
+import pyfstat
+
+F0 = 30.0
+F1 = -1e-10
+F2 = 0
+Alpha = 5e-3
+Delta = 6e-2
+tref = 362750407.0
+
+tstart = 1000000000
+duration = 100*86400
+tend = tstart + duration
+
+theta_prior = {'F0': {'type': 'norm', 'loc': F0, 'scale': abs(1e-6*F0)},
+               'F1': {'type': 'norm', 'loc': F1, 'scale': abs(1e-6*F1)},
+               'F2': F2,
+               'Alpha': Alpha,
+               'Delta': Delta,
+               'delta_F0_0': {'type': 'halfnorm', 'loc': 0,
+                              'scale': 1e-7*F0},
+               'delta_F0_1': {'type': 'halfnorm', 'loc': 0,
+                              'scale': 1e-7*F0},
+               'delta_F1_0': 0,
+               'delta_F1_1': 0,
+               'tglitch_0': {'type': 'unif',
+                             'lower': tstart+0.01*duration,
+                             'upper': tstart+0.5*duration},
+               'tglitch_1': {'type': 'unif',
+                             'lower': tstart+0.5*duration,
+                             'upper': tstart+0.99*duration},
+               }
+
+```
+
+Note that, in this case, we define a prior for each of the two glitches.
+Alternatively, one can provide a prior (with no indexing) which is applied to
+all glitches. The sampler has a prior specification to sort the glitches such
+that `tglitch_0 < tglitch_1 < ...`.
+
+The outputs plots:
+
+![](img/semi_coherent_twoglitch_search_init_0_walkers.png)
 ![](img/semi_coherent_twoglitch_search_walkers.png)
 ![](img/semi_coherent_twoglitch_search_corner.png)
diff --git a/examples/semi_coherent_twoglitch_search.py b/examples/semi_coherent_twoglitch_search_using_MCMC.py
similarity index 100%
rename from examples/semi_coherent_twoglitch_search.py
rename to examples/semi_coherent_twoglitch_search_using_MCMC.py
-- 
GitLab