Author Topic: Support of the "Leuven" Forecast scripts (NEW)  (Read 471 times)

0 Members and 1 Guest are viewing this topic.

Offline ghera

  • Member
  • *
  • Posts: 8
Support of the "Leuven" Forecast scripts (NEW)
« on: June 16, 2022, 08:47:41 AM »
It seems that the author of the previous topic with the same subject

https://www.wxforum.net/index.php?topic=36478.0

has locked the discussion, although there are still issues to be talked and solved.

For instance, some users of the Leuven Forecast Script noticed that data from YR.No on users website is slightly different from those on YR.NO. (+/- one or two degrees)

I made some research and found that the script from Will does not take into account the altitude for the place, and for this reason, the data differs.

I made some changes into the script and now I have the same data, both on my site and on yr.ro.

In metric_settings.php file, after:

$yourLatitude   = 'xx.xxxx';             #   North=positive, South=negative decimal degrees
$yourLongitude   = 'xx.xxxx';               #   East=positive, West=negative decimal degrees

I added:

$youraltitude   = 'xxx';

that needs to be filled with place's altitude.

After that, go to wsIncMetnoCreate.php file and add the altitude parameter, like this:

$ws_metno_url     = 'https://api.met.no/weatherapi/locationforecast/2.0/classic/?lat='.$yourLatitude.'&lon='.$yourLongitude.'&altitude='.$youraltitude;

Clear the cache, run the script and compare the results. Hope it helps.

I noticed that if no altitude is stated, the script gets data from another altitude (in my case, 380 m instead of 250 m), and this causes the difference for temperatures.

« Last Edit: June 16, 2022, 09:25:47 AM by ghera »

 

anything