diff --git a/src/juobs_tools.jl b/src/juobs_tools.jl index 027c070ace91842fb651e4646664648724ca2052..218d38e384de523ab900ea09497acc2c04d7323d 100644 --- a/src/juobs_tools.jl +++ b/src/juobs_tools.jl @@ -8,9 +8,15 @@ function apply_rw(data::Array{Float64}, W::Matrix{Float64}, vcfg::Union{Nothing, rw2 = W[2, 1:nc] if fs == false - rw = rw1 .* rw2 - data_r = data .* rw[vcfg] - return (data_r, rw) + if id == "A653" + rw = rw1 + data_r = data .* rw[vcfg] + return (data_r, rw) + else + rw = rw1 .* rw2 + data_r = data .* rw[vcfg] + return (data_r, rw) + end else rw_s = [1.0 for i in 1:nc] rw_s[flag_s[id]] .= -1.0 @@ -30,9 +36,15 @@ function apply_rw(data::Vector{<:Array{Float64}}, W::Vector{Matrix{Float64}}, vc rw2 = [W[k][2, 1:nc[k]] for k=1:length(W)] if fs == false - 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) + if id == "A653" + 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 + 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 rw_s = [[1.0 for i in 1:nc[k]] for k=1:length(W)] if id == "H105" @@ -49,32 +61,6 @@ function apply_rw(data::Vector{<:Array{Float64}}, W::Vector{Matrix{Float64}}, vc end end -function apply_rw(data::Array{Float64}, W::Matrix{Float64}, vcfg::Union{Nothing, Vector{Int32}}=nothing, id::String="A653", fs::Bool=false) - nc = size(W,2) - if isnothing(vcfg) - vcfg = collect(1:nc) - end - - rw1 = W[1, 1:nc] - - rw = rw1 - data_r = data .* rw[vcfg] - return (data_r, rw) -end - -function apply_rw(data::Vector{<:Array{Float64}}, W::Vector{Matrix{Float64}}, vcfg::Union{Nothing, Vector{Int32}}=nothing, id::String="A653", fs::Bool=false) - nc = size.(W, 2) - if isnothing(vcfg) - vcfg = [collect(1:nc[k]) for k=1:length(nc)] - end - - 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) -end - function check_corr_der(obs::Corr, derm::Vector{Corr}; new_version::Bool=false) g1 = Vector{String}(undef, 0) g2 = Vector{String}(undef, 0)