mirror of
https://gitlab.cern.ch/wotsubo/PSBoardDataBase.git
synced 2025-06-08 05:55:42 +09:00
update: skew_stats (add counts search)
This commit is contained in:
parent
218349a126
commit
4f0dad1c03
2 changed files with 88 additions and 36 deletions
File diff suppressed because one or more lines are too long
|
@ -123,8 +123,15 @@ df_rawskews =
|
||||||
(
|
(
|
||||||
file -> begin
|
file -> begin
|
||||||
skew_width = PSBoardDataBase.ClockParser.get_skew_and_riseup(file)
|
skew_width = PSBoardDataBase.ClockParser.get_skew_and_riseup(file)
|
||||||
|
riseup = PSBoardDataBase.ClockParser.count_riseup(file)
|
||||||
psbid, runid = parse_filename(file)
|
psbid, runid = parse_filename(file)
|
||||||
(psbid = psbid, runid = runid, skew = skew_width[1], width = skew_width[2])
|
(
|
||||||
|
psbid = psbid,
|
||||||
|
runid = runid,
|
||||||
|
skew = skew_width[1],
|
||||||
|
width = skew_width[2],
|
||||||
|
riseup = riseup,
|
||||||
|
)
|
||||||
end
|
end
|
||||||
) |>
|
) |>
|
||||||
filter(
|
filter(
|
||||||
|
@ -183,9 +190,10 @@ md"""
|
||||||
# ╔═╡ 420dce0e-4757-48d9-84ec-7ddfac2fdff6
|
# ╔═╡ 420dce0e-4757-48d9-84ec-7ddfac2fdff6
|
||||||
let
|
let
|
||||||
skew_widths = df_skews.width |> skipmissing |> collect
|
skew_widths = df_skews.width |> skipmissing |> collect
|
||||||
|
bins = range(0, maximum(skew_widths), step = 1 / 57)# .- 0.01
|
||||||
hist(
|
hist(
|
||||||
skew_widths,
|
skew_widths,
|
||||||
bins = range(minimum(skew_widths), maximum(skew_widths), step = 1 / 57),
|
bins = bins,
|
||||||
bar_labels = :y,
|
bar_labels = :y,
|
||||||
label_size = 14,
|
label_size = 14,
|
||||||
label_formatter = x -> "$(round(Int, x))",
|
label_formatter = x -> "$(round(Int, x))",
|
||||||
|
@ -194,6 +202,8 @@ let
|
||||||
xlabel = "rise up span / ns",
|
xlabel = "rise up span / ns",
|
||||||
ylabel = "counts",
|
ylabel = "counts",
|
||||||
limits = ((0, 0.18), (0, nothing)),
|
limits = ((0, 0.18), (0, nothing)),
|
||||||
|
# xticks = (bins, string.(round.(bins, digits = 3))),
|
||||||
|
# xticklabelrotation = π / 3,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -206,6 +216,9 @@ md"""
|
||||||
この結果を元に、クロック試験のしきい値は$(round(9 * 1 / 57; digits = 2))ns以上に設定
|
この結果を元に、クロック試験のしきい値は$(round(9 * 1 / 57; digits = 2))ns以上に設定
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# ╔═╡ 875bec26-e576-4f48-ba14-464bce503d75
|
||||||
|
filter(:width => (x -> ismissing(x) || x < 0.06), df_skews)
|
||||||
|
|
||||||
# ╔═╡ ec774495-c0be-47a4-9d2c-b48159c07013
|
# ╔═╡ ec774495-c0be-47a4-9d2c-b48159c07013
|
||||||
md"""
|
md"""
|
||||||
## 各PSBoardごとの統計
|
## 各PSBoardごとの統計
|
||||||
|
@ -273,12 +286,9 @@ end
|
||||||
|
|
||||||
# ╔═╡ eae649db-6b2b-4530-83a8-3438f29423cc
|
# ╔═╡ eae649db-6b2b-4530-83a8-3438f29423cc
|
||||||
let
|
let
|
||||||
df = filter(
|
df = filter(:psboard_id => in(df_skew_stats_abnormals.psbid), qaqc_single_results)
|
||||||
:psboard_id => in(df_skew_stats_abnormals.psbid),
|
select!(df, [:runid, :psboard_id, :lvds_tx_skew, :note])
|
||||||
qaqc_single_results,
|
df
|
||||||
)
|
|
||||||
select!(df, [:runid, :psboard_id, :lvds_tx_skew, :note])
|
|
||||||
df
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# ╔═╡ d607e10e-854f-4652-9a34-9e22a188e315
|
# ╔═╡ d607e10e-854f-4652-9a34-9e22a188e315
|
||||||
|
@ -358,25 +368,41 @@ df_skews_selected = combine(
|
||||||
all(ismissing, sdf.skew) && @info "" sdf
|
all(ismissing, sdf.skew) && @info "" sdf
|
||||||
if nrow(sdf) == 1
|
if nrow(sdf) == 1
|
||||||
@assert sdf.skew |> first |> !ismissing
|
@assert sdf.skew |> first |> !ismissing
|
||||||
(skew = sdf.skew |> first, width = sdf.width |> first)
|
(
|
||||||
|
skew = sdf.skew |> first,
|
||||||
|
width = sdf.width |> first,
|
||||||
|
riseup = sdf.riseup |> first,
|
||||||
|
)
|
||||||
else
|
else
|
||||||
if sdf.psbid[1] == 291
|
if sdf.psbid[1] == 291
|
||||||
df = filter(:runid => ==(94), sdf)
|
df = filter(:runid => ==(94), sdf)
|
||||||
@assert nrow(df) == 1
|
@assert nrow(df) == 1
|
||||||
(skew = df.skew |> first, width = sdf.width |> first)
|
(
|
||||||
|
skew = df.skew |> first,
|
||||||
|
width = sdf.width |> first,
|
||||||
|
riseup = sdf.riseup |> first,
|
||||||
|
)
|
||||||
elseif sdf.psbid[1] == 460
|
elseif sdf.psbid[1] == 460
|
||||||
df = filter(:runid => ==(132), sdf)
|
df = filter(:runid => ==(132), sdf)
|
||||||
@assert nrow(df) == 1
|
@assert nrow(df) == 1
|
||||||
(skew = df.skew |> first, width = sdf.width |> first)
|
(
|
||||||
|
skew = df.skew |> first,
|
||||||
|
width = sdf.width |> first,
|
||||||
|
riseup = sdf.riseup |> first,
|
||||||
|
)
|
||||||
elseif sdf.psbid[1] == 545
|
elseif sdf.psbid[1] == 545
|
||||||
@error "temp"
|
@error "temp"
|
||||||
df = filter(:runid => ==(132), sdf)
|
df = filter(:runid => ==(132), sdf)
|
||||||
@assert nrow(df) == 1
|
@assert nrow(df) == 1
|
||||||
(skew = df.skew |> first, width = sdf.width |> first)
|
(
|
||||||
|
skew = df.skew |> first,
|
||||||
|
width = sdf.width |> first,
|
||||||
|
riseup = sdf.riseup |> first,
|
||||||
|
)
|
||||||
else
|
else
|
||||||
# assume that runid is chronological
|
# assume that runid is chronological
|
||||||
i = argmax(sdf.runid .|> (id -> ismissing(id) ? -1 : id))
|
i = argmax(sdf.runid .|> (id -> ismissing(id) ? -1 : id))
|
||||||
(skew = sdf.skew[i], width = sdf.width[i])
|
(skew = sdf.skew[i], width = sdf.width[i], riseup = sdf.riseup[i])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -391,9 +417,20 @@ let
|
||||||
fig
|
fig
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# ╔═╡ d92e0f9f-ed53-4ad6-a390-5a395e8ab8bc
|
||||||
|
md"""
|
||||||
|
#### 異常に小さい値 (psbid: 444)
|
||||||
|
- 出荷済み
|
||||||
|
"""
|
||||||
|
|
||||||
# ╔═╡ e9964184-1a2a-4ab9-bc22-2705a25393ec
|
# ╔═╡ e9964184-1a2a-4ab9-bc22-2705a25393ec
|
||||||
filter(:skew => (x -> !ismissing(x) && x < -3), df_skews_selected)
|
filter(:skew => (x -> !ismissing(x) && x < -3), df_skews_selected)
|
||||||
|
|
||||||
|
# ╔═╡ bedf8dff-e109-4757-82e5-3232fcad752d
|
||||||
|
md"""
|
||||||
|
#### 欠損値(psbid: 255)
|
||||||
|
"""
|
||||||
|
|
||||||
# ╔═╡ f2d0ea9b-ede7-496a-8d1f-9f748f9d1666
|
# ╔═╡ f2d0ea9b-ede7-496a-8d1f-9f748f9d1666
|
||||||
transform(
|
transform(
|
||||||
filter(:skew => ismissing, df_skews_selected),
|
filter(:skew => ismissing, df_skews_selected),
|
||||||
|
@ -408,6 +445,21 @@ md"""
|
||||||
- Si not locked
|
- Si not locked
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# ╔═╡ 106b8abe-0040-48f1-b663-c00ca7673520
|
||||||
|
filter(:riseup => !=(1), df_skews_selected)
|
||||||
|
|
||||||
|
# ╔═╡ a06d16ee-a4be-40de-8dac-fd818754373c
|
||||||
|
md"""
|
||||||
|
#### 立ち上がりが複数回(psbid: 255, 435, 444, 460)
|
||||||
|
skew結果として使った測定について、立ち上がり回数が1ではないもののリスト
|
||||||
|
##### psbid: 435
|
||||||
|
- 立ち上がり後途中で何故か0が入ってる
|
||||||
|
- 出荷済み
|
||||||
|
"""
|
||||||
|
|
||||||
|
# ╔═╡ 4d809d8c-35d5-44b9-89b9-a43dbc8e6206
|
||||||
|
PSBoardDataBase.ClockParser.count_riseup("../test/input/slavelogs/main/436_103_clk.txt")
|
||||||
|
|
||||||
# ╔═╡ 9f3f780d-da6e-44b4-a002-c2f088681e9c
|
# ╔═╡ 9f3f780d-da6e-44b4-a002-c2f088681e9c
|
||||||
df_skews_selected_sorted = let
|
df_skews_selected_sorted = let
|
||||||
df = sort(df_skews_selected, :skew)
|
df = sort(df_skews_selected, :skew)
|
||||||
|
@ -433,17 +485,13 @@ let
|
||||||
id_rand_typical = rand(rng, 1:nrow(df_typical))
|
id_rand_typical = rand(rng, 1:nrow(df_typical))
|
||||||
first(df_normal).psbid, last(df_normal).psbid, df_typical[id_rand_typical, :psbid]
|
first(df_normal).psbid, last(df_normal).psbid, df_typical[id_rand_typical, :psbid]
|
||||||
end
|
end
|
||||||
psbid_with_lines = [
|
psbid_with_lines = [psbid_width_max, psbid_width_min, psbid_width_typical]
|
||||||
psbid_width_max,
|
|
||||||
psbid_width_min,
|
|
||||||
psbid_width_typical,
|
|
||||||
]
|
|
||||||
|
|
||||||
fig = Figure()
|
fig = Figure()
|
||||||
ax = Axis(
|
ax = Axis(
|
||||||
fig[1, 1],
|
fig[1, 1],
|
||||||
title = "clock turn on curves",
|
title = "clock turn on curves",
|
||||||
subtitle = "aligned on the last count = 0 points",
|
subtitle = "aligned on the last count = 0 points",
|
||||||
xlabel = "ns",
|
xlabel = "ns",
|
||||||
ylabel = "counts",
|
ylabel = "counts",
|
||||||
limits = ((-0.05, 0.15), (0, 1000)),
|
limits = ((-0.05, 0.15), (0, 1000)),
|
||||||
|
@ -473,33 +521,31 @@ let
|
||||||
# df = filter(:psbid => ==(psbid), df_skews_selected_sorted)
|
# df = filter(:psbid => ==(psbid), df_skews_selected_sorted)
|
||||||
# @assert nrow(df) == 1 "nrow: $(nrow(df)), psbid: $(psbid)"
|
# @assert nrow(df) == 1 "nrow: $(nrow(df)), psbid: $(psbid)"
|
||||||
# df.skew[1] +
|
# df.skew[1] +
|
||||||
qaqc_positions.rising_ns[single_runs.position[1]]
|
qaqc_positions.rising_ns[single_runs.position[1]]
|
||||||
end
|
end
|
||||||
if psbid in psbid_with_lines
|
if psbid in psbid_with_lines
|
||||||
points =
|
points =
|
||||||
eachline(file) .|>
|
eachline(file) .|>
|
||||||
PSBoardDataBase.ClockParser._parse_line .|>
|
PSBoardDataBase.ClockParser._parse_line .|>
|
||||||
(x -> (x[1] - offset_pos, x[2]))
|
(x -> (x[1] - offset_pos, x[2]))
|
||||||
id_first_over0 = findfirst(points) do ((time, count))
|
id_first_over0 = findfirst(points) do ((time, count))
|
||||||
count > 0
|
count > 0
|
||||||
end
|
end
|
||||||
@info "" points[id_first_over0] points[id_first_over0 - 1]
|
points = map(points) do ((time, count))
|
||||||
points = map(points) do ((time, count))
|
time - points[id_first_over0][1], count
|
||||||
time - points[id_first_over0][1], count
|
end
|
||||||
end
|
stds = map(points) do ((time, count))
|
||||||
stds = map(points) do ((time, count))
|
sqrt(count * (1000 - count) / 1000)
|
||||||
sqrt(count * (1000 - count) / 1000)
|
end
|
||||||
end
|
|
||||||
label, color = if psbid == psbid_width_max
|
label, color = if psbid == psbid_width_max
|
||||||
"lomgest ($psbid)", (:red, 0.8)
|
"lomgest ($psbid)", (:red, 0.8)
|
||||||
elseif psbid == psbid_width_min
|
elseif psbid == psbid_width_min
|
||||||
"shortest ($psbid)", (:blue, 0.8)
|
"shortest ($psbid)", (:blue, 0.8)
|
||||||
elseif psbid == psbid_width_typical
|
elseif psbid == psbid_width_typical
|
||||||
"typical ($psbid)", (:green, 0.8)
|
"typical ($psbid)", (:green, 0.8)
|
||||||
end
|
end
|
||||||
scatterlines!(ax, points, label = label, color = color)
|
scatterlines!(ax, points, label = label, color = color)
|
||||||
@info "" first.(points) stds
|
errorbars!(ax, points, stds, whiskerwidth = 10, color = color)
|
||||||
errorbars!(ax, points, stds, whiskerwidth = 10, color = color)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
axislegend(ax, position = :rb)
|
axislegend(ax, position = :rb)
|
||||||
|
@ -537,6 +583,7 @@ end
|
||||||
# ╠═420dce0e-4757-48d9-84ec-7ddfac2fdff6
|
# ╠═420dce0e-4757-48d9-84ec-7ddfac2fdff6
|
||||||
# ╠═99902640-fee3-4502-9c7e-cb08834bad0b
|
# ╠═99902640-fee3-4502-9c7e-cb08834bad0b
|
||||||
# ╠═c79c6684-1b03-41b5-aa90-ef8c7a8eb69c
|
# ╠═c79c6684-1b03-41b5-aa90-ef8c7a8eb69c
|
||||||
|
# ╠═875bec26-e576-4f48-ba14-464bce503d75
|
||||||
# ╟─ec774495-c0be-47a4-9d2c-b48159c07013
|
# ╟─ec774495-c0be-47a4-9d2c-b48159c07013
|
||||||
# ╠═d082e07c-3b42-4362-bebf-63356979a49b
|
# ╠═d082e07c-3b42-4362-bebf-63356979a49b
|
||||||
# ╠═25688d24-5aee-43d3-aff9-b9efa0556070
|
# ╠═25688d24-5aee-43d3-aff9-b9efa0556070
|
||||||
|
@ -553,9 +600,14 @@ end
|
||||||
# ╟─26976b6c-3954-4a41-a99b-c1aaebdc645d
|
# ╟─26976b6c-3954-4a41-a99b-c1aaebdc645d
|
||||||
# ╠═38d472ca-6347-4096-828d-fd1256130a59
|
# ╠═38d472ca-6347-4096-828d-fd1256130a59
|
||||||
# ╠═310710da-ebb2-4f54-b238-38d493a6a533
|
# ╠═310710da-ebb2-4f54-b238-38d493a6a533
|
||||||
|
# ╟─d92e0f9f-ed53-4ad6-a390-5a395e8ab8bc
|
||||||
# ╠═e9964184-1a2a-4ab9-bc22-2705a25393ec
|
# ╠═e9964184-1a2a-4ab9-bc22-2705a25393ec
|
||||||
|
# ╟─bedf8dff-e109-4757-82e5-3232fcad752d
|
||||||
# ╠═f2d0ea9b-ede7-496a-8d1f-9f748f9d1666
|
# ╠═f2d0ea9b-ede7-496a-8d1f-9f748f9d1666
|
||||||
# ╠═f5bc8b1a-3fee-48ed-9910-367a1cda632e
|
# ╠═f5bc8b1a-3fee-48ed-9910-367a1cda632e
|
||||||
|
# ╠═106b8abe-0040-48f1-b663-c00ca7673520
|
||||||
|
# ╠═a06d16ee-a4be-40de-8dac-fd818754373c
|
||||||
|
# ╠═4d809d8c-35d5-44b9-89b9-a43dbc8e6206
|
||||||
# ╠═9f3f780d-da6e-44b4-a002-c2f088681e9c
|
# ╠═9f3f780d-da6e-44b4-a002-c2f088681e9c
|
||||||
# ╠═6c3c7669-d594-425d-bf05-9aa217c7656e
|
# ╠═6c3c7669-d594-425d-bf05-9aa217c7656e
|
||||||
# ╠═e9b3f541-d87d-4424-8b82-be1b7b3273d8
|
# ╠═e9b3f541-d87d-4424-8b82-be1b7b3273d8
|
||||||
|
|
Loading…
Add table
Reference in a new issue