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
1ef6d597
Commit
1ef6d597
authored
Dec 22, 2016
by
Gregory Ashton
Browse files
Adds labels to the noise MC plots
parent
35692a4c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Paper/AllSkyMCNoiseOnly/plot_data.py
View file @
1ef6d597
import
pyfstat
import
matplotlib.pyplot
as
plt
import
pandas
as
pd
import
numpy
as
np
...
...
@@ -34,12 +35,17 @@ print 'Number of samples = ', len(df)
fig
,
ax
=
plt
.
subplots
()
ax
.
hist
(
df
.
twoF
,
bins
=
50
,
histtype
=
'step'
,
color
=
'k'
,
normed
=
True
,
linewidth
=
1
,
label
=
'Monte-Carlo histogram'
)
maxtwoFinNoise
=
maxtwoFinNoise_gen
(
a
=
0
)
Ntrials_effective
,
loc
,
scale
=
maxtwoFinNoise
.
fit
(
df
.
twoF
.
values
,
floc
=
0
,
fscale
=
1
)
print
'Ntrials effective = {:1.2e}'
.
format
(
Ntrials_effective
)
twoFsmooth
=
np
.
linspace
(
0
,
df
.
twoF
.
max
(),
1000
)
best_fit_pdf
=
maxtwoFinNoise
.
pdf
(
twoFsmooth
,
Ntrials_effective
)
ax
.
plot
(
twoFsmooth
,
best_fit_pdf
,
'-r'
)
ax
.
plot
(
twoFsmooth
,
best_fit_pdf
,
'-r'
,
label
=
r
'$p(2\mathcal{{F}}_{{\rm max}})$ for {} $N_{{\rm trials}}$'
.
format
(
pyfstat
.
texify_float
(
Ntrials_effective
,
d
=
2
)))
pval
=
1e-6
twoFsmooth_HD
=
np
.
linspace
(
...
...
@@ -48,11 +54,9 @@ best_fit_pdf_HD = maxtwoFinNoise.pdf(twoFsmooth_HD, Ntrials_effective)
spacing
=
twoFsmooth_HD
[
1
]
-
twoFsmooth_HD
[
0
]
print
twoFsmooth_HD
[
np
.
argmin
(
np
.
abs
(
best_fit_pdf_HD
-
pval
))],
spacing
ax
.
hist
(
df
.
twoF
,
bins
=
50
,
histtype
=
'step'
,
color
=
'k'
,
normed
=
True
,
linewidth
=
1
)
twoFsmooth
=
np
.
linspace
(
0
,
df
.
twoF
.
max
(),
100
)
# ax.plot(twoFsmooth, maxtwoFinNoise(twoFsmooth, 8e5), '-r')
ax
.
set_xlabel
(
'$\widetilde{2\mathcal{F}}$'
)
ax
.
set_xlim
(
0
,
60
)
ax
.
legend
(
frameon
=
False
,
fontsize
=
6
,
loc
=
2
)
fig
.
tight_layout
()
fig
.
savefig
(
'allsky_noise_twoF_histogram.png'
)
...
...
Paper/DirectedMCNoiseOnly/plot_data.py
View file @
1ef6d597
import
pyfstat
import
matplotlib.pyplot
as
plt
import
pandas
as
pd
import
numpy
as
np
...
...
@@ -33,14 +34,17 @@ df = pd.concat(df_list)
print
'Number of samples = '
,
len
(
df
)
fig
,
ax
=
plt
.
subplots
()
ax
.
hist
(
df
.
twoF
,
bins
=
50
,
histtype
=
'step'
,
color
=
'k'
,
normed
=
True
,
linewidth
=
1
)
ax
.
hist
(
df
.
twoF
,
bins
=
50
,
histtype
=
'step'
,
color
=
'k'
,
normed
=
True
,
linewidth
=
1
,
label
=
'Monte-Carlo histogram'
)
maxtwoFinNoise
=
maxtwoFinNoise_gen
(
a
=
0
)
Ntrials_effective
,
loc
,
scale
=
maxtwoFinNoise
.
fit
(
df
.
twoF
.
values
,
floc
=
0
,
fscale
=
1
)
print
'Ntrials effective = {:1.2e}'
.
format
(
Ntrials_effective
)
twoFsmooth
=
np
.
linspace
(
0
,
df
.
twoF
.
max
(),
1000
)
best_fit_pdf
=
maxtwoFinNoise
.
pdf
(
twoFsmooth
,
Ntrials_effective
)
ax
.
plot
(
twoFsmooth
,
best_fit_pdf
,
'-r'
)
ax
.
plot
(
twoFsmooth
,
best_fit_pdf
,
'-r'
,
label
=
r
'$p(2\mathcal{{F}}_{{\rm max}})$ for {} $N_{{\rm trials}}$'
.
format
(
pyfstat
.
texify_float
(
Ntrials_effective
,
d
=
2
)))
pval
=
1e-6
twoFsmooth_HD
=
np
.
linspace
(
...
...
@@ -51,6 +55,7 @@ print twoFsmooth_HD[np.argmin(np.abs(best_fit_pdf_HD - pval))], spacing
ax
.
set_xlabel
(
'$\widetilde{2\mathcal{F}}$'
)
ax
.
set_xlim
(
0
,
60
)
ax
.
legend
(
frameon
=
False
,
fontsize
=
6
)
fig
.
tight_layout
()
fig
.
savefig
(
'directed_noise_twoF_histogram.png'
)
...
...
Paper/allsky_noise_twoF_histogram.png
View replaced file @
35692a4c
View file @
1ef6d597
37.9 KB
|
W:
|
H:
46.5 KB
|
W:
|
H:
2-up
Swipe
Onion skin
Paper/directed_noise_twoF_histogram.png
View replaced file @
35692a4c
View file @
1ef6d597
37.5 KB
|
W:
|
H:
45.8 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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