load_data

Load and preprocess multi-epoch GONet observation data from JSON files.

This module provides functionality for aggregating and flattening GONet nightly observation data into a single dictionary suitable for dashboard visualization and analysis. Each JSON file in the folder specified by env.DASHBOARD_DATA_PATH is expected to contain structured nightly data in the GONet format.

Key features

  • Parses and validates nightly GONet JSON files

  • Flattens metadata and multi-channel metrics into a unified structure

  • Dynamically generates feature labels for dashboard dropdowns

  • Computes channel ratios and localized time features

  • Handles data format mismatches and missing fields gracefully

Notes

  • Time features are computed in UTC and localized form.

  • Derived channel ratios (e.g., ‘blue-green’) are included in the output.

  • Labels for dashboard dropdowns are dynamically assigned in env.LABELS.

Functions:

GONet_Wizard.GONet_dashboard.src.hood.load_data.load_data_from_json(env)[source]

Load and prepare all available GONet data from JSON files in the env.DASHBOARD_DATA_PATH folder.

This simplified version assumes that every valid .json file in env.DASHBOARD_DATA_PATH contains nightly observation data in the expected GONet format.

time_unix, float_hours_utc, and float_hours_local are 3 hidden columns that cannot be visualized in the main plot, since are not very human-readable. The purpose of these columns is to provide some numerical values for time and dates, making them more easily filterable.

Parameters:

env (module-like) –

Object with required attributes:

  • env.DASHBOARD_DATA_PATH: pathlib.Path — path to the folder containing JSON files.

  • env.CHANNELS: list of str — e.g., [‘red’, ‘green’, ‘blue’]

  • env.LABELS: dict to be populated with ‘gen’ and ‘fit’ keys.

  • env.LOCAL_TZ: tzinfo object for localizing timestamps.

Returns:

  • data (dict) – Flattened dictionary of all GONet metadata and channel-specific values.

  • options_x (list of dict) – Dropdown options for the x-axis selector.

  • options_y (list of dict) – Dropdown options for the y-axis selector.

Raises:
  • FileNotFoundError – If the directory is empty or contains no valid JSON files.

  • ValueError – If the JSON files are malformed or missing required fields.