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 »
  • Short transient MCMC search
  • Edit on GitHub

Note

Click here to download the full example code

Short transient MCMC searchΒΆ

MCMC search for a Short transient CW signal.

 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
81
82
83
84
85
 import pyfstat
 import os
 import numpy as np
 import PyFstat_example_make_data_for_short_transient_search as data

 if __name__ == "__main__":

     if not os.path.isdir(data.outdir) or not np.any(
         [f.endswith(".sft") for f in os.listdir(data.outdir)]
     ):
         raise RuntimeError(
             "Please first run PyFstat_example_make_data_for_short_transient_search.py !"
         )

     inj = {
         "tref": data.tstart,
         "F0": data.F0,
         "F1": data.F1,
         "F2": data.F2,
         "Alpha": data.Alpha,
         "Delta": data.Delta,
         "transient_tstart": data.transient_tstart,
         "transient_duration": data.transient_duration,
     }

     DeltaF0 = 1e-2
     DeltaF1 = 1e-9

     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": {
             "type": "unif",
             "lower": data.tstart,
             "upper": data.tstart + data.duration - 2 * data.Tsft,
         },
         "transient_duration": {
             "type": "unif",
             "lower": 2 * data.Tsft,
             "upper": data.duration - 2 * data.Tsft,
         },
     }

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

 BSGL = False

 mcmc = pyfstat.MCMCTransientSearch(
     label="transient_search" + ("_BSGL" if BSGL else ""),
     outdir=data.outdir,
     sftfilepattern=os.path.join(data.outdir, "*simulated_transient_signal*sft"),
     theta_prior=theta_prior,
     tref=inj["tref"],
     nsteps=nsteps,
     nwalkers=nwalkers,
     ntemps=ntemps,
     log10beta_min=log10beta_min,
     transientWindowType="rect",
     BSGL=BSGL,
 )
 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_short_transient_MCMC_search.py

Download Jupyter notebook: PyFstat_example_short_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