Skip to content

Commit ac3a94a

Browse files
authored
fix(mno-simulator): set loop_duration to full 3-month dataset (#30)
- 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
1 parent fb0d1f0 commit ac3a94a

2 files changed

Lines changed: 27 additions & 4 deletions

File tree

mno_data_source_simulator/README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ Edit `config.yml` for local/standalone use, or set environment variables for Doc
4444
```yaml
4545
data_source:
4646
netcdf_file: "/app/example_data/openMRG_cmls_20150827_3months.nc"
47-
loop_duration_seconds: 3600 # Lookback window for real-time replay
47+
# Set to the full dataset duration so the simulator only loops after all
48+
# source data is exhausted (openMRG_cmls_20150827_3months.nc ≈ 92 days).
49+
loop_duration_seconds: 7948860
4850

4951
generator:
5052
generation_frequency_seconds: 10 # How often to generate files
@@ -61,7 +63,26 @@ sftp:
6163
| Variable | Description |
6264
|---|---|
6365
| `NETCDF_FILE` | Path to the NetCDF source file |
64-
| `NETCDF_FILE_URL` | URL to download the file if not already present |
66+
| `NETCDF_FILE_URL` | URL to download the file automatically if not already present |
67+
68+
### NetCDF dataset auto-download
69+
70+
The simulator downloads the 3-month source file automatically on startup if the
71+
path set in `NETCDF_FILE` does not exist **and** `NETCDF_FILE_URL` is set.
72+
73+
**Docker (`docker-compose up mno_simulator`):** `NETCDF_FILE_URL` is already
74+
configured in `docker-compose.yml`, so the file is downloaded automatically —
75+
no extra steps needed.
76+
77+
**Standalone:** export the URL before starting the simulator:
78+
79+
```bash
80+
export NETCDF_FILE_URL=https://bwsyncandshare.kit.edu/s/jSAFftGXcJjQbSJ/download
81+
python main.py
82+
```
83+
84+
The file (~193 MB) is saved to the path given by `NETCDF_FILE` (or
85+
`data_source.netcdf_file` in `config.yml`) and is only downloaded once.
6586

6687
### Authentication
6788

mno_data_source_simulator/config.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ data_source:
77
# downloaded automatically at startup if NETCDF_FILE_URL is set.
88
# Override via the NETCDF_FILE environment variable.
99
netcdf_file: "/app/example_data/openMRG_cmls_20150827_3months.nc"
10-
# Loop duration in seconds (1 hour = 3600 seconds)
11-
loop_duration_seconds: 3600
10+
# Loop duration in seconds — set to the full 3-month dataset duration so the
11+
# simulator only restarts after exhausting all source data.
12+
# (openMRG_cmls_20150827_3months.nc: 7 948 860 s ≈ 92 days)
13+
loop_duration_seconds: 7948860
1214

1315
# SFTP upload configuration
1416
sftp:

0 commit comments

Comments
 (0)