Compare commits

...

2 commits

Author SHA1 Message Date
Stephan I. Böttcher
d7d69de548 dorn_hk: script to parse datafiles using dorn.hk() 2025-06-18 07:27:49 +02:00
Stephan I. Böttcher
149fde3ebd AHEPAM.awk: doHIST for 48 channels 2025-06-18 07:26:39 +02:00
2 changed files with 44 additions and 5 deletions

View file

@ -262,15 +262,16 @@ function doHIST(Ch, x) {
}
BEGIN {
NCh=12
for (i=0; i<NCh; i++) name[i] = substr("CBAFEDIHGLKJ",i+1,1)
NDCh = 24
NCh = 48
for (i=0; i<NCh; i++) name[i] = int(i/24) substr("ABCDEFGH",i%8+1,1) (int(i/8)%3)
minV=-100
maxV=5000
resV=0.25
# AHEPAM BGO slice 1 only:
NCh = 24
NDCh = 0
for (i=0; i<NCh; i++) name[i] = "1:" i
#NCh = 24
#NDCh = 0
#for (i=0; i<NCh; i++) name[i] = "1:" i
}
function print_HIST(fn) {

38
dorn_hk.py Executable file
View file

@ -0,0 +1,38 @@
#! /usr/bin/python3
import dorn
import sys, getopt
oo,ff = getopt.getopt(sys.argv[1:], "saw:n:c:",
["seth", "ahbgo", "what=", "slice=", "channels="])
what="print"
sl = None
ch = list(range(7))
for o,v in oo:
if o=="-s" or o=="--seth":
dorn.CONFIG.seth()
if o=="-a" or o=="--ahbgo":
dorn.CONFIG.ahbgo()
if o=="-w" or o=="--what":
what = v
if o=="-n" or o=="--slice":
sl = int(v)
if o=="-c" or o=="--channels":
ch = list(map(int, v.split(",")))
T = 0
for fn in ff:
with open(fn) as f:
for l in f:
if l[:2] == "H ":
T = int(l.split()[1])
continue
if not T:
continue
h = dorn.hk(sl, what=what, data=l)
if not h:
continue
for c in ch:
print(T, c, h[c])