From f0b06a900ac0062126281ac953381ef4a9716b06 Mon Sep 17 00:00:00 2001
From: Gregory Ashton <gregory.ashton@ligo.org>
Date: Mon, 3 Oct 2016 16:13:07 +0200
Subject: [PATCH] Updates all examples and existing docs to lates user
 interface

---
 docs/fully_coherent_search.md                       |  6 +++---
 docs/fully_coherent_search_on_glitching_data.md     |  7 +++----
 examples/fully_coherent_search.py                   |  4 ++--
 examples/fully_coherent_search_on_glitching_data.py | 10 +++++-----
 examples/semi_coherent_glitch_search.py             |  2 +-
 examples/semi_coherent_twoglitch_search.py          |  4 ++--
 6 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/docs/fully_coherent_search.md b/docs/fully_coherent_search.md
index 6f274d6..461649b 100644
--- a/docs/fully_coherent_search.md
+++ b/docs/fully_coherent_search.md
@@ -66,11 +66,11 @@ simply called `nsteps = [500, 1000]`). Finally, the simulation run for `500`
 steps of burn-in then `1000` steps of production to estimate the posterior.
 
 Passing all this to the MCMC search, we also need to give it a label and
-directory to save the data and provide `sftlabel` and `sftdir` which defines
-which data to use in the search
+directory to save the data and provide `sftfilepath`, a string matching
+the data to use in the search
 
 ```
-mcmc = MCMCSearch('fully_coherent', 'data', sftlabel='basic', sftdir='data',
+mcmc = MCMCSearch('fully_coherent', 'data', sftfilepath='data/*basic*sft',
                   theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend,
                   nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
                   scatter_val=1e-10)
diff --git a/docs/fully_coherent_search_on_glitching_data.md b/docs/fully_coherent_search_on_glitching_data.md
index 8e5ca97..4332aeb 100644
--- a/docs/fully_coherent_search_on_glitching_data.md
+++ b/docs/fully_coherent_search_on_glitching_data.md
@@ -47,11 +47,10 @@ nwalkers = 500
 nsteps = [100, 100, 100]
 
 mcmc = MCMCSearch('fully_coherent_on_glitching_data', 'data',
-                  sftlabel='glitch', sftdir='data',
+                  sftfilepath='data/*_glitch*.sft',
                   theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend,
-                  nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps, betas=betas,
-                  scatter_val=1e-6)
-
+                  nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
+                  log10temperature_min=log10temperature_min, scatter_val=1e-6)
 mcmc.run()
 mcmc.plot_corner(add_prior=True)
 ```
diff --git a/examples/fully_coherent_search.py b/examples/fully_coherent_search.py
index 8e6b422..9b11b66 100644
--- a/examples/fully_coherent_search.py
+++ b/examples/fully_coherent_search.py
@@ -9,7 +9,7 @@ tref = 362750407.0
 
 tstart = 1000000000
 duration = 100*86400
-tend = tstart = duration
+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)},
@@ -22,7 +22,7 @@ ntemps = 1
 nwalkers = 100
 nsteps = [100, 500, 1000]
 
-mcmc = MCMCSearch('fully_coherent', 'data', sftlabel='basic', sftdir='data',
+mcmc = MCMCSearch('fully_coherent', 'data', sftfilepath='data/*basic*sft',
                   theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend,
                   nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
                   scatter_val=1e-10)
diff --git a/examples/fully_coherent_search_on_glitching_data.py b/examples/fully_coherent_search_on_glitching_data.py
index 2ea029b..fbb8b34 100644
--- a/examples/fully_coherent_search_on_glitching_data.py
+++ b/examples/fully_coherent_search_on_glitching_data.py
@@ -10,7 +10,7 @@ tref = 362750407.0
 
 tstart = 1000000000
 duration = 100*86400
-tend = tstart = duration
+tend = tstart + duration
 
 theta_prior = {'F0': {'type': 'unif', 'lower': F0-5e-5,
                       'upper': F0+5e-5},
@@ -21,15 +21,15 @@ theta_prior = {'F0': {'type': 'unif', 'lower': F0-5e-5,
                }
 
 ntemps = 10
-betas = np.logspace(0, -30, ntemps)
+log10temperature_min = -30
 nwalkers = 500
 nsteps = [100, 100, 100]
 
 mcmc = MCMCSearch('fully_coherent_on_glitching_data', 'data',
-                  sftlabel='glitch', sftdir='data',
+                  sftfilepath='data/*_glitch*.sft',
                   theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend,
-                  nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps, betas=betas,
-                  scatter_val=1e-6)
+                  nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps,
+                  log10temperature_min=log10temperature_min, scatter_val=1e-6)
 mcmc.run()
 mcmc.plot_corner(add_prior=True)
 mcmc.print_summary()
diff --git a/examples/semi_coherent_glitch_search.py b/examples/semi_coherent_glitch_search.py
index b4dc3b7..435ea6b 100644
--- a/examples/semi_coherent_glitch_search.py
+++ b/examples/semi_coherent_glitch_search.py
@@ -28,7 +28,7 @@ nwalkers = 500
 nsteps = [1000, 1000, 1000]
 
 mcmc = pyfstat.MCMCGlitchSearch(
-    'semi_coherent_glitch_search', 'data', sftlabel='glitch', sftdir='data',
+    'semi_coherent_glitch_search', 'data', sftfilepath='data/*_glitch*sft',
     theta_prior=theta_prior, tref=tref, tstart=tstart, tend=tend,
     nsteps=nsteps, nwalkers=nwalkers, scatter_val=1e-10, nglitch=1)
 
diff --git a/examples/semi_coherent_twoglitch_search.py b/examples/semi_coherent_twoglitch_search.py
index 0c44cb1..6b0b77a 100644
--- a/examples/semi_coherent_twoglitch_search.py
+++ b/examples/semi_coherent_twoglitch_search.py
@@ -28,8 +28,8 @@ nwalkers = 100
 nsteps = [500, 500, 500]
 
 mcmc = pyfstat.MCMCGlitchSearch(
-    'semi_coherent_twoglitch_search', 'data', sftlabel='twoglitch',
-    sftdir='data', theta_prior=theta_prior, tref=tref, tstart=tstart,
+    'semi_coherent_twoglitch_search', 'data', sftfilepath='data/*twoglitch*sft',
+    theta_prior=theta_prior, tref=tref, tstart=tstart,
     tend=tend, nsteps=nsteps, nwalkers=nwalkers, scatter_val=1e-10, nglitch=2)
 
 mcmc.run()
-- 
GitLab