Import a wind vector file generated from Python (e.g. via xarray or netCDF4). The engine automatically accommodates standard grid matrices, xarray dictionaries, or vector arrays.
Run this ready-to-use Python script to convert any NetCDF meteorological file (ERA5, GFS, HRRR, WRF) into the optimized format for this GIS dashboard:
# 1. Install required scientific libraries
pip install xarray netCDF4 numpy
# 2. Run the bundled conversion script
python scripts/convert_netcdf_to_webgis.py \
--input path/to/your_era5_wind.nc \
--output public/data/wind/ \
--step-lat 5.0 \
--step-lon 5.0
The bundled converter uses the first available vertical level and writes one wind field per hour. The map draws a tapered directional trail for each vector; the trail is visual only and does not use earlier hourly frames.
import xarray as xr, json, numpy as np
# Open your NetCDF file
ds = xr.open_dataset("wind.nc")
u, v = ds["u10"].values, ds["v10"].values
lats, lons = ds["latitude"].values, ds["longitude"].values
vectors = []
for i, lat in enumerate(lats[::5]):
for j, lon in enumerate(lons[::5]):
u_val, v_val = float(u[0, i*5, j*5]), float(v[0, i*5, j*5])
speed = float(np.sqrt(u_val**2 + v_val**2))
direction = float((np.arctan2(-u_val, -v_val) * 180 / np.pi + 360) % 360)
vectors.append({"lat": round(float(lat), 2), "lng": round(float(lon), 2),
"u": round(u_val, 2), "v": round(v_val, 2),
"speed": round(speed, 2), "direction": round(direction, 1)})
with open("public/data/wind/wind_custom.json", "w") as f:
json.dump({"timestamp": "2026-10-05T12:00:00Z", "vectors": vectors}, f)
The built-in parser automatically accommodates any of the following Python data structures:
{ "timestamp": "...", "vectors": [ { "lat": 45.0, "lng": -75.0, "u": 12.4, "v": -3.2, "speed": 12.8, "direction": 284.5 } ] }{ "coords": { "lat": [...], "lon": [...] }, "variables": { "u10": [[...]], "v10": [[...]] } }{ "type": "FeatureCollection", "features": [ { "geometry": { "type": "LineString", ... }, "properties": { "u": ..., "v": ... } } ] }