{% macro kv(rows) -%} {% for key, value in rows %}{% endfor %}
{{ key }}{{ value }}
{%- endmacro %} {% macro det_row(r) -%} {% set meteor = ' meteor' if r.get('label') == 'meteor' else '' %} {% set state = display_label(r.get('label')) %} {% set local = seg_local(r.source) %} {% if r.get('stack') %}{% else %}no preview{% endif %} {{ r.local_time[11:] }}{{ r.local_time[:10] }}{{ state }} Duration{{ num(r, 'duration_s', '.2f') }} s Direction{{ r.get('dir_short') or '–' }} Brightness{{ num(r, 'peak', '.0f') }} › {%- endmacro %} {% macro top_block(r, crit='peak') -%} {% set crit_map = {'peak': ('Brightest', 'peak', '.0f', ''), 'span': ('Longest', 'span_px', '.0f', ' px'), 'speed': ('Fastest', 'speed_px_s', '.0f', ' px/s'), 'duration': ('Longest duration', 'duration_s', '.2f', ' s')} %} {% set c = crit_map.get(crit, crit_map['peak']) %} {% set local = seg_local(r.source) %}
{% if r.get('stack') %}{% else %}no preview{% endif %} {{ r.local_time[11:] }}{{ r.local_time[:10] }}{{ c[0] }} {{ c[0] }}{{ num(r, c[1], c[2]) }}{{ c[3] }} Brightness{{ num(r, 'peak', '.0f') }} Length{{ num(r, 'span_px', '.0f') }} px ›
Source: {{ r.source }}{% if local %} ({{ local }} local){% endif %}{% if r.get('dir_short') %} · {{ r.dir_short }}{% endif %}
{%- endmacro %} {% macro gallery_card(r, labels_map) -%} {% set eid = event_id(r) %} {% set cur = labels_map.get(eid, {}).get('label', '') %} {% set suspect = r.get('suspect') %} {% set cluster = r.get('cluster') %} {% set alt = (label_names.get(cur) or 'Detection') ~ ' at ' ~ r.local_time %}
{% if r.get('stack') %} {% if r.get('clip') %}{{ alt }}{% else %}{{ alt }}{% endif %} {% else %}
no preview
{% endif %}
{{ r.local_time[11:] }} · {{ num(r, 'speed_px_s') }} px/s · {{ num(r, 'duration_s', '.2f') }} s · brightness {{ num(r, 'peak') }}{% if r.get('dir_short') %} · {{ r.dir_short }}{% endif %}{% if suspect %} · {{ suspect }}{% endif %}
{{ label_names.get(cur, cur or 'unlabelled') }} {% if cluster %}{% endif %}
{%- endmacro %} {% macro setting_group(name, behavior, fields, snap) -%}

{{ name }}

{% if behavior %}

⚠ Changes detection behaviour. After a change run pytest tests -q and meteorlens file CLIP -v --dry (see CONTRIBUTING.md).

{% endif %}
{% for f in fields %} {% set key = f.sec ~ '/' ~ f.key %} {% set fid = 'set-' ~ f.sec ~ '-' ~ f.key %} {% set val = snap.get(key, '') %}
{% if f.typ == 'bool' %} {% elif f.typ == 'choice' %} {% else %} {% endif %} {{ key }}{% if f.get('min') is not none or f.get('max') is not none %} · {{ f.get('min', '–') }}–{{ f.get('max', '–') }}{% endif %}{% if f.get('restart') == 'serve' %} · restart serve{% elif f.get('restart') == 'record' %} · on next recording{% endif %}
{% endfor %}
{%- endmacro %}