50 lines
915 B
Awk
50 lines
915 B
Awk
|
|
#!/usr/bin/awk -f
|
||
|
|
|
||
|
|
@include "RPi.awk"
|
||
|
|
|
||
|
|
BEGIN {
|
||
|
|
pmin = 900
|
||
|
|
pmax = 1100
|
||
|
|
resp = 1
|
||
|
|
|
||
|
|
minp = 10000
|
||
|
|
maxp = 0
|
||
|
|
|
||
|
|
muonthr = 4
|
||
|
|
maxt = 60
|
||
|
|
}
|
||
|
|
|
||
|
|
isH(){}
|
||
|
|
|
||
|
|
isP() {
|
||
|
|
t = Time - pTime;
|
||
|
|
pTime = Time
|
||
|
|
if (p && t>0) {
|
||
|
|
if (t>maxt) t = maxt;
|
||
|
|
Np[p] += t;
|
||
|
|
}
|
||
|
|
if (Pressure < pmax && Pressure > pmin) {
|
||
|
|
p = int(Pressure/resp)
|
||
|
|
if (p<minp) minp = p
|
||
|
|
if (p>maxp) maxp = p
|
||
|
|
} else {
|
||
|
|
p = 0
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
p && isE() {
|
||
|
|
t = Time - pTime;
|
||
|
|
if (t<0 || t>maxt) next;
|
||
|
|
if (A[0] < muonthr && A[3] < muonthr) next;
|
||
|
|
if (A[1] >= muonthr) R1[p] += 1
|
||
|
|
if (A[2] >= muonthr) R2[p] += 1
|
||
|
|
}
|
||
|
|
|
||
|
|
END {
|
||
|
|
for (p=minp; p<=maxp; p++) {
|
||
|
|
pr = (p+0.5)*resp
|
||
|
|
N = Np[p]+0
|
||
|
|
if (N) printf "%.1f %g %g %g %g\n", pr, R1[p]/N, sqrt(R1[p]+1)/N, R2[p]/N, sqrt(R2[p]+1)/N
|
||
|
|
else printf "%.1f 0 0 0 0\n", pr
|
||
|
|
}
|
||
|
|
}
|