Commit 642b1656 authored by ale's avatar ale

bug apply_rw

parent 923832a2
......@@ -3,21 +3,23 @@ function apply_rw(data::Array{Float64}, W::Matrix{Float64}, vcfg::Union{Nothing,
if isnothing(vcfg)
vcfg = collect(1:nc)
end
rw1 = W[1, 1:nc]
rw2 = W[2, 1:nc]
if fs == false
if id == "A653"
rw1 = W[1, 1:nc]
rw = rw1
data_r = data .* rw[vcfg]
return (data_r, rw)
else
rw1 = W[1, 1:nc]
rw2 = W[2, 1:nc]
rw = rw1 .* rw2
data_r = data .* rw[vcfg]
return (data_r, rw)
end
else
rw1 = W[1, 1:nc]
rw2 = W[2, 1:nc]
rw_s = [1.0 for i in 1:nc]
rw_s[flag_s[id]] .= -1.0
rw = rw1 .* rw2 .* rw_s
......@@ -32,20 +34,22 @@ function apply_rw(data::Vector{<:Array{Float64}}, W::Vector{Matrix{Float64}}, vc
vcfg = [collect(1:nc[k]) for k=1:length(nc)]
end
rw1 = [W[k][1, 1:nc[k]] for k=1:length(W)]
rw2 = [W[k][2, 1:nc[k]] for k=1:length(W)]
if fs == false
if id == "A653"
rw1 = [W[k][1, 1:nc[k]] for k=1:length(W)]
rw = [rw1[k] for k =1:length(W)]
data_r = [data[k] .* rw[k][vcfg[k]] for k=1:length(data)]
return (data_r, rw)
else
rw1 = [W[k][1, 1:nc[k]] for k=1:length(W)]
rw2 = [W[k][2, 1:nc[k]] for k=1:length(W)]
rw = [rw1[k] .* rw2[k] for k =1:length(W)]
data_r = [data[k] .* rw[k][vcfg[k]] for k=1:length(data)]
return (data_r, rw)
end
else
rw1 = [W[k][1, 1:nc[k]] for k=1:length(W)]
rw2 = [W[k][2, 1:nc[k]] for k=1:length(W)]
rw_s = [[1.0 for i in 1:nc[k]] for k=1:length(W)]
if id == "H105"
rw_s[1][flag_s["H105r001"]] .= -1.0
......
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