Index PHPmyEasyWeather PHPmyEasyWeather Homepage

Home
Demo
FAQ
Download
> Documentation
Contact
      

getTafType

getTafType -- return type of a partial TAF string

Description

Array getTafType (string $TAF);

getTafType will return the type and the general information about the structure of a partial TAF string returned by getTafParts. If you exploded a TAF (what you have to do in any case!) into its partial MAIN / PROB / TEMPO / BECMG (and american notation of FMXXXX) - groups then getTafType will give you the answer what kind the partial TAF code is.

getTafType returns an Array with 3 indexes: "type", "chance" and "init"

  • "type" gives you the type of a partial TAF string, it can be either: "main", "becmg", "tempo", "prob" or "amfm" (for "american FM"). If there is returned "main" it is either a whole TAF string or the initial string before the first PROB / TEMPO / BECMG / FM - group is reported.
    Note: If there is reported "BECMG" or "TEMPO" (or possible american "FMXXXX" but I have never seen this yet) after "PROB", getTafType ALWAYS will return "becmg" or "tempo" (or "amfm") irrespectively the leading "PROB", but it will return you the chance reported with "PROB". "prob" only will be returned as a type if it is not followed by "BECMG" or "TEMPO" (or "FMXXXX"). I had hard to think about it before deciding. You must know that TAF encoding is not really a logical one like programmers or computers are used. And there is really more than one way to encode the equivalent weather situation. Well, meteorologists just are humans...
  • "chance" this is the chance reported in "PROB". Without leading "PROB" it will be 100 (percent of course)
  • "init" this is the number of initializing terms until real data follows. e.g.:
    PROB50 TEMPO 1015 ...      -> "init" will be 3 and "type" -> "tempo"
    PROB50 BECMG ...           -> "init" will be 2 and "type" -> "becmg"
    PROB50 1010 ...            -> "init" will be 2 and "type" -> "prob"
    TEMPO 1010 ...             -> "init" will be 2 and "type" -> "tempo"
    TEMPO ...                  -> "init" will be 1 and "type" -> "tempo"
    PROB50 ...                 -> "init" will be 1 and "type" -> "prob"
    GCRR 120808 ...            -> "init" will be 0 and "type" -> "main"
      

Previous Up Next