cloudy

Author Topic: Tag: Date of first snow  (Read 1163 times)

0 Members and 1 Guest are viewing this topic.

Offline Labbs

  • Posts: 314
  • Göteborg, Sweden
    • Lokalt Väder
Tag: Date of first snow
« on: November 02, 2011, 06:06:16 AM »
Hi Brian,

Would it be possible, and of interest, to add tags containing "season's first snow date"? And perhaps also if this information can be retrieved, date for previous seasons? I'd like to "guess/calculate" an average date for first snow fall...

Thanks
/Labbs

Offline mikeym

  • Posts: 886
  • Thornhurst, Pa USA
    • MikeyMs Thornhurst,PA Weather
Re: Tag: Date of first snow
« Reply #1 on: November 02, 2011, 10:40:14 PM »
Yes, I would like that also. Thanks

Cheers

 :D

MikeyM
http://home.ptd.net/~mikeym/

Another VERY Happy WD user
Jetway Dual Core Atom D525 1.8 GHZ  1.0 GB RAM
Davis Vantage Pro wireless w/ Davis solar sensor
Also  Snow Depth Sensor (Ultrasonic)
Now Laser Snow Depth Sensor working in WD thanks to Brian

Offline Weather Display

  • Posts: 65,579
Re: Tag: Date of first snow
« Reply #2 on: November 02, 2011, 10:46:56 PM »
the data is there , in the xxxxlg2.txt file
to find that info
to be able to add some custom tags like that
maybe 2 tags
date of seasons first snow
and average data or seasons first snow?

Offline Labbs

  • Posts: 314
  • Göteborg, Sweden
    • Lokalt Väder
Re: Tag: Date of first snow
« Reply #3 on: November 03, 2011, 05:33:44 AM »
Those 2 tags sounds great!
Perfect to get the station average from a tag

My reason for getting previous seasons first date was not only to print and compare the dates
I was also planing to print "last seasons first snow date", but anything is very much appreciated   :D
I can solve my first idea with 3 tags.
Do not know if other would like and prefer tags like "%snowdateyear%2008"

Thanks again!!

Offline Weather Display

  • Posts: 65,579
Re: Tag: Date of first snow
« Reply #4 on: November 03, 2011, 06:30:53 AM »
.zip and email me your xxxxlg2.txt logfiles and I will see what I can do

Offline Labbs

  • Posts: 314
  • Göteborg, Sweden
    • Lokalt Väder
Re: Tag: Date of first snow
« Reply #5 on: November 03, 2011, 07:53:49 PM »
Mail is on its way - thanks!

Offline Weather Display

  • Posts: 65,579
Re: Tag: Date of first snow
« Reply #6 on: November 04, 2011, 12:33:12 AM »
I have the date of first snow for the season working OK

but the average of that date is not as easy to calculate as you might think

for when it comes to averaging the month , especialy if that varies from month 11 to month 2
i.e the average of those is not 1, but like 5
(same would apply if you converted the day (of the month) and month to a number from 1 to 360

one way  can get around that would be to re map the month numbers?
ideas?

Offline kagrani

  • Posts: 32
Re: Tag: Date of first snow
« Reply #7 on: November 04, 2011, 05:44:58 AM »
Hi!

A suggestion from a non-programmer, but could you somehow reference to start of snow year instead of calendar month?


Knut

Offline Labbs

  • Posts: 314
  • Göteborg, Sweden
    • Lokalt Väder
Re: Tag: Date of first snow
« Reply #8 on: November 04, 2011, 09:28:51 AM »
I'm not a programmer either but my original thoughts the get/retrieve dates was to calculate an average in php.

Might be too naive but I was thinking to converting date to unix timestamp, something like this perhaps.... ?!?

Code: [Select]
<?php
for ($year $year count([available years]) ; $year++ ){
  if ([
value exists for $year in loop]) {
    if ([
date passed new year)
      
$snowdatearr[] = mktime(000date("m"$year), date("d"$year), );
    else
      
$snowdatearr[] = mktime(000date("m"$year), date("d"$year), );
  }
}

$average_snow_date date('d F' array_sum($snowdatearr) / count($snowdatearr) );
?>


EDIT: I realize some flaws in this so called function and made a little addition.... (might work)
« Last Edit: November 04, 2011, 09:53:18 AM by Labbs »

Offline Weather Display

  • Posts: 65,579
Re: Tag: Date of first snow
« Reply #9 on: November 04, 2011, 04:38:43 PM »
yes, I was thinking of converting to a Julian based time/date value (which is a number that is gets larger and larger)

Offline Weather Display

  • Posts: 65,579
Re: Tag: Date of first snow
« Reply #10 on: November 09, 2011, 01:53:31 AM »
I ended up using a function used for average wind direction
to get around the problems (i.e averaging a julian based number, that is linear, is not going to work, neither is averaging a day in the year if some values are 350 and some are 50

(note though any day over 360 is set to day 360 , to be used with the wind direction routines...so means boxing day will be the latest...)
then convert that back to a date
in a new .zip update, ready now

%firstsnowseason%
%firstsnowseasonav%

Offline Labbs

  • Posts: 314
  • Göteborg, Sweden
    • Lokalt Väder
Re: Tag: Date of first snow
« Reply #11 on: November 10, 2011, 07:47:30 AM »
Great, thanks Brian, these tags will most definitely work for me!  :D

Is the reset of %firstsnowseason% controlled by the "Month to reset snow" option?
In more southern parts but also here, closer to sea (and the warmer Gulf stream), we had years with very late snow between boxing day and new year. I do not know how the wind routine with 360 days will affect the average but not much I guess. Perhaps we should skip the holidays to get fewer days  ;)

Please let me know if you get around this in the future

Thank you for your time with this!
/Labbs


My tags:
%firstsnowseason%   --> 0/0/2011
%firstsnowseasonav% --> 05 of december



Online ed2kayak

  • CoCoRaHS PA-CD-6, Weather Underground KPAMECHA7, CWOP DW5425
  • Posts: 283
  • South Central PA
    • Cumberland Valley Weather
Re: Tag: Date of first snow
« Reply #12 on: November 14, 2011, 01:12:15 AM »
Windy,
Thanks for tags.
I'm only on my second year w/station. First snowfall last year= 12/16/10 and this year was early 10/29/11.  It yields this:

$firstsnowseason = '10/29/2011';
$firstsnowseasonav = '05/23/11';

I guess my question is, do I not have enough data for accurate estimate? ($firstsnowseasonav tag)
Thanks
Ed
CoCoRaHS PA-CD-6,  Weather Underground KPAMECHA7, CWOP DW5425

Offline Weather Display

  • Posts: 65,579
Re: Tag: Date of first snow
« Reply #13 on: November 14, 2011, 02:05:00 AM »
Quote
Is the reset of %firstsnowseason% controlled by the "Month to reset snow" option?
yes

ed2kayak, are you using the latest version of WD?
as the average tag should give the day of a month
e.g
05 of May

Online ed2kayak

  • CoCoRaHS PA-CD-6, Weather Underground KPAMECHA7, CWOP DW5425
  • Posts: 283
  • South Central PA
    • Cumberland Valley Weather
Re: Tag: Date of first snow
« Reply #14 on: November 14, 2011, 02:26:55 AM »
yes
t version of WD?
as the average tag should give the day of a month
e.g
05 of May

Yes, Weather-Display (10.37Q-(b87))

OK, day of month. I see what you mean. Humm I'll have to research that.

3 lines form the end:
http://cvweather.org/testtags.php?sce=view
« Last Edit: November 14, 2011, 02:32:06 AM by ed2kayak »
Ed
CoCoRaHS PA-CD-6,  Weather Underground KPAMECHA7, CWOP DW5425

 

cumulus