Note
Click here to download the full example code
Short transient search examples: Make dataΒΆ
An example to generate data with a short transient signal.
This can be run either stand-alone (will just generate SFT files and nothing else); or it is also being imported from PyFstat_example_short_transient_grid_search.py and PyFstat_example_short_transient_MCMC_search.py
14 import os
15
16 import pyfstat
17
18 label = "PyFstatExampleShortTransientSearch"
19 outdir = os.path.join("PyFstat_example_data", label)
20 logger = pyfstat.set_up_logger(outdir=outdir, label=label)
21
22
23 F0 = 30.0
24 F1 = -1e-10
25 F2 = 0
26 Alpha = 0.5
27 Delta = 1
28
29 tstart = 1000000000
30 duration = 2 * 86400
31
32 transient_tstart = tstart + 0.25 * duration
33 transient_duration = 0.5 * duration
34 transientWindowType = "rect"
35 tref = tstart
36
37 h0 = 1e-23
38 cosi = 0
39 psi = 0
40 phi = 0
41 sqrtSX = 1e-22
42 detectors = "H1,L1"
43
44 Tsft = 1800
45
46 if __name__ == "__main__":
47 transient = pyfstat.Writer(
48 label=label,
49 outdir=outdir,
50 tref=tref,
51 tstart=tstart,
52 duration=duration,
53 F0=F0,
54 F1=F1,
55 F2=F2,
56 Alpha=Alpha,
57 Delta=Delta,
58 h0=h0,
59 cosi=cosi,
60 detectors=detectors,
61 sqrtSX=sqrtSX,
62 transientStartTime=transient_tstart,
63 transientTau=transient_duration,
64 transientWindowType=transientWindowType,
65 Tsft=Tsft,
66 Band=0.1,
67 )
68 transient.make_data()
69 logger.info(f"Predicted 2F from injection Writer: {transient.predict_fstat()}")
Total running time of the script: ( 0 minutes 0.000 seconds)