Skip to content

Commit

Permalink
Merge pull request #18 from vtoupet/master
Browse files Browse the repository at this point in the history
Add pressure component (additional field MA1)
  • Loading branch information
haydenth committed Jul 20, 2021
2 parents 98fe3b3 + dca7b1b commit 210477e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions ish_parser/Components/PressureComponent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from ..Pressure import Pressure
from .BaseComponent import BaseComponent

class PressureComponent(BaseComponent):
''' handle MA1 pressure type '''

def loads(self, string):
self.pressure_observation = {
'altimeter_setting': Pressure(int(string[0:5])/10.0, Pressure.HECTOPASCALS, string[5:6]),
'station_pressure': Pressure(int(string[6:11]) / 10.0, Pressure.HECTOPASCALS, string[11:12]),
}
1 change: 1 addition & 0 deletions ish_parser/Components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
from .SkyCoverSummationComponent import SkyCoverSummationComponent
from .SnowDepthComponent import SnowDepthComponent
from .SolarIrradianceComponent import SolarIrradianceComponent
from .PressureComponent import PressureComponent
2 changes: 1 addition & 1 deletion ish_parser/ish_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class ish_report(object):
'KF1': ['HOURLY-CALCULATED-TEMP', 6],
'KG1': ['AVERAGE-DEW_POINT', 11],
'KG2': ['AVERAGE-DEW_POINT', 11],
'MA1': ['ATMOSPHERIC-PRESSURE', 12],
'MA1': ['ATMOSPHERIC-PRESSURE', 12, PressureComponent],
'MD1': ['ATMOSPHERIC-PRESSURE-CHANGE', 11],
'ME1': ['GEOPOTENTIAL-HEIGHT', 6],
'MF1': ['ATMOSPHERIC-PRESSURE-STP-SLP', 12],
Expand Down

0 comments on commit 210477e

Please sign in to comment.