Single Detector Simulations ============================ Lets look at the different ways we can generate single detector time series using GlitchPop. Deterministic Generation w/ Only Glitches -------------- To generate a fully deterministic time series (can be regenerated running the same commands), we can do the following. Note, we can choose the type, the random seed and the location of each generated glitch. .. code-block:: python import GlitchPop as gp import GlitchPop.simulate import matplotlib.pyplot as plt #Generating a time series based off of L1 during O3b ts = gp.simulate.determ_glitch('L1', 'O3b', ['blip', 'tomte', 'lfb', 'koi'], [14e8+3, 14e8+4, 14e8+5, 14e8+6], [1,2,3,4], duration = 25, gps = 14e8) #Plotting full time series plot = ts.plot() #Whitening and zooming in on blip tsw = ts.whiten() tsw.plot() plt.xlim(14e8+3-1/16, 14e8+3+1/16) plt.ylim(-5,15) .. image:: images/col_strain.png :alt: Coloured time series w/ 4 embedded glitches :width: 500px :height: 300px :align: center .. image:: images/blip_wstrain.png :alt: Description of the image :width: 500px :height: 300px :align: center Random Generation w/ Glitches and GWs -------------- To generate a random time series (cannot be regenerated running the same commands), we can do the following. Although usually not explicitly seen in the coloured strain, this time series will contain both gravitational wave signal(s) and glitches. .. code-block:: python import GlitchPop as gp import GlitchPop.simulate #Generating a time series based off of H1 during O3a ts = gp.simulate.random_gw('H1', 'O3a', gps = 12e8, duration = 500, mu_glitch = 0.05, mu_gw = 0.005, probs_gw = [1,0,0], probs_glitch = [1,0,0,0]) #Plotting full time series plot = ts.plot() .. image:: images/rand_gw.png :alt: Description of the image :width: 500px :height: 300px :align: center Notice here, we set the probabilities of the GWs and glitches so that only BHBH signals and blips were generated. The 'mu' arguments are the Poissonian rate or glitches/GWs expected per second. For this example, we expect 25 blips and 2.5 BHBH signals.