Node Inspector (DB)

← Dashboard

README.md · last modified 2026-05-15 17:36

Node Inspector App

Interactive sound data visualization tool that displays time-frequency cochleograms from the sa_node_day lite server (default), optional PostgreSQL historical data, or live Munisense portal data.

Standalone version of the original report_pipeline_2026/apps/node_inspector_db_app/, using sa_project_store for project configuration instead of src.sa_config.

Quick Start

./run_node_inspector.sh

Then open http://localhost:5011 in your browser.

The launch script automatically kills any existing process on port 5011.

Features

Requirements

Python Dependencies

pip install bokeh holoviews datashader numpy pytz xarray matplotlib zstandard
pip install -e ~/SA_projects/sa_libs/sa_project_store
pip install -e ~/SA_projects/sa_libs/sa_node_day

Optional for data_source = "db":

pip install psycopg2-binary

Configuration

app_config.toml

Local settings not provided by sa_project_store:

Per-project overrides are supported:

[project_overrides.gilze-rijen]
offset_hours = 0

Project definitions

Projects are loaded from sa_projects_vps0 via sa_project_store.ProjectStore. Only projects with active locations (those having a location_id) are shown. To add or modify projects, edit the corresponding project.toml in sa_projects_vps0/projects/<name>/.

Architecture

node_inspector_app/
├── main.py                  # Bokeh application entry point
├── config.py                # Configuration via sa_project_store + app_config.toml
├── app_config.toml          # Local settings (DB, paths, defaults)
├── run_node_inspector.sh    # Launch script (auto-kills stale process)
├── data/
│   ├── retrieval.py         # Data fetching (lite server / DB + portal), filtered to needed characteristics
│   ├── processing.py        # DataProcessor class
│   ├── audio_clips.py       # MP3 clip storage and annotation
│   └── audio_downloader_bridge.py  # Background clip downloads
├── ui/
│   └── date_picker.py       # Calendar widget
├── plotting/
│   └── overlays.py          # Click handlers and line overlays
├── utils/
│   └── helpers.py           # Utility functions
├── datashaded_images.py     # HoloViews/datashader visualization
├── sa_fetcher_tools.py      # Munisense API utilities
└── retrieved_data/          # DB-only interpreted cache directory

Differences from original

Caching

When data_source = "lite", historical fetches use the shared sa_node_day cache at ~/.cache/sa_node_day, so notebooks, scripts, and the inspector app all reuse the same local cache. The "Clear Cache" button clears that shared cache.

When data_source = "db", processed day data is cached in retrieved_data/ as compressed pickle files (.interpreted.pkl.zst). The same UI button clears that DB-only interpreted cache.

Troubleshooting

Session token expired

Refresh the browser page (Cmd+R).

No data for date

Check that:
1. If data_source = "lite", the server_url endpoint is reachable
2. If data_source = "db", the PostgreSQL instance is running on localhost:5433
4. Data exists for the selected node and date
5. The portal credentials in login_info.config are valid

Project not showing

The project must have at least one location with a location_id in its project.toml. Check sa_projects_vps0/projects/<name>/project.toml.