Commit 5ce40e52 authored by Antonino D'Anna's avatar Antonino D'Anna

small changes

parent 11a5ac27
......@@ -13,7 +13,7 @@ Correlator can be passed as an `Corr` struct or `Vector{uwreal}`.
In case of Vector{Corr} it is better to not broadcast, especially in case of `data=true` or `pl=true`, since the the overloaded function for Vector{Corr} takes care of the extra outputs and organize them into a `Tuple` of Vector
# Arguments
- `pl::Bool=false` and `savepl::Bool=false`: show and save the plots. The plots are made through the functions `plot_data` and `plot_func`. It is possible to pass keyword arguments for these two functions.
- `pl::Bool=false` and `savepl::Bool=false`: show and save the plots. The plots are made through the functions `plot_data` and `plot_func`. It is possible to pass keyword arguments for these two functions.
When `savepl = true`, the plots are saved and closed. When `pl = true` the plot are generated, displayed and the last two returns are always `fig,ax` object to allow more costumability.
If both are `true`, `pl` is ignored.
......@@ -51,7 +51,8 @@ In case of Vector{Corr} it is better to not broadcast, especially in case of `da
function meff(corr::Vector{uwreal}, plat::Vector{Int64}; pl::Bool=false, data::Bool=false,
mu::Union{Vector{Float64}, Nothing}=nothing, kappa::Union{Vector{Float64}, Nothing}=nothing,
wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing, savepl::Bool=false,
filename::String="",plot_kw...)
filename::String="",plot_kw...)
dim = length(corr)
aux = 0.5 .* log.((corr[2:dim-2] ./ corr[3:dim-1]).^2)
mass = plat_av(aux, plat, wpm)
......@@ -99,8 +100,8 @@ function meff(corr::Vector{uwreal}, plat::Vector{Int64}; pl::Bool=false, data::B
return data ? (mass,aux) : mass
end
end
function meff(corr::Corr, plat::Vector{Int64}; kwargs...)
if corr.mu == [0.0, 0.0]
return meff(corr.obs, plat; kappa=corr.kappa, mu=nothing,kwargs...)
else
......@@ -221,14 +222,14 @@ function mpcac(a0p::Vector{uwreal}, pp::Vector{uwreal}, plat::Vector{Int64}; ca:
savepl::Bool = false,filename::String="",plot_kw...)
if ca != 0.0
der_a0p = (corr_a0p[3:end] .- corr_a0p[1:end-2]) / 2
der2_pp = (corr_pp[1:end-4] - 2*corr_pp[3:end-2] + corr_pp[5:end])/4
der_a0p = (a0p[3:end] .- a0p[1:end-2]) / 2
der2_pp = (pp[1:end-4] - 2*pp[3:end-2] + pp[5:end])/4
der_a0p = der_a0p[2:end-1] - ca * der2_pp
else
der_a0p = (corr_a0p[4:end-1] .- corr_a0p[2:end-3]) / 2
der_a0p = (a0p[4:end-1] .- a0p[2:end-3]) / 2
end
aux = -der_a0p ./ ( 2. .* corr_pp[3:end-2]) # this minus sign come from the convention used: see docs/On_the_convention.pdf
aux = -der_a0p ./ ( 2. .* pp[3:end-2]) # this minus sign come from the convention used: see docs/On_the_convention.pdf
mass = plat_av(aux, plat, wpm)
if pl|| savepl
......
......@@ -239,6 +239,13 @@ mutable struct EnsInfo
ca = - 0.006033 .* g2 .*( 1 .+exp.(p0 .+ p1./g2))
return new(id, L, T, beta, ca, dtr, vrw, cnfg)
end
function EnsInfo(ens_id::String)
if haskey(ens_db,ens_id)
return EnsInfo(ens_id,ens_db[ens_id])
else
error("$ens_id is not in database")
end
end
end
function Base.show(io::IO, a::GHeader)
......
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