I need some Leuven Info

I have once last fix to make to my Leuven site.

In the pane for current conditions (near the top of the page), the left side has values for min/max data.

In the screen image you can see that ‘Normals/today’ is not showing values.

Where do these values come from? I’ll try to fix them once I can find the code that pulls the values.

Thanks,
Mort


values.JPG

No good news for this problem.
This is the call done to WU to get the almanc data , were –your key– is your WU api key

http://api.wunderground.com/api/--your--key/almanac/lang:EN/q/39.95495,-76.66004.xml

This is the data returned:

<response>
	<version>0.1</version>
	<termsofService>http://www.wunderground.com/weather/api/d/terms.html</termsofService>
	<features>
		<feature>almanac</feature>
	</features>
	<almanac>
		<airport_code>KTHV</airport_code>
		<temp_high>
		<normal>
		<F>0</F>
		<C>-17</C>
		</normal>
		<record>
		<F>89</F>
		<C>31</C>
		</record>
		<recordyear>2008</recordyear>
		</temp_high>
		<temp_low>
		<normal>
		<F></F>
		<C></C>
		</normal>
		<record>
		<F>42</F>
		<C>5</C>
		</record>
		<recordyear>2001</recordyear>
		</temp_low>
	</almanac>
</response>

For your location there is no usable almanac data returned. A normal high of 0 for today seems not correct to me, same for a normal low of of . The METAR (airport) used by WU is the same as in your settings and when it is directly called, it returns the same information.

I have to adapt the script to not display these errors, or better to make a setting to not display that “normals” line.
WU returns a message when there is no data, the script reacts to that, but this is incomplete data.

===

QUESTION: Is there another, nearby airport, which more or less the same weather-conditions as your place?

Wim

Hi Wim,

Whew, I thought I’d messed something up.

There’s 2 METAR airports, KCXY and KLHQ, only 10-20 miles away. Is that something that might work?

Thanks,
Mort

I will try my time tomorrow. The first call is using your latitude/longitude. Only when NO DATA is returned, the script switches to the airport. But this time the data is incomplete. Will be back my-tomorrow.

Wim

That explains why when I used 4 different METAR’s close by I didn’t see a change.

Talk to you tomorrow & thanks,

Mort

And the almanac data is only loaded once every day, so multiple calls during the same day, only load the data from the cache. This is with most forecast data and almanac data which do not change until a certain time. For forecast data, the next run is known as it is inside the retrieved xml. For the wu-alamanac the data is re-fteched when there is a new day compared to the cached data. Same for the USNO moon info.

So when doing tests always delete the corresponding testfiles in the cache, or try &force=xxx where xxx is almanac or metno or usno, depending on which data you want to forcibly refresh.

Will add this in much clearer wording to the WiKi also.

Wim

KLHQ is Lancaster Ohio, are you thinking of KLNS?

KCXY (Harrisburg) is close but it’s right on the river so I would be concerned about the different environment.

Also I see KDMW which is in your area.

You’re right - wrong Lancaster.

I think KDMW is not so close in Maryland.

These are probably the best for me:

KTHV - York where I’m at (and my current default)
KCXY - Harrisburg ,PA about 15 miles away
KHAR - Harrisburg International (who knew?), PA

I’m not sure on how to clear the cache, Wim. But it’ll still read the incomplete WU data?

KDMW is listed as 20 nautical miles from KTHV, KCXY is 18 nm, so it’s not so different.

I don’t find KHAR, but I see KMDT as Harrisburg International, only 4 nm from KCXY which seems rather close to me :?

KMDT is the correct one. No idea where I came up with KHAR.

I made a "special’ version of the almanac script for your situation.
It will use a METAR specified in the script (line 54, currently KMDT) to obtain the almanac data from WU. So no adaptions in your settings as the other scripts depend on them.

  1. make a copy of weather??/wuforecast/wualmanac.php
  2. unzip attachement
  3. replace current version with this new version of wualmanac.php

Delete the almanac data weather??/cache/wu_almanac_F

The normals should appear on the dashboard then.

Wim


wualmanac.php.zip (3.88 KB)

That fixed it, Wim.

Thanks so much,

Mort

One other thing I don’t understand, Wim.

On the main page to the right in "almanac’, it always says ‘(- - 3 minutes)’. What’s that mean?


almanac.JPG

Stupid me, off course that was not visible when daylight became longer, it would read + 2 minutes. And the Template was tested/finished then. But after 20th of June on the Northen part of our world, daylight became shorter. It simply tries to tell you how longer or shorter the daylight is compared to yesterday.
Script weather27/wsDataGet.php lines 114-116 read now

if ($less_more < 0) 
        {$daylight_trend        =  '- '.$less_more.' '.langtransstr('minutes');} 
else    {$daylight_trend        =  '+ '.$less_more.' '.langtransstr('minutes');} 

change the line 115 to

        {$daylight_trend        = $less_more.' '.langtransstr('minutes');} 

by removing the '- '. minus with its quotes and the point after it.

That should take care of it.

ALWAYS make a copy of a script you are going to edit. And always use a decent UTF aware editor such as notepad++.

Wim

That was quick, Wim. It looks good and I now know what it means.

Appreciate it as always,
Mort