XO5DF6WRNO263YCK3X6NMD4E6WIRWBYZBXEH2QULI65LGPAY2PPQC ./skraak import segments --db ./db/skraak.duckdb --dataset abc123 --location loc456 --cluster clust789 --folder /path/to/data --mapping mapping.json
./skraak import segments --db ./db/skraak.duckdb --dataset abc123 --location loc456 --cluster clust789 --folder /path/to/data --mapping mapping.json # requires mapping.json
# Call analysis (extract from ML predictions, review/classify)./skraak calls from-preds --csv predictions.csv # Extract calls, write .data files
# Create .data files./skraak calls from-preds --csv predictions.csv # Extract calls from OPSO, write .data files
./skraak calls show-images --file recording.wav.data # Display spectrograms./skraak calls classify --folder ./data # Interactive classification (reviewer + bindings from ~/.skraak/config.json)./skraak calls classify --folder ./data --filter opensoundscape-kiwi-1.0
# Summarise .data files
**`isnight`** — Night detection for bioacoustic recordings. Determines if a WAV file was recorded at night (between sunset and sunrise) at the given GPS coordinates. The recording timestamp is read from the WAV file metadata, not from the filename — this works reliably because bioacoustic recorders (AudioMoth, BAR-LT, Song Meter, etc.) embed an accurate timestamp in the WAV header at the time of recording. AudioMoth comments are parsed automatically including the embedded UTC offset. For non-AudioMoth files without a recognized filename pattern, the timestamp falls back to the file modification time. Use `--brief` for batch/agent use to return only `file_path` and `solar_night`.
Reproduces OpenSoundScape's `BoxedAnnotations.clip_labels()` outputexactly — same row layout, byte-identical CSVs — but in Go, fast, andwithout round-tripping through Raven `selections.txt`.**Algorithm.** For every `.data` file, generate fixed-duration clipwindows from `[0, Duration]` using OPSO's `generate_clip_times_df`(supports `--final-clip` of `full | remainder | extend | none`). Everywindow is emitted as a row; for each output class column, the value is`True` when at least one cert-100 annotation of that class overlaps thewindow by ≥ `--min-label-overlap` seconds, else `False`. Gaps just emitall-`False` rows.Only certainty=100 labels participate. `mapping.json` (from the`/data-mapping` skill) translates `.data` species strings to canonicalclass names. Two sentinels with distinct semantics:
- **`"__NEGATIVE__"`** — clip IS emitted, **all class columns False**.Overrides any positive labels in the same clip's union. Use forconfirmed-negative training examples (e.g. `Noise`, `Not`, rain, wind,silence, chainsaw, helicopter).- **`"__IGNORE__"`** — the segment is dropped from output. Anysegment whose species maps to `__IGNORE__` triggers the drop, regardlessof filter. Use for files whose annotation set is incomplete: emitting anyclip from them as confirmed-False would poison the training set withpossibly-wrong negatives.
- **`"__NEGATIVE__"`** — segmens IS emitted, **all class columns False**.- **`"__IGNORE__"`** — the segment is not in the dataset.
Override order within a clip: `__NEGATIVE__` beats real classes. (File-level`__IGNORE__` is checked before any clip is generated.)
```{"Kiwi": {"species": "Kiwi"},"Geese": {"species": "__NEGATIVE__"},"Not": {"species": "__NEGATIVE__"},"Don't Know": {"species": "__IGNORE__"}}```
If `--output` exists, the run **appends**. Column-set mismatch with theexisting header → hard error. Duplicate `(file, start_time, end_time)`row (within the run, or vs existing rows) → hard error on firstoccurrence. Any `.data` parse error, missing `Duration`, or speciesmissing from `mapping.json` aborts before any row is written.
If `--output` file already exists, the run **appends** to the file.