Skip to content

kazunoko threshold THRESHOLDS

Configure detection threshold values for the OSECHI detector.


Basic Usage

kazunoko threshold "1:300;2:360;3:330"

Threshold String Format

CHANNEL:VALUE;CHANNEL:VALUE;...
  • CHANNEL: Channel number (1, 2, or 3)
  • VALUE: Threshold value in DAC units (integer)
  • Channels are separated by semicolons (;)

Set only specific channels — the device retains the previous values for any channel you omit:

kazunoko threshold "1:300;3:330"

What is a threshold?

The threshold is the minimum signal level (in DAC units) required to register a detection event on a channel. Only signals above the threshold are counted.

  • Lower threshold: more sensitive — more events detected, including noise
  • Higher threshold: less sensitive — noise suppressed, only stronger signals counted
  • Typical range: 270–330 DAC units per channel

Each channel has an independent threshold. The optimal value varies between units and may shift with temperature. See First Threshold Measurement for how to find the optimal threshold for your detector.


CLI Options

Option Short Default Description
--port -p auto Serial port, or auto for auto-detection
--timeout -t 0.1 Serial communication timeout in seconds
--verbose / --quiet -v / -q --quiet Show or suppress status messages
--format -f jsonl Output format: jsonl, table, json, csv, ssv, tsv, ltsv
--use-flat / --use-raw --use-flat Use flattened or raw field names
--mock off Use mock device (no hardware needed)

Output

{"type": "response", "status": "ok", "threshold1": 300, "threshold2": 360, "threshold3": 330}
  • type: always "response" for configuration commands
  • status: "ok" on success, "error" on failure
  • threshold1, threshold2, threshold3: the values that were set

Usage Examples

Set thresholds and collect events

kazunoko measure sets thresholds and collects events in one command:

kazunoko measure "1:300;2:360;3:330" 1000 > data.jsonl

Use threshold + read when you want to set thresholds once and run multiple collections without repeating them:

# Set thresholds once
kazunoko threshold "1:300;2:360;3:330"

# Collect events multiple times
kazunoko read 1000 > run1.jsonl
kazunoko read 1000 > run2.jsonl

Specify serial port

kazunoko threshold "1:300;2:360;3:330" --port /dev/ttyUSB0

Test without hardware

kazunoko threshold "1:300;2:360;3:330" --mock