scenario.json Reference¶
The scenario.json file is the main configuration for a simulation run. It is generated by the Hydrata server when building a scenario package, or can be written manually for standalone use.
Full field reference¶
| Field | Type | Required | Description |
|---|---|---|---|
format_version |
string | No | Schema version. Must be "1.0" if present. |
id |
integer | Yes | Scenario ID |
run_id |
integer | No | Run ID for this execution |
project |
integer | Yes | Project ID |
epsg |
string | Yes | Coordinate reference system (e.g. "EPSG:28355") |
name |
string | No | Human-readable scenario name |
description |
string | No | Optional description |
control_server |
string | No | Base URL of the Hydrata server (for progress reporting) |
elevation |
string | Yes | Filename of elevation raster in inputs/ |
boundary |
string | Yes | Filename of boundary GeoJSON in inputs/ |
friction |
string | No | Filename of friction GeoJSON in inputs/ |
inflow |
string | No | Filename of inflow GeoJSON in inputs/ |
structure |
string | No | Filename of structure GeoJSON in inputs/ |
mesh_region |
string | No | Filename of mesh region GeoJSON in inputs/ |
hydrology_status |
string | No | Status of hydrology pre-processing |
catchment |
string | No | Filename of catchment GeoJSON in inputs/ |
nodes |
string | No | Filename of nodes GeoJSON in inputs/ |
links |
string | No | Filename of links GeoJSON in inputs/ |
simplify_mesh |
boolean | No | Use adaptive mesher for mesh generation |
resolution |
number | No | Base mesh resolution in metres |
max_rmse_tolerance |
number | No | RMSE tolerance for adaptive mesher |
model_start |
string | No | Simulation start time (ISO 8601) |
duration |
integer | Yes | Simulation duration in seconds |
Example¶
{
"format_version": "1.0",
"id": 1,
"run_id": 7,
"project": 42,
"epsg": "EPSG:28355",
"name": "100-year ARI flood",
"description": "Design storm event",
"control_server": "https://hydrata.com/",
"elevation": "dem.tif",
"boundary": "boundary.geojson",
"friction": "friction.geojson",
"inflow": "inflow.geojson",
"structure": null,
"mesh_region": "mesh_regions.geojson",
"simplify_mesh": true,
"resolution": 10,
"max_rmse_tolerance": 0.5,
"model_start": "2024-01-01T00:00:00Z",
"duration": 7200
}
Validation¶
The run_anuga package includes a JSON Schema for scenario.json. You can validate a file programmatically:
from run_anuga.schema import validate_scenario
import json
with open("scenario.json") as f:
config = json.load(f)
validate_scenario(config) # raises ValidationError on failure
The full schema is defined in run_anuga/schema.py.