Commit 712711a2 authored by Javier's avatar Javier

bug in wpm

broadcasting dictionaries is not allowed
parent 46040edf
...@@ -126,7 +126,7 @@ function energies(evals::Union{Vector{Vector{uwreal}},Array{Array{uwreal}} }; wp ...@@ -126,7 +126,7 @@ function energies(evals::Union{Vector{Vector{uwreal}},Array{Array{uwreal}} }; wp
ratio = evals[t][i] / evals[t+1][i] ratio = evals[t][i] / evals[t+1][i]
aux_en[t] = 0.5*log(ratio * ratio) aux_en[t] = 0.5*log(ratio * ratio)
end end
isnothing(wpm) ? uwerr.(aux_en) : uwerr.(aux_en, wpm) isnothing(wpm) ? uwerr.(aux_en) : [uwerr(a, wpm) for a in aux_en]
eff_en[i] = copy(aux_en) eff_en[i] = copy(aux_en)
end end
return eff_en return eff_en
......
...@@ -347,7 +347,7 @@ function dec_const_pcvc(corr::Vector{uwreal}, plat::Vector{Int64}, m::uwreal, mu ...@@ -347,7 +347,7 @@ function dec_const_pcvc(corr::Vector{uwreal}, plat::Vector{Int64}, m::uwreal, mu
else else
uwerr(f, wpm) uwerr(f, wpm)
uwerr(R_av, wpm) uwerr(R_av, wpm)
uwerr.(R, wpm) [uwerr(Raux, wpm) for Raux in R]
end end
v = value(R_av) v = value(R_av)
...@@ -464,7 +464,7 @@ function comp_t0(Y::YData, plat::Vector{Int64}; L::Int64, pl::Bool=false, ...@@ -464,7 +464,7 @@ function comp_t0(Y::YData, plat::Vector{Int64}; L::Int64, pl::Bool=false,
uwerr.(t2E) uwerr.(t2E)
else else
uwerr(t0, wpm) uwerr(t0, wpm)
uwerr.(t2E, wpm) [uwerr(t2E_aux, wpm) for t2E_aux in t2E]
end end
v = value.(t2E) v = value.(t2E)
...@@ -553,7 +553,7 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false ...@@ -553,7 +553,7 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false
uwerr.(t2E) uwerr.(t2E)
else else
uwerr(t0, wpm) uwerr(t0, wpm)
uwerr.(t2E, wpm) [uwerr(t2E_aux, wpm) for t2E_aux in t2E]
end end
v = value.(t2E) v = value.(t2E)
......
...@@ -300,7 +300,7 @@ function md_val(a::uwreal, obs::Corr, derm::Vector{Corr}) ...@@ -300,7 +300,7 @@ function md_val(a::uwreal, obs::Corr, derm::Vector{Corr})
end end
function plat_av(obs::Vector{uwreal}, plat::Vector{Int64}, wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing) function plat_av(obs::Vector{uwreal}, plat::Vector{Int64}, wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing)
isnothing(wpm) ? uwerr.(obs) : uwerr.(obs, wpm) isnothing(wpm) ? uwerr.(obs) : [uwerr(obs_aux, wpm) for obs_aux in obs]
w = 1 ./ err.(obs)[plat[1]:plat[2]].^2 w = 1 ./ err.(obs)[plat[1]:plat[2]].^2
av = sum(w .* obs[plat[1]:plat[2]]) / sum(w) av = sum(w .* obs[plat[1]:plat[2]]) / sum(w)
return av return av
...@@ -329,7 +329,7 @@ m2_phys = fitp[1] + fitp[2] * phi2_phys ...@@ -329,7 +329,7 @@ m2_phys = fitp[1] + fitp[2] * phi2_phys
``` ```
""" """
function lin_fit(x::Vector{<:Real}, y::Vector{uwreal}; wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing) function lin_fit(x::Vector{<:Real}, y::Vector{uwreal}; wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing)
isnothing(wpm) ? uwerr.(y) : uwerr.(y, wpm) isnothing(wpm) ? uwerr.(y) : [uwerr(yaux, wpm) for yaux in y]
par = lin_fit(x, value.(y), err.(y)) par = lin_fit(x, value.(y), err.(y))
chisq(p, d) = sum((d .- p[1] .- p[2].*x).^2 ./ err.(y) .^2) chisq(p, d) = sum((d .- p[1] .- p[2].*x).^2 ./ err.(y) .^2)
(fitp, csqexp) = fit_error(chisq, par, y) (fitp, csqexp) = fit_error(chisq, par, y)
...@@ -383,7 +383,7 @@ fit_routine(model, xdata, ydata, param=3, covar=true) ...@@ -383,7 +383,7 @@ fit_routine(model, xdata, ydata, param=3, covar=true)
``` ```
""" """
function fit_routine(model::Function, xdata::Array{<:Real}, ydata::Array{uwreal}, param::Int64=3; wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing) function fit_routine(model::Function, xdata::Array{<:Real}, ydata::Array{uwreal}, param::Int64=3; wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing)
#isnothing(wpm) ? uwerr.(ydata) : uwerr.(ydata, wpm) isnothing(wpm) ? uwerr.(ydata) : [uwerr(yaux, wpm) for yaux in ydata]
yval = value.(ydata) yval = value.(ydata)
yer = err.(ydata) yer = err.(ydata)
...@@ -411,8 +411,8 @@ function fit_routine(model::Function, xdata::Array{uwreal}, ydata::Array{uwreal} ...@@ -411,8 +411,8 @@ function fit_routine(model::Function, xdata::Array{uwreal}, ydata::Array{uwreal}
uwerr.(ydata) uwerr.(ydata)
uwerr.(xdata) uwerr.(xdata)
else else
uwerr.(ydata, wpm) [uwerr(yaux, wpm) for yaux in ydata]
uwerr.(xdata, wpm) [uwerr(xaux, wpm) for xaux in xdata]
end end
yval = value.(ydata) yval = value.(ydata)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment