Glitch examples: Make dataΒΆ

Generate the data to run examples on glitch-robust searches.

  8 import os
  9
 10 import numpy as np
 11
 12 from pyfstat import GlitchWriter, Writer
 13
 14 label = "PyFstatExampleGlitchRobustSearch"
 15 outdir = os.path.join("PyFstat_example_data", label)
 16
 17 # First, we generate data with a reasonably strong smooth signal
 18
 19 # Define parameters of the Crab pulsar as an example
 20 F0 = 30.0
 21 F1 = -1e-10
 22 F2 = 0
 23 Alpha = np.radians(83.6292)
 24 Delta = np.radians(22.0144)
 25
 26 # Signal strength
 27 h0 = 5e-24
 28 cosi = 0
 29
 30 # Properties of the GW data
 31 sqrtSX = 1e-22
 32 tstart = 1000000000
 33 duration = 50 * 86400
 34 tend = tstart + duration
 35 tref = tstart + 0.5 * duration
 36 IFO = "H1"
 37
 38 data = Writer(
 39     label=label + "0glitch",
 40     outdir=outdir,
 41     tref=tref,
 42     tstart=tstart,
 43     F0=F0,
 44     F1=F1,
 45     F2=F2,
 46     duration=duration,
 47     Alpha=Alpha,
 48     Delta=Delta,
 49     h0=h0,
 50     cosi=cosi,
 51     sqrtSX=sqrtSX,
 52     detectors=IFO,
 53 )
 54 data.make_data()
 55
 56 # Next, taking the same signal parameters, we include a glitch half way through
 57 dtglitch = duration / 2.0
 58 delta_F0 = 5e-6
 59 delta_F1 = 0
 60
 61 glitch_data = GlitchWriter(
 62     label=label + "1glitch",
 63     outdir=outdir,
 64     tref=tref,
 65     tstart=tstart,
 66     F0=F0,
 67     F1=F1,
 68     F2=F2,
 69     duration=duration,
 70     Alpha=Alpha,
 71     Delta=Delta,
 72     h0=h0,
 73     cosi=cosi,
 74     sqrtSX=sqrtSX,
 75     detectors=IFO,
 76     dtglitch=dtglitch,
 77     delta_F0=delta_F0,
 78     delta_F1=delta_F1,
 79 )
 80 glitch_data.make_data()
 81
 82 # Making data with two glitches
 83
 84 dtglitch_2 = [duration / 4.0, 4 * duration / 5.0]
 85 delta_phi_2 = [0, 0]
 86 delta_F0_2 = [4e-6, 3e-7]
 87 delta_F1_2 = [0, 0]
 88 delta_F2_2 = [0, 0]
 89
 90 two_glitch_data = GlitchWriter(
 91     label=label + "2glitch",
 92     outdir=outdir,
 93     tref=tref,
 94     tstart=tstart,
 95     F0=F0,
 96     F1=F1,
 97     F2=F2,
 98     duration=duration,
 99     Alpha=Alpha,
100     Delta=Delta,
101     h0=h0,
102     cosi=cosi,
103     sqrtSX=sqrtSX,
104     detectors=IFO,
105     dtglitch=dtglitch_2,
106     delta_phi=delta_phi_2,
107     delta_F0=delta_F0_2,
108     delta_F1=delta_F1_2,
109     delta_F2=delta_F2_2,
110 )
111 two_glitch_data.make_data()

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

Gallery generated by Sphinx-Gallery