Commit 5ae4bbd4 authored by Alejandro Saez's avatar Alejandro Saez

idm in Wobs, check compatibility across ensembles

parent 1e21b0d2
...@@ -158,7 +158,7 @@ function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, No ...@@ -158,7 +158,7 @@ function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, No
# idm = isnothing(idm) ? collect(1:nms) : idm # idm = isnothing(idm) ? collect(1:nms) : idm
data_r, W = apply_rw(data, rw, cdata.vcfg, id=cdata.id, fs=flag_strange) data_r, W = apply_rw(data, rw, cdata.vcfg, id=cdata.id, fs=flag_strange)
ow = [uwreal(data_r[:, x0], cdata.id, idm, nms) for x0 = 1:nt] ow = [uwreal(data_r[:, x0], cdata.id, idm, nms) for x0 = 1:nt]
W_obs = uwreal(W, cdata.id, idm, nms) W_obs = uwreal(W[idm], cdata.id, idm, nms)
obs = [ow[x0] / W_obs for x0 = 1:nt] obs = [ow[x0] / W_obs for x0 = 1:nt]
end end
...@@ -210,7 +210,7 @@ function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array ...@@ -210,7 +210,7 @@ function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array
[tmp_W = cat(tmp_W, W[k], dims=1) for k = 2:nr] [tmp_W = cat(tmp_W, W[k], dims=1) for k = 2:nr]
ow = [uwreal(tmp[:, x0], id[1], replica, idm, nms) for x0 = 1:nt] ow = [uwreal(tmp[:, x0], id[1], replica, idm, nms) for x0 = 1:nt]
W_obs = uwreal(tmp_W, id[1], replica, idm, nms) W_obs = uwreal(tmp_W[idm], id[1], replica, idm, nms)
obs = [ow[x0] / W_obs for x0 = 1:nt] obs = [ow[x0] / W_obs for x0 = 1:nt]
end end
if info && !isnothing(rw) if info && !isnothing(rw)
...@@ -312,8 +312,8 @@ function corr_obs_TSM(cdata_sl::CData, cdata_corr::CData; real::Bool=true, rw::U ...@@ -312,8 +312,8 @@ function corr_obs_TSM(cdata_sl::CData, cdata_corr::CData; real::Bool=true, rw::U
ow1 = [uwreal(data1_r[:, x0], id, idm_sl, nms) for x0 = 1:nt] ow1 = [uwreal(data1_r[:, x0], id, idm_sl, nms) for x0 = 1:nt]
ow2 = [uwreal(data2_r[:, x0], id, idm_corr, nms) for x0 = 1:nt] ow2 = [uwreal(data2_r[:, x0], id, idm_corr, nms) for x0 = 1:nt]
W_obs_sl = uwreal(W_sl, id, idm_sl, nms) W_obs_sl = uwreal(W_sl[idm_sl], id, idm_sl, nms)
W_obs_corr = uwreal(W_corr, id, idm_corr, nms) W_obs_corr = uwreal(W_corr[idm_corr], id, idm_corr, nms)
obs1 = [ow1[x0] / W_obs_sl for x0 = 1:nt] obs1 = [ow1[x0] / W_obs_sl for x0 = 1:nt]
obs2 = [ow2[x0] / W_obs_corr for x0 = 1:nt] obs2 = [ow2[x0] / W_obs_corr for x0 = 1:nt]
...@@ -386,7 +386,7 @@ function corr_obs_TSM(cdata1::Array{CData, 1}, cdata2::Array{CData, 1}; real::Bo ...@@ -386,7 +386,7 @@ function corr_obs_TSM(cdata1::Array{CData, 1}, cdata2::Array{CData, 1}; real::Bo
ow1 = [uwreal(tmp1[:, x0], id[1], replica_sl, idm_sl, nms) for x0 = 1:nt] ow1 = [uwreal(tmp1[:, x0], id[1], replica_sl, idm_sl, nms) for x0 = 1:nt]
ow2 = [uwreal(tmp2[:, x0], id[1], replica_sl, idm_corr, nms) for x0 = 1:nt] ow2 = [uwreal(tmp2[:, x0], id[1], replica_sl, idm_corr, nms) for x0 = 1:nt]
W_obs = uwreal(tmp_W, id[1], replica_sl, idm_sl, nms) W_obs = uwreal(tmp_W[idm_sl], id[1], replica_sl, idm_sl, nms)
obs1 = [ow1[x0] / W_obs for x0 = 1:nt] obs1 = [ow1[x0] / W_obs for x0 = 1:nt]
obs2 = [ow2[x0] / W_obs for x0 = 1:nt] obs2 = [ow2[x0] / W_obs for x0 = 1:nt]
...@@ -415,7 +415,7 @@ function corr_sym(corrL::Corr, corrR::Corr, parity::Int64=1) ...@@ -415,7 +415,7 @@ function corr_sym(corrL::Corr, corrR::Corr, parity::Int64=1)
T = length(corrL.obs) T = length(corrL.obs)
sym = [:kappa, :mu, :gamma] sym = [:kappa, :mu, :gamma]
if corrL.y0 != T - 1 - corrR.y0 if corrL.y0 != T - 1 - corrR.y0
error("Corr: Parameter mismatch") error("Corr: Parameter mismatch: y0R != T-1-y0L")
end end
for s in sym for s in sym
if getfield(corrL, s) != getfield(corrR, s) if getfield(corrL, s) != getfield(corrR, s)
......
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