Commit ebccaa83 authored by Alejandro Saez's avatar Alejandro Saez

flagged strange

parent 04dfee39
...@@ -21,6 +21,35 @@ function apply_rw(data::Vector{<:Array{Float64}}, W::Vector{Matrix{Float64}}) ...@@ -21,6 +21,35 @@ function apply_rw(data::Vector{<:Array{Float64}}, W::Vector{Matrix{Float64}})
return (data_r, rw) return (data_r, rw)
end end
function apply_rw_flagged_strange(data::Array{Float64}, id::String)
if id == "J303r003" || id == "J303"
flagged_cfg = [324, 325, 326]
for i in flagged_cfg
data[i,:] = -data[i,:]
end
elseif id == "H105r005"
flagged_cfg = [254, 255, 256, 257, 259, 260, 261, 264, 265, 266, 269, 280, 282, 283, 284, 285, 286, 287, 288, 289, 291, 299, 301, 313, 314, 315, 316, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342]
for i in flagged_cfg
data[i,:] = -data[i,:]
end
end
return data
end
function apply_rw_flagged_strange(data::Vector{<:Array{Float64}}, id::String)
if id == "H105r001" || id == "H105"
flagged_cfg_r001 = [100, 105, 106]
flagged_cfg_r002 = [1]
for i in flagged_cfg_r001
data[1][i,:] = -data[1][i,:]
end
for i in flagged_cfg_r002
data[2][i,:] = -data[2][i,:]
end
end
return data
end
function check_corr_der(obs::Corr, derm::Vector{Corr}; new_version::Bool=false) function check_corr_der(obs::Corr, derm::Vector{Corr}; new_version::Bool=false)
g1 = Vector{String}(undef, 0) g1 = Vector{String}(undef, 0)
g2 = Vector{String}(undef, 0) g2 = Vector{String}(undef, 0)
...@@ -96,7 +125,7 @@ corr_pp = corr_obs.(data) ...@@ -96,7 +125,7 @@ corr_pp = corr_obs.(data)
corr_pp_r = corr_obs.(data, rw=[rw1, rw2]) 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) function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, Nothing}=nothing, L::Int64=1, info::Bool=false, flagged_strange::Bool=false)
real ? data = cdata.re_data ./ L^3 : data = cdata.im_data ./ L^3 real ? data = cdata.re_data ./ L^3 : data = cdata.im_data ./ L^3
nt = size(data)[2] nt = size(data)[2]
...@@ -104,6 +133,7 @@ function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, No ...@@ -104,6 +133,7 @@ function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, No
if isnothing(rw) if isnothing(rw)
obs = [uwreal(data[:, x0], cdata.id) for x0 = 1:nt] obs = [uwreal(data[:, x0], cdata.id) for x0 = 1:nt]
else else
flagged_strange ? data = apply_rw_flagged_strange(data, cdata.id) : nothing
data_r, W = apply_rw(data, rw) data_r, W = apply_rw(data, rw)
ow = [uwreal(data_r[:, x0], cdata.id) for x0 = 1:nt] ow = [uwreal(data_r[:, x0], cdata.id) for x0 = 1:nt]
W_obs = uwreal(W, cdata.id) W_obs = uwreal(W, cdata.id)
...@@ -139,6 +169,7 @@ function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array ...@@ -139,6 +169,7 @@ function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array
[tmp = cat(tmp, data[k], dims=1) for k = 2:nr] [tmp = cat(tmp, data[k], dims=1) for k = 2:nr]
obs = [uwreal(tmp[:, x0], id[1], replica) for x0 = 1:nt] obs = [uwreal(tmp[:, x0], id[1], replica) for x0 = 1:nt]
else else
flagged_strange ? data = apply_rw_flagged_strange(data, cdata[1].id) : nothing
data_r, W = apply_rw(data, rw) data_r, W = apply_rw(data, rw)
tmp = data_r[1] tmp = data_r[1]
tmp_W = W[1] tmp_W = W[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