Commit de0b3a2c authored by Alessandro 's avatar Alessandro

including plateau selection from plat.txt for t0

parent bad76c77
#H400
ll 40 83
ls 40 83
lh 40 83
ss 40 83
sh 40 83
hh 40 83
t0 20 90
#N300
ll 58 95
lh 58 95
hh 58 95
t0 20 100
#N200
ll 85 105
ls 85 105
......@@ -16,6 +15,7 @@ lh 85 105
ss 85 105
sh 83 110
hh 83 110
t0 40 110
#N203
ll 85 105
ls 85 105
......@@ -23,6 +23,7 @@ lh 85 105
ss 85 105
sh 83 110
hh 81 95
t0 50 120
#J303
ll 120 140
ls 123 140
......@@ -30,4 +31,5 @@ lh 123 140
ss 123 140
sh 123 140
hh 123 155
t0 40 160
#end
{}
\ No newline at end of file
......@@ -35,7 +35,7 @@ using Revise, juobs, PyPlot, LaTeXStrings, ADerrors, DelimitedFiles
#============= SET UP VARIABLES ===========#
const path_data = "/Users/ale/Desktop/data"
const path_plat = "/Users/ale/Google Drive/phd/analysis/automation/plat.txt"
const path_plat = "/Users/ale/automation/plat.txt"
const path_results = "/Users/ale/Desktop/results"
const ensembles = ["J303", "H400", "N300"]
const sector = Dict("ll"=>false, "ls"=>false, "lh"=>true, "ss"=>false, "sh"=>true, "hh"=>true )
......
......@@ -41,7 +41,7 @@ function get_corr(ens::EnsInfo, g1::String="G5", g2::String="G5"; rw::Bool=false
end
function get_t0(ens::EnsInfo; rw::Bool=false, pl::Bool=false)
data = read_t0(ens.id)
plat = [40,160]
plat = select_plateau(ens)
!rw ? t0 = comp_t0(data, plat, L=ens.L, pl=pl) : t0 = comp_t0(data, plat, L=ens.L, pl=pl, rw=read_rw(ens.id))
return t0
end
......@@ -127,6 +127,22 @@ function get_f(obs::Vector{juobs.Corr}, m::Vector{uwreal}, ens::EnsInfo; pl::Boo
plat = select_plateau(ens, mu_list)
return dec_const_pcvc.(obs, plat, m, pl=pl)
end
function select_plateau(ensinfo::EnsInfo)
ens = ensinfo.id
f = readdlm(path_plat)
head = String.(f[:,1])
delim = findall(x->occursin("#", x), head)
edelim = findfirst(x->occursin(ens, x), head)
cdelim = findfirst(x-> x.== edelim, delim)
del = delim[cdelim]+1 : delim[cdelim+1]-1
head_ = String.(f[del, 1])
plat_ = Int64.(f[del, 2:3])
plat = Vector{Int64}(undef, 2)
n = findfirst(x-> occursin("t0", x), head_)
plat[1] = plat_[n,1]
plat[2] = plat_[n,2]
return plat
end
function select_plateau(ensinf::EnsInfo, mu_list)
ens =ensinf.id
deg = ensinf.deg
......
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