Skip to content

v0.29.0 - Boundary Search Script (2026-06-28)

What Changed?

This release adds get_boundary.py, a new example script for searching the DAC threshold boundary where noise hits appear with the board switch (SW) OFF. The script sweeps threshold values for each channel sequentially and stops as soon as a hit/no-hit transition is detected.


What's New

Main Feature: get_boundary.py

What it does: Finds the threshold value where detector noise hits transition across the boundary, with the scintillator switch (SW) in the OFF state. Channels are scanned sequentially (ch1 → ch2 → ch3); other channels are masked with 1000.

Scan directions:

Mode Direction Detects
Default Ascending (low→high) >0→0 transition (hits disappear)
--reversed Descending (high→low) 0→>0 transition (hits appear)

How to use it:

# Ascending scan (default): start at 300, step up
uv run examples/get_boundary.py "1:300;2:300;3:300" 5 --use-sec

# Descending scan: start at 600, step down
uv run examples/get_boundary.py "1:600;2:600;3:600" 5 --use-sec --reversed

# Custom step range
uv run examples/get_boundary.py "1:300;2:300;3:300" 10 --nsteps 20 --step-size 2

Output:

  • Per-step JSONL event files (same format as get_events.py)
  • boundary_scanned.jsonl: one record per measured step
  • Final boundary result printed to stdout as a single JSON line:
{"type": "boundary_result", "mac_address": "...", "boundary1": 320, "boundary2": 315, "boundary3": 318}

null means no transition was found within the scan range.


Installation

Quick Start

git checkout 0.29.0
task env:setup
uv run kazunoko --help

What's Different from the Last Version?

✅ Added

  • get_boundary.py: new boundary search script
  • --reversed/--no-reversed option for scan direction
  • Early stop on boundary detection (moves to next channel immediately)
  • Boundary result output to stdout as JSON

Is It Safe to Upgrade?

Backward Compatible: Yes — no changes to existing library or CLI.


Tests Passed

  • ✅ Builds without errors
  • uv run get_boundary.py "1:600;2:600;3:600" 3 --mock --reversed detects boundary and stops early
  • ✅ Boundary step recorded in boundary_scanned.jsonl

Release Details

  • Date: 2026-06-28
  • Version: v0.29.0
  • Files Changed: 1 (get_boundary.py)

Next Steps

  • Analyze boundary_scanned.jsonl to pinpoint the exact boundary threshold
  • Use the boundary values as starting points for get_thresholds.py