Repository: python-metar/python-metar

Issue:
Unparsed group 'SLP162' when SLP group placed ahead of remarks group.
The following METAR produces a ParserError:

METAR KCOF 191855Z 18015G22KT 7SM FEW049 SCT300 28/18 A3001 SLP162 RMK WND DATA ESTMD

Traceback:
```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jhaiduce/Development/python-metar/metar/Metar.py", line 499, in __init__
    raise ParserError(message)
metar.Metar.ParserError: Unparsed groups in body 'SLP162' while processing 'METAR KCOF 191855Z 18015G22KT 7SM FEW049 SCT300 28/18 A3001 SLP162 RMK WND DATA ESTMD'
```

Discussion:

Patch:
diff --git a/metar/Metar.py b/metar/Metar.py
index e3cf432..e9d59ba 100644
--- a/metar/Metar.py
+++ b/metar/Metar.py
@@ -1054,6 +1054,7 @@ class Metar(object):
         (VISIBILITY_RE, _handleVisibility, True),
         (TEMP_RE, _handleTemp, False),
         (PRESS_RE, _handlePressure, True),
+        (SEALVL_PRESS_RE, _handleSealvlPressRemark, False),
         (RECENT_RE, _handleRecent, True),
         (WINDSHEAR_RE, _handleWindShear, True),
         (COLOR_RE, _handleColor, True),


Test patch:
diff --git a/test/test_metar.py b/test/test_metar.py
index 19996a7..1252f1c 100644
--- a/test/test_metar.py
+++ b/test/test_metar.py
@@ -654,6 +654,19 @@ def test_cor_auto_mod():
 
     assert m.mod == 'COR AUTO'
 
+def test_slp_outside_remarks():
+    """
+    Test parsing of a METAR that lists sea level pressure after the altimeter
+    setting instead of in the remarks.
+    """
+
+    code = (
+        "METAR KCOF 191855Z 18015G22KT 7SM FEW049 SCT300 28/18 A3001 SLP162 "
+        "RMK WND DATA ESTMD"
+    )
+    m = Metar.Metar(code, year=2007)
+    m.press_sea_level.value() == 1016.2
+
 def test_wind_after_sky():
     """
     Test parsing of a METAR that lists wind after the sky groups