Author Topic: Growing Degree Days  (Read 3415 times)

0 Members and 1 Guest are viewing this topic.

Offline ryanprel

  • Member
  • *
  • Posts: 13
Growing Degree Days
« on: May 02, 2016, 11:20:36 PM »
Does anyone know of a way of automatically calculating growing degree days (GDD's) from the WS-1001 stations?  Either through a standard Weather Underground setup or using a different template/server.  I don't see anywhere that it's capable although I know of a few sites where it can be calculated via your zip code.  I'd like to try and calculate for my site and compare with the zip code to see what type of micro-climate my site has. 

Offline lrosenman

  • Contributor
  • ***
  • Posts: 148
    • Siena Weather
Re: Growing Degree Days
« Reply #1 on: May 03, 2016, 09:33:13 AM »
Is there a formula somewhere?  If so, we can do that.....

Offline Sparky

  • Member
  • *
  • Posts: 3
Re: Growing Degree Days
« Reply #2 on: May 03, 2016, 09:42:35 AM »
Google growing degree days.  You will find a LOT of information.

Good luck

Offline ryanprel

  • Member
  • *
  • Posts: 13
Re: Growing Degree Days
« Reply #3 on: May 03, 2016, 11:35:13 AM »
http://agron-www.agron.iastate.edu/Courses/agron212/Calculations/GDD.htm

Here's some good info on examples and the equations.

For the agriculture realm, GDD's are one of the most important components of weather.  I think the Davis stations might show it but there's no reason it couldn't be automatically calculated and shown in the WS-1001.

Offline lrosenman

  • Contributor
  • ***
  • Posts: 148
    • Siena Weather
Re: Growing Degree Days
« Reply #4 on: May 03, 2016, 12:00:40 PM »
http://agron-www.agron.iastate.edu/Courses/agron212/Calculations/GDD.htm

Here's some good info on examples and the equations.

For the agriculture realm, GDD's are one of the most important components of weather.  I think the Davis stations might show it but there's no reason it couldn't be automatically calculated and shown in the WS-1001.

I'll put together something tonight from the database I generate. 

Offline lrosenman

  • Contributor
  • ***
  • Posts: 148
    • Siena Weather
Re: Growing Degree Days
« Reply #5 on: May 03, 2016, 12:19:08 PM »
http://agron-www.agron.iastate.edu/Courses/agron212/Calculations/GDD.htm

Here's some good info on examples and the equations.

For the agriculture realm, GDD's are one of the most important components of weather.  I think the Davis stations might show it but there's no reason it couldn't be automatically calculated and shown in the WS-1001.

I'll put together something tonight from the database I generate.

@ryanprel: That page seems to say it's dependent on the organism.  What base and limits do you want to see?

Offline ryanprel

  • Member
  • *
  • Posts: 13
Re: Growing Degree Days
« Reply #6 on: May 03, 2016, 02:20:02 PM »
I'm specifically looking for grapes.  Looks like most crops use a 10c base temp, but there are some other base numbers.  The Wikipedia link below provides some of the different base numbers.

Here's a bit more information:
https://en.wikipedia.org/wiki/Growing_degree-day
http://msue.anr.msu.edu/topic/grapes/weather_climate/how_to_use_gdds
http://wine.wsu.edu/research-extension/weather/growing-degree-days/

Offline lrosenman

  • Contributor
  • ***
  • Posts: 148
    • Siena Weather
Re: Growing Degree Days
« Reply #7 on: May 03, 2016, 02:34:22 PM »
I'm specifically looking for grapes.  Looks like most crops use a 10c base temp, but there are some other base numbers.  The Wikipedia link below provides some of the different base numbers.

Here's a bit more information:
https://en.wikipedia.org/wiki/Growing_degree-day
http://msue.anr.msu.edu/topic/grapes/weather_climate/how_to_use_gdds
http://wine.wsu.edu/research-extension/weather/growing-degree-days/

Does this look reasonable?
Quote
weather=# select max(outsidetemp),min(outsidetemp),(((max(outsidetemp)+min(outsidetemp))/2)-50)::numeric(5,2) as "GDD" from observations where timeutc between '2016-05-02 00:00:00' and '2016-05-03 00:00:00';
  max  |  min  |  GDD
-------+-------+-------
 67.10 | 55.80 | 11.45
(1 row)

Offline ryanprel

  • Member
  • *
  • Posts: 13
Re: Growing Degree Days
« Reply #8 on: May 03, 2016, 02:59:07 PM »
Yeah, looks like that would work.  Thank you!

Offline lrosenman

  • Contributor
  • ***
  • Posts: 148
    • Siena Weather
Re: Growing Degree Days
« Reply #9 on: May 03, 2016, 03:01:46 PM »
Yeah, looks like that would work.  Thank you!

That depends on my mods to weatherist34's script to log the data to a PostgreSQL database.

Do you have his stuff (that's intercepting the WS-1001's Wunderground POST's)?

If so, I can send you my schema, and the scripts.

I assume you have PostgreSQL?

Offline ryanprel

  • Member
  • *
  • Posts: 13
Re: Growing Degree Days
« Reply #10 on: May 03, 2016, 03:34:25 PM »
I don't have weatherist34's setup working yet - was just looking at it yesterday.  The server I have runs Apache/Mysql and will be setup at http://weather.vinesandrushes.com

Offline lrosenman

  • Contributor
  • ***
  • Posts: 148
    • Siena Weather
Re: Growing Degree Days
« Reply #11 on: May 03, 2016, 03:36:48 PM »
I don't have weatherist34's setup working yet - was just looking at it yesterday.  The server I have runs Apache/Mysql and will be setup at http://weather.vinesandrushes.com

You might have to hack my stuff some to connect to MySQL and use that. 

It's literally one file to change on the WS-1001, and then the code on the webserver.

Your site gives me a permission denied ATM.  (I can help with that too :) )

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Growing Degree Days
« Reply #12 on: May 03, 2016, 03:46:52 PM »
I can confirm that, your site just shows foribidden

Offline ryanprel

  • Member
  • *
  • Posts: 13
Re: Growing Degree Days
« Reply #13 on: May 03, 2016, 03:50:41 PM »
Yeah, I'm just in the process of setting things up right now. 

Received this error when going to http://weather.vinesandrushes.com/weatherstation/updateweatherstation.php

"
Warning: file_get_contents() [function.file-get-contents]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /nfs/c04/h01/mnt/61257/domains/weather.vinesandrushes.com/html/weatherstation/updateweatherstation.php on line 2

Warning: file_get_contents(http://rtupdate.wunderground.com/weatherstation/updateweatherstation.php?) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /nfs/c04/h01/mnt/61257/domains/weather.vinesandrushes.com/html/weatherstation/updateweatherstation.php on line 2
"

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Growing Degree Days
« Reply #14 on: May 03, 2016, 03:58:38 PM »
Your server does not have file_get_contents method enabled (which is the main function to get the data).

In my template I use cURL as an alternative for people that have this problem so it might be a solution for you as well.

Change file_get_contents to cURL or see if you can enable file_get_contents in your server settings

Offline lrosenman

  • Contributor
  • ***
  • Posts: 148
    • Siena Weather
Re: Growing Degree Days
« Reply #15 on: May 03, 2016, 04:00:41 PM »
Your server does not have file_get_contents method enabled (which is the main function to get the data).

In my template I use cURL as an alternative for people that have this problem so it might be a solution for you as well.

Change file_get_contents to cURL or see if you can enable file_get_contents in your server settings

Beware that file_get_contents is used throughout weatherist34's template.....

Offline ryanprel

  • Member
  • *
  • Posts: 13
Re: Growing Degree Days
« Reply #16 on: May 03, 2016, 04:06:47 PM »
I got allow_url_fopen = 1 enabled which seemed to fix the issue but it's not creating the json file, but also not showing any error.

Offline lrosenman

  • Contributor
  • ***
  • Posts: 148
    • Siena Weather
Re: Growing Degree Days
« Reply #17 on: May 03, 2016, 04:08:37 PM »
I got allow_url_fopen = 1 enabled which seemed to fix the issue but it's not creating the json file, but also not showing any error.

check permissions on the directory. 

and it may not be writing it where you think.....

Offline ryanprel

  • Member
  • *
  • Posts: 13
Re: Growing Degree Days
« Reply #18 on: May 03, 2016, 04:10:09 PM »
Permissions are at 755 and nothing was written to that directory or the root.

Offline lrosenman

  • Contributor
  • ***
  • Posts: 148
    • Siena Weather
Re: Growing Degree Days
« Reply #19 on: May 03, 2016, 04:12:22 PM »
Permissions are at 755 and nothing was written to that directory or the root.

What user is APACHE running as?  It needs to write as THAT user.

On my FreeBSD system, that's www, but the directory etc is owned by wview (historical reasons).

You might want to create the ws1001.json file owned by whatever user apache is running on.


Offline ryanprel

  • Member
  • *
  • Posts: 13
Re: Growing Degree Days
« Reply #20 on: May 03, 2016, 04:14:00 PM »
Huh, had refreshed the folder before but now went back into it and the json file was there - hadn't changed anything...

Offline lrosenman

  • Contributor
  • ***
  • Posts: 148
    • Siena Weather
Re: Growing Degree Days
« Reply #21 on: May 03, 2016, 04:15:17 PM »
Huh, had refreshed the folder before but now went back into it and the json file was there - hadn't changed anything...

Based on the path, welcome to the wonderful world of NFS and caches :)

Offline ryanprel

  • Member
  • *
  • Posts: 13
Re: Growing Degree Days
« Reply #22 on: May 03, 2016, 04:22:44 PM »
Looks like I don't have a MicroSD on hand so I'll get on that and be back in a few days...

Offline lrosenman

  • Contributor
  • ***
  • Posts: 148
    • Siena Weather
Re: Growing Degree Days
« Reply #23 on: May 03, 2016, 04:24:33 PM »
Looks like I don't have a MicroSD on hand so I'll get on that and be back in a few days...

IF you have a windows box and a usb cable you can do it with that (the WS-1001 is apparently running Windows CE).


Offline ryanprel

  • Member
  • *
  • Posts: 13
Re: Growing Degree Days
« Reply #24 on: May 03, 2016, 04:26:04 PM »
Yeah, no windows box.  There was nothing better than Windows CE?

 

anything