Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Keitel
PyFstat
Commits
78ecb25b
Commit
78ecb25b
authored
Feb 22, 2018
by
Gregory Ashton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor updates to examples
parent
90dad473
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
14 deletions
+15
-14
examples/glitch_examples/make_simulated_data.py
examples/glitch_examples/make_simulated_data.py
+7
-7
examples/glitch_examples/semicoherent_glitch_robust_directed_MCMC_search_on_1_glitch.py
...oherent_glitch_robust_directed_MCMC_search_on_1_glitch.py
+4
-4
examples/glitch_examples/semicoherent_glitch_robust_directed_grid_search_on_1_glitch.py
...oherent_glitch_robust_directed_grid_search_on_1_glitch.py
+4
-3
No files found.
examples/glitch_examples/make_simulated_data.py
View file @
78ecb25b
...
...
@@ -43,15 +43,15 @@ glitch_data.make_data()
# Making data with two glitches
dtglitch
=
[
duration
/
4.0
,
4
*
duration
/
5.0
]
delta_phi
=
[
0
,
0
]
delta_F0
=
[
4e-6
,
3e-7
]
delta_F1
=
[
0
,
0
]
delta_F2
=
[
0
,
0
]
dtglitch
_2
=
[
duration
/
4.0
,
4
*
duration
/
5.0
]
delta_phi
_2
=
[
0
,
0
]
delta_F0
_2
=
[
4e-6
,
3e-7
]
delta_F1
_2
=
[
0
,
0
]
delta_F2
_2
=
[
0
,
0
]
two_glitch_data
=
GlitchWriter
(
label
=
'2_glitch'
,
outdir
=
outdir
,
tref
=
tref
,
tstart
=
tstart
,
F0
=
F0
,
F1
=
F1
,
F2
=
F2
,
duration
=
duration
,
Alpha
=
Alpha
,
Delta
=
Delta
,
h0
=
h0
,
sqrtSX
=
sqrtSX
,
dtglitch
=
dtglitch
,
delta_phi
=
delta_phi
,
delta_F0
=
delta_F0
,
delta_F1
=
delta_F1
,
delta_F2
=
delta_F2
)
dtglitch
=
dtglitch
_2
,
delta_phi
=
delta_phi
_2
,
delta_F0
=
delta_F0
_2
,
delta_F1
=
delta_F1
_2
,
delta_F2
=
delta_F2
_2
)
two_glitch_data
.
make_data
()
examples/glitch_examples/semicoherent_glitch_robust_directed_MCMC_search_on_1_glitch.py
View file @
78ecb25b
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
pyfstat
from
make_simulated_data
import
tstart
,
duration
,
tref
,
F0
,
F1
,
F2
,
Alpha
,
Delta
,
outdir
from
make_simulated_data
import
tstart
,
duration
,
tref
,
F0
,
F1
,
F2
,
Alpha
,
Delta
,
delta_F0
,
dtglitch
,
outdir
plt
.
style
.
use
(
'paper'
)
...
...
@@ -33,19 +33,19 @@ theta_prior = {
ntemps
=
3
log10beta_min
=
-
0.5
nwalkers
=
100
nsteps
=
[
500
,
5
00
]
nsteps
=
[
500
,
10
00
]
mcmc
=
pyfstat
.
MCMCGlitchSearch
(
label
=
label
,
sftfilepattern
=
'data/*1_glitch*sft'
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
tstart
,
maxStartTime
=
tstart
+
duration
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10beta_min
=
log10beta_min
,
nglitch
=
1
)
print
delta_F0
mcmc
.
transform_dictionary
[
'F0'
]
=
dict
(
subtractor
=
F0
,
symbol
=
'$f-f^\mathrm{s}$'
)
mcmc
.
transform_dictionary
[
'F1'
]
=
dict
(
subtractor
=
F1
,
symbol
=
'$\dot{f}-\dot{f}^\mathrm{s}$'
)
mcmc
.
run
()
mcmc
.
plot_corner
(
label_offset
=
0.15
)
mcmc
.
plot_corner
(
label_offset
=
0.15
,
truths
=
[
0
,
0
,
delta_F0
,
50
]
)
mcmc
.
print_summary
()
examples/glitch_examples/semicoherent_glitch_robust_directed_grid_search_on_1_glitch.py
View file @
78ecb25b
import
pyfstat
import
numpy
as
np
import
matplotlib.pyplot
as
plt
from
make_simulated_data
import
tstart
,
duration
,
tref
,
F0
,
F1
,
F2
,
Alpha
,
Delta
,
outdir
from
make_simulated_data
import
tstart
,
duration
,
tref
,
F0
,
F1
,
F2
,
Alpha
,
Delta
,
delta_F0
,
outdir
try
:
from
gridcorner
import
gridcorner
...
...
@@ -45,9 +45,10 @@ tglitch_vals_days = (tglitch_vals-tstart) / 86400.
twoF
=
search
.
data
[:,
-
1
].
reshape
((
len
(
F0_vals
),
len
(
F1_vals
),
len
(
delta_F0s_vals
),
len
(
tglitch_vals
)))
xyz
=
[
F0_vals
,
F1_vals
,
delta_F0s_vals
,
tglitch_vals_days
]
labels
=
[
'$f - f
_0
$
\n
[Hz]'
,
'$\dot{f} - \dot{f}
_0
$
\n
[Hz/s]'
,
labels
=
[
'$f - f
^\mathrm{s}
$
\n
[Hz]'
,
'$\dot{f} - \dot{f}
^\mathrm{s}
$
\n
[Hz/s]'
,
'$\delta f$
\n
[Hz]'
,
'$t^g_0$
\n
[days]'
,
'$\widehat{2\mathcal{F}}$'
]
fig
,
axes
=
gridcorner
(
twoF
,
xyz
,
projection
=
'log_mean'
,
whspace
=
0.1
,
factor
=
1.2
,
labels
=
labels
)
twoF
,
xyz
,
projection
=
'log_mean'
,
whspace
=
0.1
,
factor
=
1.2
,
labels
=
labels
,
showDvals
=
False
,
lines
=
[
0
,
0
,
delta_F0
,
50
])
fig
.
savefig
(
'{}/{}_projection_matrix.png'
.
format
(
outdir
,
label
),
bbox_inches
=
'tight'
)
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