added more raw files

This commit is contained in:
froejdh_e
2025-04-14 16:15:43 +02:00
parent a564862aa5
commit b7d5704f58
5 changed files with 126 additions and 0 deletions

View File

@ -0,0 +1,40 @@
from pathlib import Path
header_size = 112
frame_size = 400**2*2
n_frames = 1000
# base = Path('/mnt/sls_det_storage/matterhorn_data/aare_test_data/')
# f = File(base/'Moench03new/cu_half_speed_master_4.json')
findex = 4
for base_name in ['cu_half_speed',]:
src = Path(f'/mnt/sls_det_storage/matterhorn_data/aare_test_data/Moench03new/{base_name}_d0_f0_{findex}.raw')
dst = Path('/home/l_msdetect/erik/data/aare-test-data/raw/moench03')/src.name
print(f'src: {src}')
print(f'dst: {dst}')
# Copy data
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
for i in range(n_frames):
data = fsrc.read(header_size+frame_size)
fdst.write(data)
# Copy master file and rewrite the number of frames in the file
msrc = src.parent/f'{base_name}_master_{findex}.json'
mdst = dst.parent/f'{base_name}_master_{findex}.json'
print(f'msrc: {msrc}')
print(f'mdst: {mdst}')
with open(msrc) as m_fsrc, open(mdst, 'w') as m_fdst:
for line in m_fsrc:
if "Total Frames" in line:
line = f'\t"Total Frames": {n_frames},\n'
if "Frames in File" in line:
line = f'\t"Frames in File": {n_frames},\n'
m_fdst.write(line)

Binary file not shown.

View File

@ -0,0 +1,48 @@
{
"Version": 7.1,
"Timestamp": "Fri Jul 14 15:29:01 2023",
"Detector Type": "Moench",
"Timing Mode": "auto",
"Geometry": {
"x": 1,
"y": 1
},
"Image Size in bytes": 320000,
"Pixels": {
"x": 400,
"y": 400
},
"Max Frames Per File": 10000,
"Frame Discard Policy": "discardpartial",
"Frame Padding": 1,
"Scan Parameters": "[disabled]",
"Total Frames": 1000,
"Receiver Roi": {
"xmin": 4294967295,
"xmax": 4294967295,
"ymin": 4294967295,
"ymax": 4294967295
},
"Exptime": "1ms",
"Period": "600us",
"Number of UDP Interfaces": 1,
"Number of rows": 400,
"Additional Json Header": "{detectorMode: counting, frameMode: frame}",
"Frames in File": 1000,
"Frame Header Format": {
"Frame Number": "8 bytes",
"SubFrame Number/ExpLength": "4 bytes",
"Packet Number": "4 bytes",
"Bunch ID": "8 bytes",
"Timestamp": "8 bytes",
"Module Id": "2 bytes",
"Row": "2 bytes",
"Column": "2 bytes",
"Reserved": "2 bytes",
"Debug": "4 bytes",
"Round Robin Number": "2 bytes",
"Detector Type": "1 byte",
"Header Version": "1 byte",
"Packets Caught Mask": "64 bytes"
}
}