Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d816073
add daqbox test script
settwi Jan 15, 2026
65f097b
fixed bugs
DorcasDee Jan 26, 2026
6bba6bd
added modes, removed terminal commands
DorcasDee Jan 26, 2026
561ff34
adding the json file
DorcasDee Jan 26, 2026
d754838
added UDP communications
DorcasDee Jan 29, 2026
c016452
to receive command from controller
DorcasDee Jan 29, 2026
1912c1d
to send command
DorcasDee Jan 29, 2026
d90df0f
limited modes, added data dump via UDP
DorcasDee Feb 3, 2026
e401710
question
DorcasDee Feb 3, 2026
2f8e6d8
for debug or lab purpose
DorcasDee Feb 3, 2026
ed00238
for science commands
DorcasDee Feb 3, 2026
6ffb69f
send via data via udp
DorcasDee Feb 3, 2026
3a53217
default json file
DorcasDee Feb 3, 2026
b719d2c
send data to udpcapture
DorcasDee Feb 3, 2026
89d8189
Science quicklook init
masek014 Feb 10, 2026
32308d9
Stop tracking file but retain locally
DorcasDee Feb 10, 2026
113b9d2
updated and working
DorcasDee Feb 11, 2026
f408f59
setting up science and quiclook capture
DorcasDee Feb 11, 2026
ddba92b
Merge remote-tracking branch 'origin/main' into daqbox-dev
DorcasDee Feb 11, 2026
5b2c6b6
added science ports
DorcasDee Feb 11, 2026
ca51b05
setting up science udpcapture
DorcasDee Feb 12, 2026
81a5c6f
updating the ports
DorcasDee Feb 17, 2026
77d7f4e
clean up deployment/services
DorcasDee Feb 18, 2026
c39e0ca
remove system science: conflicts w science udpcapture
DorcasDee Feb 18, 2026
7c716d4
Merge pull request #36 from umn-impish/main
settwi Feb 18, 2026
4cbaf00
Merge pull request #41 from umn-impish/main
settwi Feb 22, 2026
1be702e
set up multiprocessing and multichannels data parsing
DorcasDee Feb 26, 2026
eb8b80d
Merge main and resolve deployment conflicts
DorcasDee Feb 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deployment/script_names.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ set_bias
set_pps
set_rtc_time
start_health_udpcapture
start_science_udpcapture
toggle_power
4 changes: 3 additions & 1 deletion deployment/service_names.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
gpio-init.service
gpiomem-group.service
system-health.service
health-udpcapture.service
quicklook-udpcapture.service
science-udpcapture.service
system-health.service
13 changes: 12 additions & 1 deletion deployment/setup_directories
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
#!/bin/bash

sudo mkdir -p /data/health
sudo chmod -R 0777 /data
sudo mkdir -p /data/journal
sudo mkdir -p /data/quicklook
sudo mkdir -p /data/science

# Make them editable by anyone
sudo chmod 0777 /data
sudo chmod 0777 /data/health
sudo chmod 0777 /data/journal
sudo chmod 0777 /data/quicklook
sudo chmod 0777 /data/science
62 changes: 62 additions & 0 deletions impisc/packets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,68 @@
import ctypes


class QuicklookPacket(ctypes.LittleEndianStructure):
"""
"""

# Do not include padding bytes
_pack_ = 1

_fields_ = [
("unix_timestamp", ctypes.c_uint32),
("det1_ebin1", ctypes.c_uint8),
("det1_ebin1_counts", ctypes.c_uint16),
("det1_ebin1_cps", ctypes.c_uint16),
("det1_ebin2", ctypes.c_uint8),
("det1_ebin2_counts", ctypes.c_uint16),
("det1_ebin2_cps", ctypes.c_uint16),
("det1_ebin3", ctypes.c_uint8),
("det1_ebin3_counts", ctypes.c_uint16),
("det1_ebin3_cps", ctypes.c_uint16),
("det1_ebin4", ctypes.c_uint8),
("det1_ebin4_counts", ctypes.c_uint16),
("det1_ebin4_cps", ctypes.c_uint16),

("det2_ebin1", ctypes.c_uint8),
("det2_ebin1_counts", ctypes.c_uint16),
("det2_ebin1_cps", ctypes.c_uint16),
("det2_ebin2", ctypes.c_uint8),
("det2_ebin2_counts", ctypes.c_uint16),
("det2_ebin2_cps", ctypes.c_uint16),
("det2_ebin3", ctypes.c_uint8),
("det2_ebin3_counts", ctypes.c_uint16),
("det2_ebin3_cps", ctypes.c_uint16),
("det2_ebin4", ctypes.c_uint8),
("det2_ebin4_counts", ctypes.c_uint16),
("det2_ebin4_cps", ctypes.c_uint16),

("det3_ebin1", ctypes.c_uint8),
("det3_ebin1_counts", ctypes.c_uint16),
("det3_ebin1_cps", ctypes.c_uint16),
("det3_ebin2", ctypes.c_uint8),
("det3_ebin2_counts", ctypes.c_uint16),
("det3_ebin2_cps", ctypes.c_uint16),
("det3_ebin3", ctypes.c_uint8),
("det3_ebin3_counts", ctypes.c_uint16),
("det3_ebin3_cps", ctypes.c_uint16),
("det3_ebin4", ctypes.c_uint8),
("det3_ebin4_counts", ctypes.c_uint16),
("det3_ebin4_cps", ctypes.c_uint16),

("det4_ebin1", ctypes.c_uint8),
("det4_ebin1_counts", ctypes.c_uint16),
("det4_ebin1_cps", ctypes.c_uint16),
("det4_ebin2", ctypes.c_uint8),
("det4_ebin2_counts", ctypes.c_uint16),
("det4_ebin2_cps", ctypes.c_uint16),
("det4_ebin3", ctypes.c_uint8),
("det4_ebin3_counts", ctypes.c_uint16),
("det4_ebin3_cps", ctypes.c_uint16),
("det4_ebin4", ctypes.c_uint8),
("det4_ebin4_counts", ctypes.c_uint16),
("det4_ebin4_cps", ctypes.c_uint16),
]

class HealthPacket(ctypes.LittleEndianStructure):
"""
The IMPISH health packet
Expand Down
62 changes: 62 additions & 0 deletions processes/quicklook_monitor
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/python-venv/bin/python

import os
import json
import socket
import logging


from impisc.packets import QuicklookPacket


my_port = int(os.getenv("QUICKLOOK_MONITOR_PORT"))
send_port = int(os.getenv("LOCAL_QUICKLOOK_FWD_PORT"))


def main():
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(("", my_port))

while True:
try:
packet = QuicklookPacket()

data, _ = sock.recvfrom(8192)
msg = json.loads(data.decode())
channel = msg.get("channel")
if channel is None:
logging.warning("Quicklook message missing channel field")
continue

det_fields = {
f"det{channel}_ebin1": "det_ebin1",
f"det{channel}_ebin1_counts": "det_ebin1_counts",
f"det{channel}_ebin1_cps": "det_ebin1_cps",
f"det{channel}_ebin2": "det_ebin2",
f"det{channel}_ebin2_counts": "det_ebin2_counts",
f"det{channel}_ebin2_cps": "det_ebin2_cps",
f"det{channel}_ebin3": "det_ebin3",
f"det{channel}_ebin3_counts": "det_ebin3_counts",
f"det{channel}_ebin3_cps": "det_ebin3_cps",
f"det{channel}_ebin4": "det_ebin4",
f"det{channel}_ebin4_counts": "det_ebin4_counts",
f"det{channel}_ebin4_cps": "det_ebin4_cps",
f"unix_timestamp": "unix_timestamp",
}

for target, field in det_fields.items():
if field in msg:
setattr(packet, target, msg[field])

sock.sendto(bytes(packet), ("localhost", send_port))

except Exception:
logging.exception("Quicklook monitor crashed")


if __name__ == "__main__":
main()


# deadtime includes
# 1. sipm recharge time
6 changes: 6 additions & 0 deletions scripts/start_quicklook_udpcapture
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

source variables.env
udpcapture --port $LOCAL_QUICKLOOK_FWD_PORT --base-filename '/data/quicklook/impish_quicklook' \
--file-lifetime 300 --forward-addrs $GROUNDSTATION_IP\
--post-process-cmd 'xz $out_file'
6 changes: 6 additions & 0 deletions scripts/start_science_udpcapture
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

source variables.env
udpcapture --port $LOCAL_SCIENCE_FWD_PORT --base-filename '/data/science/impish_science' \
--file-lifetime 300 -f 127.0.0.1:12346\
--post-process-cmd 'xz $out_file'
25 changes: 25 additions & 0 deletions scripts/tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
quicklook_recv.py
waveform_config.json
udp_receivedata.py
spectrum_config.json
notes.txt
impish_logs/
impisc_patch/
daq_control_cont.py
config/waveform_config.json
cmd_listener.py
test_daq_control.py
config/active.json
daq_control_test.py
daq_control_thread.py
udp_sender_test.py
protocol.py
send_cmd_shutdown.py
udp_receivedata_test.py
udp_sender_test.py
processes/quicklook_monitor_t.py
daq_control_test1.py
quicklook_accum.py
quicklook_accum1.py
udp_receive_test.py
udp_sender_thread.py
22 changes: 22 additions & 0 deletions scripts/tests/config/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"global": {
"enabled": 1,
"thresholds": [100, 50, 50, 50],
"polarities": 0,
"enable_pileup_rejection": false,
"integration_window": 74,
"zoom_division": 4,
"pileup_integration_time": 20
},

"modes": {
"spectrum": {
"acquisition_mode": "spectrum"
},
"waveform": {
"acquisition_mode": "waveform"
}
},

"startup_mode": "safe"
}
Loading