Ticket sales CLOSED!

Saturday 5:07 p.m.–5:14 p.m. in Colony Ballroom

Bloomcast - Python Facilitating Operational Oceanography

Doug Latornell

Audience level:


Bloomcast is a daily prediction of the beginning of the aquatic growing season in the Strait of Georgia. Python makes it possible by collecting meteorological and river flow data, running a Fortran code, analyzing its results, and publishing the prediction to the web - all while I sleep.



  • The spring phytoplankton bloom in the Strait of Georgia and why its timing matters

  • The SOG 1D coupled physics-biogeochemistry model of the Strait; a Fortran code

  • What running the model operationally means: running it every day with the latest available real world data to drive it

The Python ecosystem wrapped around SOG to make bloomcast happen

  • There are a lot of nasty, sharp bits involved in running a research Fortran code every day with real world data as inputs. Python and a collection of its notable libraries allow that to be done painlessly, dependably, repeatably, and automatically.

  • YAML parameter file to describe the task

  • Requests to pull up to date weather data from a friendly Environment Canada web service, and river flow data from a not so friendly one

  • ElementTree to parse the well-formed XML weather data and BeautifulSoup to parse the HTML table of river flow data

  • Logging SMTP handler to draw attention to unusual forcing data

  • YAML and Colander to make the 1000+ line input file for the SOG code safe and friendly for humans

  • Subprocess to run 3 instances of the SOG code in parallel on a multi-core Linux system

  • Numpy to analyze the results of the SOG code runs using vectorized operations to calculate the predicted bloom date and early and late bounds on it

  • Matplotlib to create annotated graphs of water column profiles, and calculated timeseries results and render them to SVG

  • Mako template to render the day's results to HTML

  • Guest appearances by cron to get the ball rolling each morning, and rsync to push the rendered results to the web server


  • 2013 was bloomcast's 2nd year in production

  • In 2012 a deficiency in the cloud fraction interpolation from the weather data was identified. However, when the predictions were adjusted to account for the deficiency, they were in agreement with satellite observations of chlorophyll, and cruise measurements

  • In 2013 the cloud fraction interpolation was improved based on analysis of 10 years of weather data (Requests and Numpy on the job again). The predicted bloom date was confirmed by satellite observations, and by chlorophyll data collected by an instrumented ferry that crosses the Strait 8 times a day.

  • Pressently, we are working on a new operational wrapper for SOG that will calculate productivity in the Strait of Georgia every day, year-round.

  • SOG is beginning to be used to model the Gulf of St. Lawrence. Can a GSL-bloomcast be far behind?

Get in touch