Author Topic: METAR display problem  (Read 124 times)

0 Members and 1 Guest are viewing this topic.

Offline Mearns

  • Senior Member
  • **
  • Posts: 60
    • Glenbervie Weather
METAR display problem
« on: February 07, 2019, 05:37:15 AM »
As my Metar display stopped working I applied get-metar-conditions-inc.php Version 1.17.  After years of the cloud level being reported in feet it now shows in metres and I can't work out how to change it back.

In Settings.php I have the temperature set to C.  This is overriding the F setting in wxmetar.php which would give me cloud display in feet and temperature in F and C in the Metar display.

Any ideas appreciated as to how I can get the cloud level back to feet?
Tony
Glenbervie, North East Scotland, http://www.glenbervie-weather.org

Vantage Pro 2 - Weather Display 10.37S Build 81

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6989
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: METAR display problem
« Reply #1 on: February 07, 2019, 11:34:43 AM »
You can force it to display Feet for cloud height by changing get-metar-conditions-inc
Code: [Select]
function mtr_get_cloud_cover($part)
{
  global $lang, $Debug, $mtrInfo, $metarPtr, $group, $UOMS;

  // Decodes cloud cover information. This function maybe called several times
  // to decode all cloud layer observations. Only the last layer is saved.
  // Format is SKC or CLR for clear skies, or cccnnn where ccc = 3-letter code and
  // nnn = altitude of cloud layer in hundreds of feet. 'VV' seems to be used for
  // very low cloud layers. (Other conversion factor: 1 m = 3.28084 ft)

  $doMetric = preg_match('|C|', $UOMS['TEMP']);
to
Code: [Select]
function mtr_get_cloud_cover($part)
{
  global $lang, $Debug, $mtrInfo, $metarPtr, $group, $UOMS;

  // Decodes cloud cover information. This function maybe called several times
  // to decode all cloud layer observations. Only the last layer is saved.
  // Format is SKC or CLR for clear skies, or cccnnn where ccc = 3-letter code and
  // nnn = altitude of cloud layer in hundreds of feet. 'VV' seems to be used for
  // very low cloud layers. (Other conversion factor: 1 m = 3.28084 ft)

  $doMetric = preg_match('|C|', $UOMS['TEMP']);
  $doMetric = false;
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Mearns

  • Senior Member
  • **
  • Posts: 60
    • Glenbervie Weather
Re: METAR display problem
« Reply #2 on: February 07, 2019, 11:48:45 AM »
Brilliant, Ken - thank you so much!
Tony
Glenbervie, North East Scotland, http://www.glenbervie-weather.org

Vantage Pro 2 - Weather Display 10.37S Build 81

 

anything