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
11f162d0
Commit
11f162d0
authored
Feb 27, 2018
by
Gregory Ashton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor polishing of corner plots
parent
78ecb25b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
examples/glitch_examples/semicoherent_glitch_robust_directed_MCMC_search_on_1_glitch.py
...oherent_glitch_robust_directed_MCMC_search_on_1_glitch.py
+5
-2
examples/glitch_examples/semicoherent_glitch_robust_directed_grid_search_on_1_glitch.py
...oherent_glitch_robust_directed_grid_search_on_1_glitch.py
+5
-3
pyfstat/mcmc_based_searches.py
pyfstat/mcmc_based_searches.py
+3
-3
No files found.
examples/glitch_examples/semicoherent_glitch_robust_directed_MCMC_search_on_1_glitch.py
View file @
11f162d0
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
pyfstat
import
gridcorner
from
make_simulated_data
import
tstart
,
duration
,
tref
,
F0
,
F1
,
F2
,
Alpha
,
Delta
,
delta_F0
,
dtglitch
,
outdir
plt
.
style
.
use
(
'paper'
)
plt
.
style
.
use
(
'
./
paper
.mplstyle
'
)
label
=
'semicoherent_glitch_robust_directed_MCMC_search_on_1_glitch'
...
...
@@ -47,5 +48,7 @@ mcmc.transform_dictionary['F1'] = dict(
subtractor
=
F1
,
symbol
=
'$\dot{f}-\dot{f}^\mathrm{s}$'
)
mcmc
.
run
()
mcmc
.
plot_corner
(
label_offset
=
0.15
,
truths
=
[
0
,
0
,
delta_F0
,
50
])
fig_and_axes
=
gridcorner
.
_get_fig_and_axes
(
4
,
2
,
0.05
)
mcmc
.
plot_corner
(
label_offset
=
0.35
,
truths
=
[
0
,
0
,
delta_F0
,
50
],
fig_and_axes
=
fig_and_axes
)
mcmc
.
print_summary
()
examples/glitch_examples/semicoherent_glitch_robust_directed_grid_search_on_1_glitch.py
View file @
11f162d0
...
...
@@ -12,7 +12,7 @@ except ImportError:
label
=
'semicoherent_glitch_robust_directed_grid_search_on_1_glitch'
plt
.
style
.
use
(
'paper'
)
plt
.
style
.
use
(
'
./
paper
.mplstyle
'
)
Nstar
=
1000
F0_width
=
np
.
sqrt
(
Nstar
)
*
np
.
sqrt
(
12
)
/
(
np
.
pi
*
duration
)
...
...
@@ -29,6 +29,8 @@ tglitchs = [tstart+0.1*duration, tstart+0.9*duration, 0.8*float(duration)/N]
delta_F0s
=
[
0
,
max_delta_F0
,
max_delta_F0
/
N
]
delta_F1s
=
[
0
]
print
'Prior widths='
,
F0_width
,
F1_width
search
=
pyfstat
.
GridGlitchSearch
(
label
,
outdir
,
'data/*1_glitch*sft'
,
F0s
=
F0s
,
F1s
=
F1s
,
F2s
=
F2s
,
Alphas
=
Alphas
,
Deltas
=
Deltas
,
tref
=
tref
,
minStartTime
=
tstart
,
...
...
@@ -48,7 +50,7 @@ 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}}$'
]
fig
,
axes
=
gridcorner
(
twoF
,
xyz
,
projection
=
'log_mean'
,
whspace
=
0.1
,
factor
=
1.2
,
labels
=
labels
,
showDvals
=
False
,
lines
=
[
0
,
0
,
delta_F0
,
50
])
twoF
,
xyz
,
projection
=
'log_mean'
,
labels
=
labels
,
showDvals
=
False
,
lines
=
[
0
,
0
,
delta_F0
,
50
]
,
label_offset
=
0.35
)
fig
.
savefig
(
'{}/{}_projection_matrix.png'
.
format
(
outdir
,
label
),
bbox_inches
=
'tight'
)
pyfstat/mcmc_based_searches.py
View file @
11f162d0
...
...
@@ -743,7 +743,7 @@ class MCMCSearch(core.BaseSearchClass):
max_n_ticks
=
4
,
plot_contours
=
True
,
plot_datapoints
=
True
,
label_kwargs
=
{
'fontsize'
:
12
},
#
label_kwargs={'fontsize': 12},
data_kwargs
=
{
'alpha'
:
0.1
,
'ms'
:
0.5
},
range
=
_range
,
...
...
@@ -762,10 +762,10 @@ class MCMCSearch(core.BaseSearchClass):
ax
.
set_rasterization_zorder
(
-
10
)
for
tick
in
ax
.
xaxis
.
get_major_ticks
():
tick
.
label
.
set_fontsize
(
8
)
#
tick.label.set_fontsize(8)
tick
.
label
.
set_rotation
(
'horizontal'
)
for
tick
in
ax
.
yaxis
.
get_major_ticks
():
tick
.
label
.
set_fontsize
(
8
)
#
tick.label.set_fontsize(8)
tick
.
label
.
set_rotation
(
'vertical'
)
plt
.
tight_layout
(
h_pad
=
0.0
,
w_pad
=
0.0
)
...
...
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