Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Metar files location/names

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Metar files location/names

Post by BCJKiwi »

Ken,
Would you mind explaining the workings of the storage and location of the Metar files.

We download Metar from 3 locations. The 3 files are stored in the standard location as ./cache/metarcache-XXXX.txt
However we also see a file at ./metar-XXXX.txt. This has always the same (being the first file) when I have seen it.
The wxstatus page appears to use this latter file for the currency check. However this file is frequently old and wxstatus accordingly indicates Metar as NOT Current. However the ./cache/metarcache-XXXX.txt is current.
I have modified the code in wxstatus to check the ./cache/metarcache-XXXX.txt.

What is the purpose of the ./metar-XXXX.txt file and when is it created?

Thanks
User avatar
saratogaWX
Posts: 1185
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Metar files location/names

Post by saratogaWX »

Hmmm..

Both the include-metar-display.php and the CU-defs.php use the function inside get-metar-conditions-inc.php file and that file uses

$metarCacheName = $cacheFileDir."metarcache-$icao.txt";

to store the cache file in the cache directory.

I don't know where 'metar-$icao.txt' comes from. I just checked my test site cache directory and find no 'metar-$icao.txt' named files.. only 'metarcache-$icao.txt' formatted.

Perhaps you have some other metar script running?

And the default include-wxstatus.php page does not have a built-in check for the metar cache freshness...

Best regards,
Ken
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Metar files location/names

Post by BCJKiwi »

I have added some additional tests to the wxstatus page but did not think metar was one of them. However I have checked the original source and Metar is not there so I must have added it. I'll leave it the way it is now - checking the file in ./cache/

The 'metar-$icao.txt' is not in the cache but in the same directory as all the scripts.
Have done some testing and find it is created when ajax-dashboard is run.
Further searching across all scripts found that cloudbase.php has it's own metar collection, age checking and storage routines and it is using $metarFile = 'metar-'.$icao.'.txt'; so is presumably the creator of the mystery file. This particular script is ex basheva, yourself and Ray @ Tzouhalem-Maple Bay who appears last so presumably was the last editor. The script is dated 04 Aug 2011 @00h00 and has no version number.
I will do some testing with the options as it seems metar is only used for cloud height in the cloudbase script.
Post Reply