Commit 7a934361 authored by Alejandro Saez's avatar Alejandro Saez

md_val for TSM corrs

parent 3db1c2e2
...@@ -470,6 +470,28 @@ function md_val(a::uwreal, obs::Corr, derm::Vector{Corr}; new_version::Bool=fals ...@@ -470,6 +470,28 @@ function md_val(a::uwreal, obs::Corr, derm::Vector{Corr}; new_version::Bool=fals
ow_data = ow_mean .+ ws.fluc[n_ow] ow_data = ow_mean .+ ws.fluc[n_ow]
=# =#
der = length(a.der) >= maximum(n_ow) ? a.der[n_ow] * w_mean : 0.0 der = length(a.der) >= maximum(n_ow) ? a.der[n_ow] * w_mean : 0.0
elseif all(count.(prop) .== 3)
corr_der = getfield.(corr, :der)
n = findall.(t-> t==1, prop)
n = vcat(n'...)
if all(n[:, 1] .== n[1, 1]) # find ow and w
n_w = n[1, 1]
n_ow1 = n[:, 2]
n_ow2 = n[:, 3]
elseif all(n[:, 2] .== n[1, 2])
n_w = n[1, 2]
n_ow1 = n[:, 1]
n_ow2 = n[:, 3]
elseif all(n[:, 3] .== n[1, 3])
n_w = n[1, 3]
n_ow1 = n[:, 1]
n_ow2 = n[:, 2]
end
w_mean = 1 / getindex.(corr_der, n_ow1)[1]
if 1 / getindex.(corr_der, n_ow1)[1] != 1 / getindex.(corr_der, n_ow2)[1]
error("w_mean with n_ow1 and with n_ow2 different")
end
der = length(a.der) >= maximum(n_ow1) && length(a.der) >= maximum(n_ow2) ? a.der[n_ow1] * w_mean : 0.0
else else
return nothing return nothing
end end
......
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