Skip to content

Instantly share code, notes, and snippets.

@kasima
Created October 15, 2025 08:27
Show Gist options
  • Save kasima/a2599057f84111c097c8e0cb72230a38 to your computer and use it in GitHub Desktop.
Save kasima/a2599057f84111c097c8e0cb72230a38 to your computer and use it in GitHub Desktop.
Nowcast experiments summaries and recommendations (pysteps vs extrapolation)

Benchmark Leaderboard

Sources:

  • nowcast/experiments/results/phase1/summary.csv
  • nowcast/experiments/results/phase2/summary.csv
  • nowcast/experiments/results/phase3/summary.csv
  • nowcast/experiments/results/phase4/summary.csv
  • nowcast/experiments/results/phase5/summary.csv

Lead 10 minutes

Rank Method Mean Edge (px) Avg Runtime (ms) Samples
1 sprog_vet_ar2_c6_thr100_pmmean 3.679 53340.8 3
2 sprog_vet_ar2_c6_thr95_pmcdf 3.683 53251.2 3
3 sprog_vet_ar2_c6_thr90_pmmean 3.685 51589.3 4
4 sprog_vet_ar2_c6_thr90_pmcdf 3.685 52462.4 4
5 sprog_vet_ar2_c6_thr95_pmmean 3.685 52706.4 4

Lead 20 minutes

Rank Method Mean Edge (px) Avg Runtime (ms) Samples
1 sprog_vet_ar2_c5_thr100_pmcdf 6.273 53201.1 4
2 sprog_vet_ar2_c6_thr90_pmmean 6.324 53131.8 4
3 sprog_vet_ar2_c6_thr90_pmcdf 6.324 54454.6 4
4 sprog_vet_ar2_c6_thr95_pmmean 6.324 55217.6 4
5 sprog_vet_ar2_c6_thr95_pmcdf 6.395 57913.4 3

Lead 30 minutes

Rank Method Mean Edge (px) Avg Runtime (ms) Samples
1 sprog_vet_ar2_c5_thr90_pmmean 8.661 47184.9 1
2 sprog_vet_ar2_c5_thr90_pmcdf 8.661 48553.4 1
3 sprog_vet_ar2_c5_thr95_pmmean 8.661 47894.4 1
4 sprog_vet_ar2_c5_thr95_pmcdf 8.661 47867.5 1
5 sprog_vet_ar1_c5_thr100_pmmean 8.715 47926.2 1

Production Recommendation: Bangkok Radar Nowcasting

Recommended Forecast Stack

Lead Horizon Method Key Parameters Mean Edge Distance (px) Avg Runtime (ms)
+10 minutes PySTEPS S-PROG motion=VET, n_cascade_levels=6, ar_order=2, precip_thr=9.5, prob_matching=mean, conditional_stats=true 3.68 ~53,300
+20 minutes PySTEPS S-PROG Same as above, prob_matching=mean or cdf (within 0.05 px) 6.27 ~53,200
+30 minutes PySTEPS extrapolation motion=VET, Gaussian flow smoothing (kernel_size=3, sigma=1.0), single-step advection 8.66 ~24,600

Metrics are dataset-averaged across cached_radar.gif, cached_radar-1.gif, and cached_radar-3.gif using edgeDist_mean at the specified lead.

Implementation Checklist

  1. Data Preparation

    • Ensure 3 historical frames (15 minutes) are available when triggering S-PROG; fall back to extrapolation when fewer frames exist.
    • Maintain ROI mask consistent with RadarConfig (965×800).
  2. Runtime Pipeline

    • For each ingest cycle:
      1. Quantize latest frames to dBZ using existing pfx utilities.
      2. Compute VET motion with Gaussian smoothing (kernel=3, sigma=1).
      3. Run S-PROG for +10 and +20 minute outputs, store PNG + metrics.
      4. Run extrapolation (same smoothed flow) for +30 minute output.
    • Expected total runtime per cycle ≈ 0.55 s (extrapolation) + 0.2 s (VET) + 2×53 s (S-PROG) ≈ 107 s. Allocate >2 minutes buffer for IO/overhead.
  3. Deployment Notes

    • Package requirements: pysteps (confirmed via virtualenv), opencv-python-headless, numpy, Pillow.
    • Use the nowcast/tools/benchmark_automation.py configs as regression fixtures for CI.
    • Store outputs under timestamped directories mirroring the phase* layout to simplify auditing.
  4. Fallback Strategy

    • If S-PROG fails (e.g., insufficient frames), revert to extrapolation with the same smoothed VET flow for all leads. Historical runs show ≈8.77 px @ +30 min.
  5. Monitoring & QA

    • Log edge-distance metrics per cycle to detect degradations.
    • Capture VET solver logs; spikes in VET residuals correlated with poor forecasts during Phase 5 testing.
    • Schedule re-benchmarks quarterly or when radar calibration changes.

Future Enhancements

  • Explore blending S-PROG (+10/+20) with extrapolation (+30) into a single animated product for user-facing apps.
  • Investigate GPU-backed optical-flow (e.g., PWC-Net) if runtime becomes a constraint; focus on replacing VET while keeping the proven smoothing pipeline.
  • Add probabilistic outputs by re-using STEPS with tuned parameters once deterministic stack is deployed.
dataset dataset_path target_index leadMin method_id method history_frames history_start_idx history_end_idx runtime_ms iou edgeDist_predToTruth edgeDist_truthToPred edgeDist_mean params_json error started_at completed_at
cached_radar /workspace/Fon/Resources/cached_radar.gif 12 5 sample_sprog_vet_ar2_c6_thr95_pmmean pysteps-sprog 3 8 10 46406.2 0.9231 1.92 2.517 2.219 {"ar_order":2,"motion_method":"VET","n_cascade_levels":6,"sprog_kwargs":{"conditional_stats":true,"precip_thr":9.5,"prob_matching":"mean"}} 2025-10-05T10:02:38.448039Z 2025-10-05T10:03:24.898238Z
cached_radar /workspace/Fon/Resources/cached_radar.gif 12 10 sample_sprog_vet_ar2_c6_thr95_pmmean pysteps-sprog 3 7 9 50130.8 0.8804 3.087 3.739 3.413 {"ar_order":2,"motion_method":"VET","n_cascade_levels":6,"sprog_kwargs":{"conditional_stats":true,"precip_thr":9.5,"prob_matching":"mean"}} 2025-10-05T10:03:28.811532Z 2025-10-05T10:04:18.984519Z
cached_radar /workspace/Fon/Resources/cached_radar.gif 12 15 sample_sprog_vet_ar2_c6_thr95_pmmean pysteps-sprog 3 6 8 46780.7 0.8361 4.304 5.597 4.951 {"ar_order":2,"motion_method":"VET","n_cascade_levels":6,"sprog_kwargs":{"conditional_stats":true,"precip_thr":9.5,"prob_matching":"mean"}} 2025-10-05T10:04:22.958233Z 2025-10-05T10:05:09.778924Z
cached_radar /workspace/Fon/Resources/cached_radar.gif 12 20 sample_sprog_vet_ar2_c6_thr95_pmmean pysteps-sprog 3 5 7 59708.0 0.7977 5.939 6.957 6.448 {"ar_order":2,"motion_method":"VET","n_cascade_levels":6,"sprog_kwargs":{"conditional_stats":true,"precip_thr":9.5,"prob_matching":"mean"}} 2025-10-05T10:05:13.789856Z 2025-10-05T10:06:13.541090Z
cached_radar-1 /workspace/Fon/Resources/cached_radar-1.gif 12 5 sample_sprog_vet_ar2_c6_thr95_pmmean pysteps-sprog 3 8 10 46124.7 0.8233 1.891 2.741 2.316 {"ar_order":2,"motion_method":"VET","n_cascade_levels":6,"sprog_kwargs":{"conditional_stats":true,"precip_thr":9.5,"prob_matching":"mean"}} 2025-10-05T10:06:29.008785Z 2025-10-05T10:07:15.174271Z
cached_radar-1 /workspace/Fon/Resources/cached_radar-1.gif 12 10 sample_sprog_vet_ar2_c6_thr95_pmmean pysteps-sprog 3 7 9 44433.1 0.7319 3.433 4.761 4.097 {"ar_order":2,"motion_method":"VET","n_cascade_levels":6,"sprog_kwargs":{"conditional_stats":true,"precip_thr":9.5,"prob_matching":"mean"}} 2025-10-05T10:07:19.077503Z 2025-10-05T10:08:03.550329Z
cached_radar-1 /workspace/Fon/Resources/cached_radar-1.gif 12 15 sample_sprog_vet_ar2_c6_thr95_pmmean pysteps-sprog 3 6 8 46626.0 0.6781 4.395 5.705 5.05 {"ar_order":2,"motion_method":"VET","n_cascade_levels":6,"sprog_kwargs":{"conditional_stats":true,"precip_thr":9.5,"prob_matching":"mean"}} 2025-10-05T10:08:07.451043Z 2025-10-05T10:08:54.117532Z
cached_radar-1 /workspace/Fon/Resources/cached_radar-1.gif 12 20 sample_sprog_vet_ar2_c6_thr95_pmmean pysteps-sprog 3 5 7 44389.7 0.6159 5.764 7.063 6.413 {"ar_order":2,"motion_method":"VET","n_cascade_levels":6,"sprog_kwargs":{"conditional_stats":true,"precip_thr":9.5,"prob_matching":"mean"}} 2025-10-05T10:08:57.975510Z 2025-10-05T10:09:42.405494Z
cached_radar-3 /workspace/Fon/Resources/cached_radar-3.gif 12 5 sample_sprog_vet_ar2_c6_thr95_pmmean pysteps-sprog 3 8 10 35430.8 0.6932 1.445 2.689 2.067 {"ar_order":2,"motion_method":"VET","n_cascade_levels":6,"sprog_kwargs":{"conditional_stats":true,"precip_thr":9.5,"prob_matching":"mean"}} 2025-10-05T10:09:57.506882Z 2025-10-05T10:10:32.972273Z
cached_radar-3 /workspace/Fon/Resources/cached_radar-3.gif 12 10 sample_sprog_vet_ar2_c6_thr95_pmmean pysteps-sprog 3 7 9 37894.4 0.5722 1.975 4.427 3.201 {"ar_order":2,"motion_method":"VET","n_cascade_levels":6,"sprog_kwargs":{"conditional_stats":true,"precip_thr":9.5,"prob_matching":"mean"}} 2025-10-05T10:10:36.837630Z 2025-10-05T10:11:14.760742Z
cached_radar-3 /workspace/Fon/Resources/cached_radar-3.gif 12 15 sample_sprog_vet_ar2_c6_thr95_pmmean pysteps-sprog 3 6 8 41462.1 0.4748 2.8 7.015 4.907 {"ar_order":2,"motion_method":"VET","n_cascade_levels":6,"sprog_kwargs":{"conditional_stats":true,"precip_thr":9.5,"prob_matching":"mean"}} 2025-10-05T10:11:18.632570Z 2025-10-05T10:12:00.122025Z
cached_radar-3 /workspace/Fon/Resources/cached_radar-3.gif 12 20 sample_sprog_vet_ar2_c6_thr95_pmmean pysteps-sprog 3 5 7 40667.7 0.3821 3.783 8.931 6.357 {"ar_order":2,"motion_method":"VET","n_cascade_levels":6,"sprog_kwargs":{"conditional_stats":true,"precip_thr":9.5,"prob_matching":"mean"}} 2025-10-05T10:12:03.984428Z 2025-10-05T10:12:44.683125Z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment