Commit ba991237 authored by Javier's avatar Javier

read_mesons takes Vector{String} as input

cdata = [[data_r1[k], data_r2[k]] for k=1:length(data_r1)]
is no longer needed
parent 15e017ec
......@@ -156,6 +156,21 @@ function read_mesons(path::String, g1::Union{String, Nothing}=nothing, g2::Union
return res
end
function read_mesons(path::Vector{String}, g1::Union{String, Nothing}=nothing, g2::Union{String, Nothing}=nothing; id::Union{Int64, Nothing}=nothing)
res = read_mesons.(path, g1, g2, id=id)
nrep = length(res)
ncorr = length(res[1])
cdata = Vector{Vector{CData}}(undef, ncorr)
for icorr = 1:ncorr
cdata[icorr] = Vector{CData}(undef, nrep)
for r = 1:nrep
cdata[icorr][r] = res[r][icorr]
end
end
return cdata
end
function read_rw(path::String; v::String="1.2")
data = open(path, "r")
nrw = read(data, Int32)
......
......@@ -48,15 +48,12 @@ corr_pp = corr_obs.(data)
corr_pp_r = corr_obs.(data, rw=rw)
#Two replicas
data_r1 = read_mesons(path_r1, "G5", "G5")
data_r2 = read_mesons(path_r2, "G5", "G5")
data = read_mesons([path_r1, path_r2], "G5", "G5")
rw1 = read_ms1(path_rw1)
rw2 = read_ms1(path_rw2)
cdata = [[data_r1[k], data_r2[k]] for k=1:length(data_r1)]
corr_pp = corr_obs.(cdata)
corr_pp_r = corr_obs.(cdata, rw=[rw1, rw2])
corr_pp = corr_obs.(data)
corr_pp_r = corr_obs.(data, rw=[rw1, rw2])
```
"""
function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, Nothing}=nothing, L::Int64=1)
......@@ -120,15 +117,11 @@ m_mdl, m_mds = md_sea(m, [md], ADerrors.wsg)
m_shifted = m + 2 * dml * m_mdl + dms * m_mds
#Two replicas
data_r1 = read_mesons(path_r1, "G5", "G5")
data_r2 = read_mesons(path_r2, "G5", "G5")
data = read_mesons([path_r1, path_r2], "G5", "G5")
md1 = read_md(path_md1)
md2 = read_md(path_md2)
cdata = [[data_r1[k], data_r2[k]] for k=1:length(data_r1)]
corr_pp = corr_obs.(cdata)
corr_pp = corr_obs.(data)
m = meff(corr_pp[1], plat)
m_mdl, m_mds = md_sea(m, [md1, md2], ADerrors.wsg)
m_shifted = m + 2 * dml * m_mdl + dms * m_mds
......
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