Trixology

WeatherCat => WeatherCat Web Templates => Topic started by: jsnell on March 15, 2022, 12:29:21 AM

Title: Python script: Storm Log
Post by: jsnell 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
Title: Thanks!! (Re: Python script: Storm Log)
Post by: elagache on March 15, 2022, 09:26:53 PM
Thanks Jason for sharing! (http://www.canebas.org/WeatherCat/Forum_support_documents/Custom_emoticons/thanks_sign.gif)

Cheers, Edouard
Title: Re: Python script: Storm Log
Post by: clockworkkev12 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?
Title: Re: Python script: Storm Log
Post by: Blicj11 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!
Title: Re: Python script: Storm Log
Post by: jsnell 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
Title: Re: Python script: Storm Log
Post by: clockworkkev12 on December 10, 2022, 01:47:58 AM
Works great! Thank you so much. Big fan of your work.