Skip to content

Commit f4c5b4f

Browse files
committed
add fill_between(::InterpolatedCls), misc
1 parent 475b34c commit f4c5b4f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/chains.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Get the mean and standard deviation of a set of correlated `samples` from a
167167
chain where the error on the mean and standard deviation is estimated with
168168
bootstrap resampling using the calculated "effective sample size" of the chain.
169169
"""
170-
function mean_std_and_errors(samples; N_bootstrap=10000)
170+
function mean_std_and_errors(samples; N_bootstrap=10000, N_in_paren=2)
171171

172172
Neff = round(Int, length(samples) / @ondemand(PyCall.pyimport)(:emcee).autocorr.integrated_time(samples)[1])
173173

@@ -177,7 +177,7 @@ function mean_std_and_errors(samples; N_bootstrap=10000)
177177
SEμ = std([mean(samples[rand(1:end, Neff)]) for i=1:N_bootstrap])
178178
SEσ = std([ std(samples[rand(1:end, Neff)]) for i=1:N_bootstrap])
179179

180-
"$(paren_errors(μ, SEμ)) ± $(paren_errors(σ, SEσ))"
180+
"$(paren_errors(μ, SEμ; N_in_paren=N_in_paren)) ± $(paren_errors(σ, SEσ; N_in_paren=N_in_paren))"
181181

182182
end
183183

src/plotting.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
using .PyPlot
33
using .PyPlot.PyCall
4-
import .PyPlot: loglog, plot, semilogx, semilogy, figure
4+
import .PyPlot: loglog, plot, semilogx, semilogy, figure, fill_between
55

66

77
### plotting Cℓs
@@ -17,6 +17,14 @@ for plot in (:plot, :loglog, :semilogx, :semilogy)
1717
end
1818
end
1919

20+
function fill_between(ic::InterpolatedCℓs{<:Measurement}, args...; kwargs...)
21+
fill_between(
22+
ic.ℓ,
23+
((@. Measurements.value(ic.Cℓ) - x * Measurements.uncertainty(ic.Cℓ)) for x in (-1,1))...,
24+
args...; kwargs...
25+
)
26+
end
27+
2028

2129
### plotting FlatFields
2230

0 commit comments

Comments
 (0)