Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gregory Ashton
PyFstat
Commits
8b83144b
Commit
8b83144b
authored
Dec 12, 2017
by
David Keitel
Browse files
fixup example: short_transient_search_gridded.py
parent
da7cbddd
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/transient_examples/short_transient_search_gridded.py
View file @
8b83144b
#!/usr/bin/env python
import
pyfstat
import
os
import
numpy
as
np
import
matplotlib.pyplot
as
plt
datadir
=
'data_s'
F0
=
30.0
F1
=
-
1e-10
F2
=
0
...
...
@@ -26,17 +29,29 @@ F2s = [F2]
Alphas
=
[
Alpha
]
Deltas
=
[
Delta
]
search
=
pyfstat
.
GridSearch
(
label
=
'grid_search'
,
outdir
=
'data_s'
,
sftfilepattern
=
'data_s/*simulated_transient_signal*sft'
,
print
(
'Standard CW search:'
)
search1
=
pyfstat
.
GridSearch
(
label
=
'CW'
,
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,
BSGL
=
False
)
search
.
run
()
search
.
print_max_twoF
()
search
1
.
run
()
search
1
.
print_max_twoF
()
search
.
plot_1D
(
xkey
=
'F0'
,
search
1
.
plot_1D
(
xkey
=
'F0'
,
xlabel
=
'freq [Hz]'
,
ylabel
=
'$2\mathcal{F}$'
)
search
.
plot_2D
(
xkey
=
'F0'
,
ykey
=
'F1'
)
print
(
'with t0,tau bands:'
)
search2
=
pyfstat
.
GridSearch
(
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
,
BSGL
=
False
)
search2
.
run
()
search2
.
print_max_twoF
()
search2
.
plot_1D
(
xkey
=
'F0'
,
xlabel
=
'freq [Hz]'
,
ylabel
=
'$2\mathcal{F}$'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment