SafranCassiopee / php-metar-decoder

METAR weather observation decoder
GNU General Public License v3.0
50 stars 17 forks source link

Unable to handle missing dewpoint #16

Closed fralut closed 8 years ago

fralut commented 8 years ago

Looks like the libraray is unable to handle missing dewpoint like LSZL 131550Z AUTO 09005KT 060V120 9999NDV -SHRA SCT052 BKN067 13/// Q1008 RMK=

Invalid format:

Thanks for the great work !

inouire commented 8 years ago

Thanks for your contribution with a clear example. I'll look into it and let you know.

fralut commented 8 years ago

The issue was also new to me. Looks like that this was a well know issue with the "old" sensor generation. I have one case where we didn't received a dew point for 3 days. Thanks that you will have a look on this issue.

inouire commented 8 years ago

Hey @fralut. Now that I looked closer at your issue, I realize that the case you're mentionning is "normal". As you know, your sample METAR does not have the expected format for the temperature chunk. In strict parsing mode this leads to a fatal error (and so does any chunk that does not follow the norm) In non-strict mode it simply makes the whole temperature chunk invalid.

If you have a look at the non-strict decoding you can see that the pressure information is parsed correctly, despite the error message. This is because of parsing retry mechanism in non-strict mode. More information here.

Let me know if you have any question !