PyFstat
v1.11.5

Contents:

  • PyFstat
  • PyFstat module documentation
  • Examples
    • Grid searches for isolated CW
    • MCMC searches for isolated CW signals
    • Comparison between MCMC and Grid searches
    • Multi-stage MCMC follow up
    • Binary-modulated CW searches
    • Glitch robust CW searches
    • Transient CW searches
      • Long transient search examples: Make data
      • Short transient search examples: Make data
      • Long transient MCMC search
      • Short transient grid search
      • Short transient MCMC search
    • Other examples
PyFstat
  • »
  • Examples »
  • Transient CW searches »
  • Long transient MCMC search
  • Edit on GitHub

Note

Click here to download the full example code

Long transient MCMC searchΒΆ

MCMC search for a long transient CW signal.

 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
 import pyfstat
 import os
 import numpy as np

 outdir = os.path.join("PyFstat_example_data", "PyFstat_example_long_transient_search")
 if not os.path.isdir(outdir) or not np.any(
     [f.endswith(".sft") for f in os.listdir(outdir)]
 ):
     raise RuntimeError(
         "Please first run PyFstat_example_make_data_for_long_transient_search.py !"
     )

 tstart = 1000000000
 duration = 200 * 86400

 inj = {
     "tref": tstart,
     "F0": 30.0,
     "F1": -1e-10,
     "F2": 0,
     "Alpha": 0.5,
     "Delta": 1,
     "transient_tstart": tstart + 0.25 * duration,
     "transient_duration": 0.5 * duration,
 }

 DeltaF0 = 6e-7
 DeltaF1 = 1e-13

 # to make the search cheaper, we exactly target the transientStartTime
 # to the injected value and only search over TransientTau
 theta_prior = {
     "F0": {
         "type": "unif",
         "lower": inj["F0"] - DeltaF0 / 2.0,
         "upper": inj["F0"] + DeltaF0 / 2.0,
     },
     "F1": {
         "type": "unif",
         "lower": inj["F1"] - DeltaF1 / 2.0,
         "upper": inj["F1"] + DeltaF1 / 2.0,
     },
     "F2": inj["F2"],
     "Alpha": inj["Alpha"],
     "Delta": inj["Delta"],
     "transient_tstart": tstart + 0.25 * duration,
     "transient_duration": {
         "type": "halfnorm",
         "loc": 0.001 * duration,
         "scale": 0.5 * duration,
     },
 }

 ntemps = 2
 log10beta_min = -1
 nwalkers = 100
 nsteps = [100, 100]

 mcmc = pyfstat.MCMCTransientSearch(
     label="transient_search",
     outdir=outdir,
     sftfilepattern=os.path.join(outdir, "*simulated_transient_signal*sft"),
     theta_prior=theta_prior,
     tref=inj["tref"],
     nsteps=nsteps,
     nwalkers=nwalkers,
     ntemps=ntemps,
     log10beta_min=log10beta_min,
     transientWindowType="rect",
 )
 mcmc.run(walker_plot_args={"plot_det_stat": True, "injection_parameters": inj})
 mcmc.print_summary()
 mcmc.plot_corner(add_prior=True, truths=inj)
 mcmc.plot_prior_posterior(injection_parameters=inj)

Total running time of the script: ( 0 minutes 0.000 seconds)

Download Python source code: PyFstat_example_long_transient_MCMC_search.py

Download Jupyter notebook: PyFstat_example_long_transient_MCMC_search.ipynb

Gallery generated by Sphinx-Gallery

Next Previous

© Copyright 2020, Gregory Ashton, David Keitel, Reinhard Prix, Rodrigo Tenorio. Revision 0dbba7e8.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: v1.11.5
Versions
latest
stable
v1.11.5
v1.11.4
v1.11.3
v1.11.2
v1.11.1
v1.11.0
v1.10.1
v1.10.0
Downloads
On Read the Docs
Project Home
Builds