Author Topic: Python script: Storm Log  (Read 3156 times)

jsnell

  • Gentle Breeze
  • **
  • Posts: 26
    • KCAMILLV5
Python script: Storm Log
« on: March 15, 2022, 12:29:21 AM »
Just sharing in case people are interested. This is a python script that parses your WeatherCat data files for the current rain year (July-July, sorry, I live in California) and writes any "rain events" to a file that you can include in any web templates you might have. Rain events are defined as being .1 inches or more, more or less. I wanted to generate a "when was that last storm?" list.

Script here:

https://gist.github.com/jasonsnell/caeff4fef6978f8271780f40da58db9c

Output sample on my home weather page:

https://snell.zone/weather/weather.php

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6499
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Thanks!! (Re: Python script: Storm Log)
« Reply #1 on: March 15, 2022, 09:26:53 PM »
Thanks Jason for sharing!

Cheers, Edouard

clockworkkev12

  • Calm
  • *
  • Posts: 6
  • Station Details: Davis Vantage Vue with WeatherLink Live
Re: Python script: Storm Log
« Reply #2 on: July 10, 2022, 09:01:37 PM »
Thanks for this and your past 14 day temperature graph, which works perfectly. This one works to create the text file, but is it also supposed to create the image showing the past two weeks of rain? Or is that another step that's not covered here?

Blicj11

  • Storm
  • *****
  • Posts: 3951
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: Python script: Storm Log
« Reply #3 on: July 12, 2022, 03:53:21 PM »
Very cool, Jason. Thanks so much for sharing and providing a link to your weather site.

clockworkkev12: As this is your first post on the WeatherCat forum, welcome!
Blick


jsnell

  • Gentle Breeze
  • **
  • Posts: 26
    • KCAMILLV5
Re: Python script: Storm Log
« Reply #4 on: December 09, 2022, 10:29:10 PM »
Sorry for the very long delay.

The code to generate the last 14 days of rain is here:

https://gist.github.com/jasonsnell/6ac75c44d0bc8dbd9c649f5211b77934

clockworkkev12

  • Calm
  • *
  • Posts: 6
  • Station Details: Davis Vantage Vue with WeatherLink Live
Re: Python script: Storm Log
« Reply #5 on: December 10, 2022, 01:47:58 AM »
Works great! Thank you so much. Big fan of your work.