Commit 979ac3a2 authored by ale's avatar ale

bugs in constants, corr_TSM and apply_rw

parent e7f6600e
......@@ -9,7 +9,10 @@ include("juobs_reader.jl")
include("juobs_tools.jl")
include("juobs_obs.jl")
include("../constants/juobs_const.jl")
include("types.jl")
export EnsInfo
export ens_db, db, db_c, flag_s
export read_mesons, read_mesons_correction, read_mesons_multichunks, read_mesons_correction_multichunks, read_ms1, read_ms, read_md, get_YM, get_YM_dYM, truncate_data!, concat_data!
export get_matrix, energies, uwdot, uweigvals, uweigvecs, uweigen, invert, getall_eigvals, getall_eigvecs, hess_reduce, uwcholesky, transpose, tridiag_reduction, make_positive_def, invert_covar_matrix
export corr_obs, corr_obs_TSM, corr_sym, md_sea, md_val, plat_av, lin_fit, x_lin_fit, y_lin_fit, fit_routine, global_fit_routine, bayesian_av, pvalue, fve, model_av, fit_alg
......
......@@ -270,7 +270,7 @@ corr_pp = corr_obs.(data)
corr_pp_r = corr_obs.(data, rw=[rw1, rw2])
```
"""
function corr_obs_TSM(cdata_sl::CData, cdata_corr::CData; real::Bool=true, rw::Union{Array{Float64, 2}, Nothing}=nothing, L::Int64=1, info::Bool=false, idm_sl::Union{Vector{Int64},Nothing}=nothing, idm_corr::Union{Vector{Int64},Nothing}=nothing, nms::Union{Int64,Nothing}=nothing)
function corr_obs_TSM(cdata_sl::CData, cdata_corr::CData; real::Bool=true, rw::Union{Array{Float64, 2}, Nothing}=nothing, L::Int64=1, info::Bool=false, idm_sl::Union{Vector{Int64},Nothing}=nothing, idm_corr::Union{Vector{Int64},Nothing}=nothing, nms::Union{Int64,Nothing}=nothing, flag_strange::Bool=false)
# cdata1 is sloppy, cdata2 is correction
if cdata_sl.id != cdata_corr.id
error("Error: cdata_sl id != cdata_corr id")
......@@ -307,8 +307,8 @@ function corr_obs_TSM(cdata_sl::CData, cdata_corr::CData; real::Bool=true, rw::U
obs1 = [uwreal(data1[:, x0], id, idm_sl, nms) for x0 = 1:nt]
obs2 = [uwreal(data2[:, x0], id, idm_corr, nms) for x0 = 1:nt]
else
data1_r, W_sl = apply_rw(data1, rw, vcfg=vcfg_sl, id=id, fs=flag_strange)
data2_r, W_corr = apply_rw(data2, rw, vcfg=vcfg_corr, id=id, fs=flag_strange)
data1_r, W_sl = apply_rw(data1, rw, vcfg_sl, id=id, fs=flag_strange)
data2_r, W_corr = apply_rw(data2, rw, vcfg_corr, id=id, fs=flag_strange)
ow1 = [uwreal(data1_r[:, x0], id, idm_sl, nms) for x0 = 1:nt]
ow2 = [uwreal(data2_r[:, x0], id, idm_corr, nms) for x0 = 1:nt]
......@@ -328,7 +328,7 @@ function corr_obs_TSM(cdata_sl::CData, cdata_corr::CData; real::Bool=true, rw::U
end
end
function corr_obs_TSM(cdata1::Array{CData, 1}, cdata2::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array{Float64, 2}, 1}, Nothing}=nothing, L::Int64=1, info::Bool=false, replica_sl::Union{Vector{Int64},Nothing}=nothing, idm_sl::Union{Vector{Int64},Nothing}=nothing, idm_corr::Union{Vector{Int64},Nothing}=nothing, nms::Union{Int64, Nothing}=nothing)
function corr_obs_TSM(cdata1::Array{CData, 1}, cdata2::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array{Float64, 2}, 1}, Nothing}=nothing, L::Int64=1, info::Bool=false, replica_sl::Union{Vector{Int64},Nothing}=nothing, idm_sl::Union{Vector{Int64},Nothing}=nothing, idm_corr::Union{Vector{Int64},Nothing}=nothing, nms::Union{Int64, Nothing}=nothing, flag_strange::Bool=false)
if any(getfield.(cdata1, :id) .!= getfield.(cdata2, :id))
error("Error: cdata1 id != cdata2 id")
end
......@@ -376,8 +376,8 @@ function corr_obs_TSM(cdata1::Array{CData, 1}, cdata2::Array{CData, 1}; real::Bo
obs2 = [uwreal(tmp2[:, x0], id[1], replica_sl, idm_corr, nms) for x0 = 1:nt]
else
data1_r, W = apply_rw(data1, rw, vcfg_sl, id=id, fs=flag_strange)
data2_r, W = apply_rw(data2, rw, vcfg_corr, id=id, fs=flag_strange)
data1_r, W = apply_rw(data1, rw, vcfg_sl, id=id[1], fs=flag_strange)
data2_r, W = apply_rw(data2, rw, vcfg_corr, id=id[1], fs=flag_strange)
tmp1 = cat(data1_r..., dims=1)
tmp2 = cat(data2_r..., dims=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