Commit af93cbcb authored by ale's avatar ale

bug in corr_obs with gaps & rwf

parent 9207d961
......@@ -160,22 +160,19 @@ 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, info::Bool=false, idm::Union{Vector{Int64},Nothing}=nothing, nms::Int64=Int64(maximum(cdata.vcfg)), flag_strange::Bool=false)
function juobs.corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, Nothing}=nothing, L::Int64=1, info::Bool=false, idm::Union{Vector{Int64},Nothing}=nothing, nms::Int64=Int64(maximum(cdata.vcfg)), flag_strange::Bool=false)
real ? data = cdata.re_data ./ L^3 : data = cdata.im_data ./ L^3
nt = size(data)[2]
nms_vec = cdata.vcfg
delta_cnfg = nms_vec[2] - nms_vec[1]
idm = isnothing(idm) ? collect(1:delta_cnfg:nms) : idm
idm = isnothing(idm) ? cdata.vcfg : idm
if isnothing(rw)
# idm = isnothing(idm) ? collect(1:nms) : idm
obs = [uwreal(data[:, x0], cdata.id, idm, nms) for x0 = 1:nt]
else
# idm = isnothing(idm) ? collect(1:nms) : idm
data_r, W = apply_rw(data, rw, cdata.id)
data_r, W = apply_rw(data, rw, cdata.vcfg)
ow = [uwreal(data_r[:, x0], cdata.id, idm, nms) for x0 = 1:nt]
W_obs = uwreal(W, cdata.id, idm, nms)
obs = [ow[x0] / W_obs for x0 = 1:nt]
......@@ -191,7 +188,7 @@ function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, No
end
#function corr_obs for R != 1
#TODO: vcfg with gaps
function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array{Float64, 2}, 1}, Nothing}=nothing, L::Int64=1, info::Bool=false, replica::Union{Vector{Int64},Nothing}=nothing, idm::Union{Vector{Int64},Nothing}=nothing, nms::Union{Int64, Nothing}=nothing, flag_strange::Bool=false)
function juobs.corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array{Float64, 2}, 1}, Nothing}=nothing, L::Int64=1, info::Bool=false, replica::Union{Vector{Int64},Nothing}=nothing, idm::Union{Vector{Int64},Nothing}=nothing, nms::Union{Int64, Nothing}=nothing, flag_strange::Bool=false)
nr = length(cdata)
id = getfield.(cdata, :id)
vcfg = getfield.(cdata, :vcfg)
......@@ -222,7 +219,7 @@ function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array
obs = [uwreal(tmp[:, x0], id[1], replica, idm, nms) for x0 = 1:nt]
else
data_r, W = apply_rw(data, rw, id[1])
data_r, W = apply_rw(data, rw, vcfg)
tmp = data_r[1]
tmp_W = W[1]
[tmp = cat(tmp, data_r[k], dims=1) for k = 2:nr]
......
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