Commit 30cb3eb7 authored by Antonino D'Anna's avatar Antonino D'Anna

bug fixed and ading J307 to database

parent 88a7a23a
......@@ -16,6 +16,7 @@ const ens_db = Dict(
"N300" => [48, 128, 3.70, 1, "1.2", [1540]],
"N302" => [48, 128, 3.70, 1, "1.2", [2201]],
"J303" => [64, 192, 3.70, 2, "2.0", [1073]],
"J307" => [64, 192, 3.70, 1, "2.0",[586,536]],
"E300" => [96, 192, 3.70, 1, ["1.4"], [1139]],
"J500" => [64, 192, 3.85, 2, ["1.2", "1.4", "2.0"], [789,655,431]],
"J501" => [64, 192, 3.85, 1, ["1.2", "1.4", "2.0"], [1635,1142,1150]],
......
......@@ -282,7 +282,7 @@ It returns a `NamedTuple` with names:
- `:chiexp`: chisquare expected
- `:pval`: pvalue
"""
function fit_routine(models::AbstractArray{Function},
function fit_routines(models::AbstractArray{Function},
xdata::AbstractArray{<:AbstractArray},
ydata::AbstractArray{<:AbstractArray{ADerrors.uwreal}},
npar::Int64;
......@@ -326,16 +326,20 @@ function fit_routine(models::AbstractArray{Function},
CC = length(C)==0 ? C : make_matrix(C);
function Model(x,p)
res = zeros(Nmodel)
res = Vector{Any}(undef,Nmodel)
res[1] = models[1](x[1:ndata[1]],p)
for i in 2:Nmodel
rd = (ndata[i-1]+1):ndata[i]
rp = (npar[i-1]+1):npar[i]
is= 1
ie= 0
for i in 1:Nmodel
ie += ndata[i]
rd = is:ie
res[i] = models[i](x[rd],p)
is = ie +1
end
return res
return vcat(res...)
end
fit = fit_routine(Model,X,Y,npar,guess = guess,W=WW,C=CC,corr=corr,logfile=nothing,wpm=wpm)
fit = juobs.fit_routine(Model,X,Y,npar,guess = guess,W=WW,C=CC,corr=corr,logfile=nothing,wpm=wpm)
if !isnothing(logfile)
uwerr.(fit.par)
......
......@@ -508,7 +508,7 @@ function read_mesons_correction(path::String, gamma::Vector{Tuple{String,String}
return res
end
function ead_mesons_correction(path::Vector{String}, gamma::Vector{Tuple{String,String}}; id::Union{String, Nothing}=nothing, legacy::Bool=false,
function read_mesons_correction(path::Vector{String}, gamma::Vector{Tuple{String,String}}; id::Union{String, Nothing}=nothing, legacy::Bool=false,
nnoise_trunc::Union{Int64, Nothing}=nothing)
res = [read_mesons_correction(p, gamma, id=id, legacy=legacy, nnoise_trunc=nnoise_trunc) for p in path]
nrep = length(res)
......
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