Commit 0517dc10 authored by Antonino D'Anna's avatar Antonino D'Anna

added sorting accoring to gamma structure in new read_mesons

parent 93d030c7
......@@ -277,9 +277,22 @@ function read_mesons(path::String, gamma::Vector{Tuple{String,String}}; id::Unio
end
end
## sort by gamma_structure
idx = Vector{Int64}(undef, length(corr_match))
is = 1
for (G1,G2) in type
aux = findall(x-> (x.type1 == G1 && x.type2==G2),c_header[corr_match])
if isnothing(aux)
continue;
end
l =length(aux);
idx[is:is+l-1] = aux
is += l;
end
for c in eachindex(corr_match)
res[c] = juobs.CData(c_header[corr_match[c]], vcfg, data_re[c, :, :], data_im[c, :, :], id)
for i in eachindex(idx)
c = idx[i]
res[i] = juobs.CData(c_header[corr_match[c]], vcfg, data_re[c, :, :], data_im[c, :, :], id)
end
close(data)
......@@ -373,9 +386,24 @@ function read_mesons_correction(path::String, g1::Union{String, Nothing}=nothing
end
end
end
for c = 1:div(length(corr_match), 2)
res[c] = CData(c_header[corr_match[c]], vcfg, data_re[c, :, :], data_im[c, :, :], id)
end
## sort by gamma_structure
idx = Vector{Int64}(undef, length(corr_match))
is = 1
for (G1,G2) in type
aux = findall(x-> (x.type1 == G1 && x.type2==G2),c_header[corr_match])
if isnothing(aux)
continue;
end
l =length(aux);
idx[is:is+l-1] = aux
is += l;
end
for i in eachindex(idx)
c = idx[i]
res[i] = juobs.CData(c_header[corr_match[c]], vcfg, data_re[c, :, :], data_im[c, :, :], id)
end
close(data)
return res
......@@ -409,7 +437,7 @@ function read_mesons_correction(path::Vector{String}, g1::Union{String, Nothing}
return cdata
end
function dev_read_mesons_correction(path::String, gamma::Vector{Tuple{String,String}}; id::Union{String, Nothing}=nothing, legacy::Bool=false,
function read_mesons_correction(path::String, gamma::Vector{Tuple{String,String}}; id::Union{String, Nothing}=nothing, legacy::Bool=false,
nnoise_trunc::Union{Int64, Nothing}=nothing)
type = Vector{Tuple{Int64,Int64}}(undef,length(gamma))
......@@ -492,9 +520,9 @@ function dev_read_mesons_correction(path::String, gamma::Vector{Tuple{String,Str
return res
end
function dev_read_mesons_correction(path::Vector{String}, gamma::Vector{Tuple{String,String}}; id::Union{String, Nothing}=nothing, legacy::Bool=false,
function ead_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 = [dev_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)
ncorr = length(res[1])
......
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