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