Wind Detail addon page for WD-AJAX-PHP-USA template

I have modified the Temperature Detail addon page (http://discourse.weather-watch.com/t/44094) to show wind instead.

But i have some problem to get the High and average wind speed to show up right, and the average direction as well.

Here is the page http://www.axelvold.net/wd/winddetail.php i have attached the file as well.

Please take a look and tell me what I have to change to get it working.

One more thing, I’m a beginner with php programing so be nice. :roll:


wd.zip (6.21 KB)

Nice job on that!

Thanks… Got it going here…

http://www.snoqualmieweather.com/wxwinddetail.php

Now to try and fix the 35 validation errors.

Just gonna have to figure out how to get it to fit on a narrow template.

http://www.cnyweather.com/winddetail.php?year=2009

try changing this in the .css file…

#wind table {
width: 100%;
border-collapse: collapse;

I’ve got the width at 20% now. Didnt change anything

Will it fit on the narrow template? It looks like there is too many columns to squeeze that narrow. I think it is the data in the fields that is making it that wide.

Gonna probably have to either get the direction out of cut the table into Jan-July, Aug-Dec.

Attached is a Validated copy if anyone is interested…


winddetail.txt (26 KB)

I think the wind speed colors need converting to English. This is showing 30-40 MPH gust in the red hurricane force color. http://www.cavecountryweather.com/winddetail.php?year=2009

Looks like you can change the values here…



/Calculate colors depending on value

    function ValueColor(&$value) {
      if ($value <= 0.3) {
        return '#FFFFFF';
      } else {
        if ($value <= 1.5) {
          return '#CCFFFF';
        } else {
          if ($value <= 3.4) {
            return '#99FFCC';
          } else {
            if ($value <= 5.4) {
              return '#99FF99';
            } else {
              if ($value <= 7.9) {
                return '#99FF66';
              } else {
                if ($value <= 10.7) {
                  return '#99FF00';
                } else {
                  if ($value <= 13.8) {
                    return '#99CC00';
                  } else {
                    if ($value <= 17.1) {
                      return '#CCCC00';
                    } else {
                      if ($value <= 20.7) {
                        return '#FFCC00';
                      } else {
                        if ($value <= 24.4) {
                          return '#FF9900';
                        } else {
                          if ($value <= 28.4) {
                            return '#FF6600';
                              } else {
                          if ($value <= 32.6) {
                            return '#FF3300';
                            } else {
                          if ($value > 32.7) {
                            return '#FF0000';


Ok, That looks better.

Someone who has figured out how how to get the wind direction and maximum wind speed in there?

Worth noting that default color codings are based on m/s data values. Check NOAA report for unit of measurement and change values of logical expression accordingly e.g. km/h. Nice job!

The colors are based on the Beaufort scale, so if you change to some other unit it should be ok.

Lars, I made a couple of changes in the attached file.
One change would allow a user to just select what wind unit they are using (mph, kmh, kts, or m/s) and the script would handle the rest.

I also added some code that will display a wind direction label for the month. But I don’t know how accurate averaging wind directions really is. For example, if you have two days with the wind from the north one day and from the south the next day, what should the ‘average’ be. The script will say east. Also, the wind direction listed in the dailynoaa reports is for the ‘dominant’ wind direction, not the average wind direction.


wxwinddetail.txt (27.7 KB)

You guys who think this stuff up are GREAT!!!

Murray, how’d you do this page? http://weather.wildwoodnaturist.com/wxrecords.php

You have a great site. 8)

Tony

This is great, much appreciated.

What should i do to get the high wind of the month to be shown at the bottom instead of the average speed?

Tony - After I had ten years of data, I wrote an APL program to extract the highs, lows, rain, mtd, and ytd from the Weather Display logs. I also had a couple of years of data from before I started using Weather Display. I used this to update an almanac page on the website.

After I started using the PHP templates, I modified the program to produce csv files for my wxrecords.php script.

But unless you have several years of data, I don’t know how useful it is to have a records page.

Gotcha Murray.

My WD data goes back to 8/2006 and I’ve got VWS before that starting at 5/2005.