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
37041071
Commit
37041071
authored
Apr 15, 2018
by
Gregory Ashton
Browse files
Fix up glitch examples for the paper
parent
a2e40720
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/glitch_examples/semicoherent_glitch_robust_directed_MCMC_search_on_1_glitch.py
View file @
37041071
...
...
@@ -43,15 +43,23 @@ mcmc = pyfstat.MCMCGlitchSearch(
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
log10beta_min
=
log10beta_min
,
nglitch
=
1
)
mcmc
.
transform_dictionary
[
'F0'
]
=
dict
(
subtractor
=
F0
,
symbol
=
'$f-f^\mathrm{s}$'
)
subtractor
=
F0
,
multiplier
=
1e6
,
symbol
=
'$f-f_\mathrm{s}$'
)
mcmc
.
unit_dictionary
[
'F0'
]
=
'$\mu$Hz'
mcmc
.
transform_dictionary
[
'F1'
]
=
dict
(
subtractor
=
F1
,
symbol
=
'$\dot{f}-\dot{f}^\mathrm{s}$'
)
subtractor
=
F1
,
multiplier
=
1e12
,
symbol
=
'$\dot{f}-\dot{f}_\mathrm{s}$'
)
mcmc
.
unit_dictionary
[
'F1'
]
=
'$p$Hz/s'
mcmc
.
transform_dictionary
[
'delta_F0'
]
=
dict
(
multiplier
=
1e6
,
subtractor
=
delta_F0
,
symbol
=
'$\delta f-\delta f_\mathrm{s}$'
)
mcmc
.
unit_dictionary
[
'delta_F0'
]
=
'$\mu$Hz/s'
mcmc
.
transform_dictionary
[
'tglitch'
][
'subtractor'
]
=
tstart
+
dtglitch
mcmc
.
transform_dictionary
[
'tglitch'
][
'label'
]
=
'$t^\mathrm{g}-t^\mathrm{g}_\mathrm{s}$
\n
[d]'
t1
=
time
.
time
()
mcmc
.
run
()
dT
=
time
.
time
()
-
t1
fig_and_axes
=
gridcorner
.
_get_fig_and_axes
(
4
,
2
,
0.05
)
mcmc
.
plot_corner
(
label_offset
=
0.
3
5
,
truths
=
[
0
,
0
,
delta_F
0
,
5
0
],
mcmc
.
plot_corner
(
label_offset
=
0.
2
5
,
truths
=
[
0
,
0
,
0
,
0
],
fig_and_axes
=
fig_and_axes
)
mcmc
.
print_summary
()
...
...
examples/glitch_examples/semicoherent_glitch_robust_directed_grid_search_on_1_glitch.py
View file @
37041071
...
...
@@ -42,18 +42,22 @@ dT = time.time() - t1
F0_vals
=
np
.
unique
(
search
.
data
[:,
0
])
-
F0
F1_vals
=
np
.
unique
(
search
.
data
[:,
1
])
-
F1
delta_F0s_vals
=
np
.
unique
(
search
.
data
[:,
5
])
delta_F0s_vals
=
np
.
unique
(
search
.
data
[:,
5
])
-
delta_F0
tglitch_vals
=
np
.
unique
(
search
.
data
[:,
7
])
tglitch_vals_days
=
(
tglitch_vals
-
tstart
)
/
86400.
tglitch_vals_days
=
(
tglitch_vals
-
tstart
)
/
86400.
-
dtglitch
/
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^\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}}$'
]
xyz
=
[
F0_vals
*
1e6
,
F1_vals
*
1e12
,
delta_F0s_vals
*
1e6
,
tglitch_vals_days
]
labels
=
[
'$f - f_\mathrm{s}$
\n
[$\mu$Hz]'
,
'$\dot{f} - \dot{f}_\mathrm{s}$
\n
[$p$Hz/s]'
,
'$\delta f-\delta f_\mathrm{s}$
\n
[$\mu$Hz]'
,
'$t^\mathrm{g} - t^\mathrm{g}_\mathrm{s}$
\n
[d]'
,
'$\widehat{2\mathcal{F}}$'
]
fig
,
axes
=
gridcorner
(
twoF
,
xyz
,
projection
=
'log_mean'
,
labels
=
labels
,
showDvals
=
False
,
lines
=
[
0
,
0
,
delta_F0
,
dtglitch
/
86400.
],
label_offset
=
0.35
)
showDvals
=
False
,
lines
=
[
0
,
0
,
0
,
0
],
label_offset
=
0.25
,
max_n_ticks
=
4
)
fig
.
savefig
(
'{}/{}_projection_matrix.png'
.
format
(
outdir
,
label
),
bbox_inches
=
'tight'
)
...
...
Write
Preview
Supports
Markdown
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