I got a problem with the value $devicemetar.pressure it isn’t updated but in the device itself it is…can you check this?
-
New plugin pimatic-metar-weather
-
@temp said in New plugin pimatic-metar-weather:
I got a problem with the value $devicemetar.pressure it isn’t updated but in the device itself it is
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
Released version 0.9.1 which fixes the attributes update issue and adds information on precipitation
Note: You have probably noticed the value “VRB” for wind direction. As @Swen stated earlier a value of 0 degrees indicates wind from varying directions. Si, VRB = Variable direction
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
There is a bug between WD 350 and 360 (or 0 or 359)… Get Nundefine. Can you check this pls?
Yes thats true WD from 0 can result in VRB but it must be as less then 3 or 4 knots. 5 and above is a wind direction north!
-
@Swen said in New plugin pimatic-metar-weather:
There is a bug between WD 350 and 360 (or 0 or 359)
This should have been fixed in version 0.9.1. Did you already install the update?
WD from 0 can result in VRB but it must be as less then 3 or 4 knots. 5 and above is a wind direction north!
Thanks for pointing this out! I wasn’t aware of this constraint!
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
Oh man… Yes now i have. Thanks…
-
@mwittig said in New plugin pimatic-metar-weather:
VRB but it must be as less then 3 or 4 knots. 5 and above is a wind direction north!
Found references for that, but with different VRB ranges:
- http://weather.cod.edu/notes/metar.html (VRB < 7 knots)
- http://meteocentre.com/doc/metar.html#13 (VRB <= 3 knots)
- http://www.met.tamu.edu/class/metar/quick-metar.html (VRB <= 6 knots)
- https://www.wunderground.com/metarFAQ.asp (VRB < 7 knots)
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
I never see more 5 knotes VRB. This are sources are not official they and based on none official documents. I never see VRB with 4 or 5 knots. It can maybe in most cases if you have wind with 5 knots and its a little variable then you get 260V350 as addition information… So the XML might be well, but it’s not well decoded. If you want to get the best weather information, you need to decode a metar code by yourself. We can say ok max 6 knotes but in real live i never see VRB06.
There is a point more! You can get light wind with 2 knots from a direction. So if you don’t get any informations about VRB in XML file you are not really sure if VRB or not.
The best is to decode this kind of metar:
METAR EDVE 111920Z VRB02KT 3000 BR FEW001 SCT003 BKN012 M01/M01 Q1025
I can see that temp and dew point is same… If you get this, i can say hey we have fog. And yes the visibility is down to 3km and we have fee clouds with 100ft down and scattered up to 300 ft and broken on 1200ft… Normally this sounds like a CATII approach or CATIII. So category for approaching an airport with low visibility… OK tooooo much information.
My over 10 years aviation experience i never see VRB and higher than 4 knots…
So if you get 0 to 0 the wind is calm.
Soooo… Its your decision to say wind is VRB or not. If you say its VRB it can be wrong if you say 0/3 it can be wrong too… If i must take this decision based on xml data, i will do:
if 0/2 oder 0/3 then VRB all others can be without VRB.
Or you start do decode the real metar code and get exactly this information what you want and what you need.
`function metar_raw_decoder($metartaf){
$do_out = array(); $parts = explode(' ',$metartaf); $cntdata = count($parts); for($i=0;$i<$cntdata;$i++){ #get date if(preg_match('/([0-9]{2})([0-9]{2})([0-9]{2})Z/',$parts[$i],$part)){ $do_out['reptime']['day'] = $part[1]; $do_out['reptime']['hour'] = $part[2]; $do_out['reptime']['min'] = $part[3]; } #get wind if(preg_match('/([0-9]{3}|VRB)([0-9]{2,3})G?([0-9]{2,3})?KT/',$parts[$i],$part)){ $do_out['wind']['dir'] = ($part[1]/1); $do_out['wind']['power'] = ($part[2]/1); if(isset($part[3])){ $do_out['wind']['gusts'] = ($part[3]/1); } } if(preg_match('/^([0-9]{3})V([0-9]{3})$/',$parts[$i],$part)){ $do_out['wind']['change'] = $part[0]; $do_out['wind']['change_from'] = ($part[1]/1); $do_out['wind']['change_to'] = ($part[2]/1); } #get visibility if(preg_match('/^[0-9]{4}$/',$parts[$i],$part)){ $do_out['visibility']['base'] = $part[0]; } if(preg_match('/^([0-9]{4})([A-Z])$/',$parts[$i],$part)){ $do_out['visibility']['distance'] = $part[1]; $do_out['visibility']['direction'] = $part[2]; } #get clouds '^(VV|FEW|SCT|BKN|OVC)([0-9]{3}|///)(CB|TCU)?$' if(preg_match('/^(VV|FEW|SCT|BKN|OVC)([0-9]{3}|\/\/\/)(CB|TCU|ACC)?$/',$parts[$i],$part)){ $do_out['cloud']['discription'] = $part[1]; $do_out['cloud']['height'] = $part[2]; if(isset($part[3])){ $do_out['cloud']['special'] = $part[3]; } } #get cavok if(preg_match('/^CAVOK$/',$parts[$i],$part)){ $do_out['CAVOK'] = $part[0]; } #get cavok if(preg_match('/^NSC/',$parts[$i],$part)){ $do_out['NSC'] = $part[0]; } #get temperature if(preg_match('/^([0-9\-]{2,3})\/([0-9\-]{2,3})$/',$parts[$i],$part)){ $do_out['temp']['norm'] = ($part[1]/1); $do_out['temp']['dewpoint'] = ($part[2]/1); } #get temperature if(preg_match('/^M([0-9\-]{2,3})\/M([0-9\-]{2,3})$/',$parts[$i],$part)){ $do_out['temp']['norm'] = -($part[1]/1); $do_out['temp']['dewpoint'] = -($part[2]/1); } #get pressure if(preg_match('/^Q([0-9]{4}$)/',$parts[$i],$part)){ $do_out['pressure'] = $part[1]; } #get tafdatetime if(preg_match('/^([0-9\-]{2})([0-9\-]{2})\/([0-9\-]{2})([0-9\-]{2})/',$parts[$i],$part)){ $do_out['taftime']['dat_from'] = $part[1]; $do_out['taftime']['time_from'] = $part[2]; $do_out['taftime']['dat_to'] = $part[3]; $do_out['taftime']['time_to'] = $part[4]; } #get becoming if(preg_match('/^BECMG/',$parts[$i],$part)){ $do_out['BECMG'] = $part[0]; } #get probability if(preg_match('/^(PROB)([0-9]{2})$/',$parts[$i],$part)){ $do_out['prob']['main'] = $part[1]; $do_out['prob']['chance'] = $part[2]; } #get temporär if(preg_match('/^TEMPO$/',$parts[$i],$part)){ $do_out['TEMPO'] = $part[0]; } #get nosig if(preg_match('/^NOSIG$/',$parts[$i],$part)){ $do_out['NOSIG'] = $part[0]; } #weather proximity discriptor precipitation if($i>3){ if(preg_match('/^([\-\+])?([A-Z]{2})([A-Z]{2})$/',$parts[$i],$part)){ $do_out['pdp']['proximity'] = $part[1]; $do_out['pdp']['discriptor'] = $part[2]; $do_out['pdp']['precipitation'] = $part[3]; } } #weather obscuration if(preg_match('/^([A-Z]{2})$/',$parts[$i],$part)){ $do_out['obscuration'] = $part[0]; } #cancellation if(preg_match('/^CNL$/',$parts[$i],$part)){ $do_out['CNL'] = $part[0]; } } return $do_out;
}
function abbi($abbi){
switch($abbi){ case "N": $abbiout = "Norden"; break; case "E": $abbiout = "Osten"; break; case "S": $abbiout = "Süden"; break; case "W": $abbiout = "Westen"; break; case "BECMG": $abbiout = "Wetter ändert sich"; break; case "TEMPO": $abbiout = "Temporär"; break; case "PROB": $abbiout = "Wahrscheinlichkeit:"; break; case "NOSIG": $abbiout = "Keine Änderung in den n¨chsten zwei Stunden zu erwarten"; break; case "CAVOK": $abbiout = "Wolken und Sicht sind in Ordnung"; break; case "VRB": $abbiout = "Variabel"; break; case "G": $abbiout = "Bö:en mit bis zu"; break; case "BR": $abbiout = "Dunst"; break; case "FG": $abbiout = "Nebelig"; break; case "VC": $abbiout = "Örtlich"; break; case "MI": $abbiout = "flach"; break; case "PR": $abbiout = "stellenweise"; break; case "BC": $abbiout = "einzelne Schwaden"; break; case "DR": $abbiout = "fegend"; break; case "BL": $abbiout = "treibender"; break; case "SH": $abbiout = "Schauer"; break; case "RA": $abbiout = "Regen"; break; case "TS": $abbiout = "Gewitter"; break; case "FZ": $abbiout = "gefrierender"; break; case "DZ": $abbiout = "Sprühregen"; break; case "SN": $abbiout = "Schnee"; break; case "SG": $abbiout = "Schneegriesel"; break; case "IC": $abbiout = "Eisnadeln"; break; case "PL": $abbiout = "Eiskörper"; break; case "GR": $abbiout = "Hagel"; break; case "SH": $abbiout = "Reif/Frostgraupel"; break; case "UP": $abbiout = "Unbestimmter Niederschlag"; break; case "FU": $abbiout = "Rauch"; break; case "VA": $abbiout = "Vulkanasche"; break; case "DU": $abbiout = "verbreitet Staub"; break; case "SA": $abbiout = "Sand"; break; case "HZ": $abbiout = "trockener Dunst"; break; case "PY": $abbiout = "Sprühnebel/Gischt"; break; case "FEW": $abbiout = "Bedeckung 1 bis 2 Achtel"; break; case "SCT": $abbiout = "Bedeckung 3 bis 4 Achtel"; break; case "BKN": $abbiout = "Bedeckung 5 bis 7 Achtel"; break; case "OVC": $abbiout = "Bedeckt"; break; case "NSC": $abbiout = "Wolkenfrei bis 5000ft ca. 3km Höhe"; break; case "CB": $abbiout = "Cumulonimbus Wolken"; break; case "TCU": $abbiout = "Aufgetürmte Cumulus Wolken"; break; case "BECMG": $abbiout = "Wetter ändert sich"; break; case "CNL": $abbiout = "Gestrichen"; break; default: $abbiout = "Uebersetzung von ".$abbi." fehlt."; break; } return $abbiout;
}
function compass_converter($dir){
switch ($dir){ case 338 <= $dir: $dirrose = "Nord"; break; case 293 <= $dir: $dirrose = "NordWest"; break; case 248 <= $dir: $dirrose = "West"; break; case 203 <= $dir: $dirrose = "SüdWest"; break; case 180 <= $dir: $dirrose = "Süd"; break; case 113 <= $dir: $dirrose = "SüdOst"; break; case 90 <= $dir: $dirrose = "Ost"; break; case 23 <= $dir: $dirrose = "NordOst"; break; case 0 <= $dir: $dirrose = "Nord"; break; } return $dirrose;
}
function beaufort_converter($wind){
switch ($wind){ case $wind == 1: $windbf = "0"; break; case 71 <= $wind: $windbf = "12"; break; case 63 <= $wind: $windbf = "11"; break; case 55 <= $wind: $windbf = "10"; break; case 47 <= $wind: $windbf = "9"; break; case 40 <= $wind: $windbf = "8"; break; case 33 <= $wind: $windbf = "7"; break; case 27 <= $wind: $windbf = "6"; break; case 21 <= $wind: $windbf = "5"; break; case 15 <= $wind: $windbf = "4"; break; case 10 <= $wind: $windbf = "3"; break; case 6 <= $wind: $windbf = "2"; break; case 3 <= $wind: $windbf = "1"; break; } return $windbf;
}`
Piece code of my decoder.
-
@Swen said in New plugin pimatic-metar-weather:
So the XML might be well, but it’s not well decoded.
Well, yes and no. The decoded METAR data does not contain an indication for VRB, but just 0 degrees. Fortunately, the XML data also contains the raw METAR. So, I can check the raw data for VRB. This way I don’t need to both about wind speed.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
So i ask my pilot friends… They say VRB can be up than 6 KT… If you look into a TAF…
So we ask google: https://www.google.de/?gws_rd=ssl#q=metar+VRB06KT
So most is TAF…