Skip to content

Commit

Permalink
check for incomplete data; tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
joott committed Jun 24, 2022
1 parent 15d41a8 commit c0c657c
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions KZ_analysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,40 @@ const t_e = (m²e - m_b)/m_a

const t_c_steps = trunc(Int, t_c/Δt)

maxt = trunc(Int, t_e / Δt)+1
maxt = trunc(Int, t_e / Δt)+2
ts = [1//2, 3//4, 1, 5//4, 5//2, maxt//t_c_steps]

C_tot = zeros(Float32, length(ts), L÷2)

function KZ_run(fn)
df = readdlm(fn, ' ')
if (length(df[:,1])) != maxt
println("YIKES AT $fn")
return
end
ϕ = zeros(ComplexF32, length(ts), L÷2)
τ = trunc.(Int, ts.*t_c_steps)
τ = trunc.(Int, ts*t_c_steps)

for k in 1:L÷2
Threads.@threads for k in 1:L÷2
ϕ[:,k] .= df[τ,2k] .+ 1.0im .* df[τ,1+2k]
end

for i in 1:length(ts)
C_tot[i,:] .+= ϕ[i,:]/4096
C_tot[i,:] .+= abs2.(ϕ[i,:])/4096
end
end

function collect_files()
for id in 1:16, series in 1:16, run in 1:16
@show (id, series, run)
KZ_run("KZ_L_$L"*"_id_$id"*"_series_$series"*"_run_$run.dat")
end
end

collect_files()

output_file = open("data_KZ_$L.jl","w")

write(output_file, "C_32 = ")
show(output_file, C_tot)
close(output_file)

0 comments on commit c0c657c

Please sign in to comment.