From 5b4f3967f7012384cc2c8b7ae4227f492b0a3941 Mon Sep 17 00:00:00 2001 From: Christian Chwala Date: Tue, 31 Mar 2026 20:51:32 +0200 Subject: [PATCH] fix(mno-simulator): set loop_duration to full 3-month dataset - Set loop_duration_seconds to 7948860 (~92 days) so the simulator only restarts after exhausting the entire source dataset instead of looping every hour - Update README: document auto-download behaviour, add actual NETCDF_FILE_URL for standalone use, fix stale loop_duration example --- mno_data_source_simulator/README.md | 25 +++++++++++++++++++++++-- mno_data_source_simulator/config.yml | 6 ++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/mno_data_source_simulator/README.md b/mno_data_source_simulator/README.md index facf1fb..1944630 100644 --- a/mno_data_source_simulator/README.md +++ b/mno_data_source_simulator/README.md @@ -44,7 +44,9 @@ Edit `config.yml` for local/standalone use, or set environment variables for Doc ```yaml data_source: netcdf_file: "/app/example_data/openMRG_cmls_20150827_3months.nc" - loop_duration_seconds: 3600 # Lookback window for real-time replay + # Set to the full dataset duration so the simulator only loops after all + # source data is exhausted (openMRG_cmls_20150827_3months.nc ≈ 92 days). + loop_duration_seconds: 7948860 generator: generation_frequency_seconds: 10 # How often to generate files @@ -61,7 +63,26 @@ sftp: | Variable | Description | |---|---| | `NETCDF_FILE` | Path to the NetCDF source file | -| `NETCDF_FILE_URL` | URL to download the file if not already present | +| `NETCDF_FILE_URL` | URL to download the file automatically if not already present | + +### NetCDF dataset auto-download + +The simulator downloads the 3-month source file automatically on startup if the +path set in `NETCDF_FILE` does not exist **and** `NETCDF_FILE_URL` is set. + +**Docker (`docker-compose up mno_simulator`):** `NETCDF_FILE_URL` is already +configured in `docker-compose.yml`, so the file is downloaded automatically — +no extra steps needed. + +**Standalone:** export the URL before starting the simulator: + +```bash +export NETCDF_FILE_URL=https://bwsyncandshare.kit.edu/s/jSAFftGXcJjQbSJ/download +python main.py +``` + +The file (~193 MB) is saved to the path given by `NETCDF_FILE` (or +`data_source.netcdf_file` in `config.yml`) and is only downloaded once. ### Authentication diff --git a/mno_data_source_simulator/config.yml b/mno_data_source_simulator/config.yml index a17150b..d8227a4 100644 --- a/mno_data_source_simulator/config.yml +++ b/mno_data_source_simulator/config.yml @@ -7,8 +7,10 @@ data_source: # downloaded automatically at startup if NETCDF_FILE_URL is set. # Override via the NETCDF_FILE environment variable. netcdf_file: "/app/example_data/openMRG_cmls_20150827_3months.nc" - # Loop duration in seconds (1 hour = 3600 seconds) - loop_duration_seconds: 3600 + # Loop duration in seconds — set to the full 3-month dataset duration so the + # simulator only restarts after exhausting all source data. + # (openMRG_cmls_20150827_3months.nc: 7 948 860 s ≈ 92 days) + loop_duration_seconds: 7948860 # SFTP upload configuration sftp: