function apply_rw(data::Array{Float64},W::Matrix{Float64},vcfg::Union{Nothing,Vector{Int32}}=nothing,id::Union{String,Nothing}=nothing,fs::Bool=false)
nc=size(W,2)
ifisnothing(vcfg)
vcfg=collect(1:nc)
end
rw1=W[1,1:nc]
rw2=W[2,1:nc]
iffs==false
rw=rw1.*rw2
data_r=data.*rw[vcfg]
return(data_r,rw)
else
data_r=data.*W1.*W2
return(data_r,W1.*W2)
rw_s=[1.0foriin1:nc]
rw_s[flag_s[id]].=-1.0
rw=rw1.*rw2.*rw_s
data_r=data.*rw[vcfg]
return(data_r,rw)
end
end
function apply_rw(data::Vector{<:Array{Float64}},W::Vector{Matrix{Float64}},id::Union{String,Nothing}=nothing)
iflength(W)!=length(data)
error("Lenghts must match")
function apply_rw(data::Vector{<:Array{Float64}},W::Vector{Matrix{Float64}},vcfg::Union{Nothing,Vector{Int32}}=nothing,id::Union{String,Nothing}=nothing,fs::Bool=false)
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)
ifisnothing(vcfg)
vcfg=collect(1:nc)
end
rw1=W[1,1:nc]
rw=rw1
data_r=data.*rw[vcfg]
return(data_r,rw)
end
# rw with gaps
function apply_rw(data::Vector{<:Array{Float64}},W::Vector{Matrix{Float64}},vcfg::Vector{Vector{Int32}})
function apply_rw(data::Vector{<:Array{Float64}},W::Vector{Matrix{Float64}},vcfg::Union{Nothing,Vector{Int32}}=nothing,id::String="A653",fs::Bool=false)