short_transient_search_gridded.py 1.45 KB
Newer Older
1
2
3
#!/usr/bin/env python

import pyfstat
4
import os
5
6
7
import numpy as np
import matplotlib.pyplot as plt

8
9
datadir = 'data_s'

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
F0 = 30.0
F1 = -1e-10
F2 = 0
Alpha = 0.5
Delta = 1

minStartTime = 1000000000
maxStartTime = minStartTime + 2*86400
Tspan = maxStartTime - minStartTime
tref = minStartTime

Tsft = 1800

m = 0.001
dF0 = np.sqrt(12*m)/(np.pi*Tspan)
DeltaF0 = 100*dF0
F0s = [F0-DeltaF0/2., F0+DeltaF0/2., dF0]
F1s = [F1]
F2s = [F2]
Alphas = [Alpha]
Deltas = [Delta]

32
print('Standard CW search:')
33
search1 = pyfstat.GridSearch(
34
35
    label='CW', outdir=datadir,
    sftfilepattern=os.path.join(datadir,'*simulated_transient_signal*sft'),
36
37
    F0s=F0s, F1s=F1s, F2s=F2s, Alphas=Alphas, Deltas=Deltas, tref=tref,
    minStartTime=minStartTime, maxStartTime=maxStartTime,
38
    BSGL=False)
39
40
search1.run()
search1.print_max_twoF()
41

42
search1.plot_1D(xkey='F0',
43
44
               xlabel='freq [Hz]', ylabel='$2\mathcal{F}$')

45
print('with t0,tau bands:')
46
search2 = pyfstat.TransientGridSearch(
47
48
49
50
51
    label='tCW', outdir=datadir,
    sftfilepattern=os.path.join(datadir,'*simulated_transient_signal*sft'),
    F0s=F0s, F1s=F1s, F2s=F2s, Alphas=Alphas, Deltas=Deltas, tref=tref,
    minStartTime=minStartTime, maxStartTime=maxStartTime,
    transientWindowType='rect', t0Band=Tspan-2*Tsft, tauBand=Tspan,
52
    BSGL=False,
53
54
    outputTransientFstatMap=True,
    tCWFstatMapVersion='lal')
55
56
57
58
59
search2.run()
search2.print_max_twoF()

search2.plot_1D(xkey='F0',
               xlabel='freq [Hz]', ylabel='$2\mathcal{F}$')