Compare commits

...

3 commits

View file

@ -209,7 +209,13 @@ class RAOBObs():
if token[0:2] == '//':
wind_dir = None
else:
wind_dir = meters_second(float(token[0:3]) + base_dir)
v100 = int(token[0]) if token[0] != '/' else 0
v10 = int(token[1]) if token[1] != '/' else 0
v1 = int(token[2]) if token[2] != '/' else 0
value = float(100.0 * v100 + 10.0 * v10 + v1)
wind_dir = meters_second(value + base_dir)
if token[3:5] == '//':
wind_speed = None
@ -269,12 +275,12 @@ class RAOBObs():
# Ignore tokens where height is not known.
#
if num == '///':
return None
return dict()
pressure = self.code_to_pressure(code)
if pressure is None:
return None
height = None
elif pressure == 1000:
height = self.calc_1000mb_height(float(num))
elif pressure <= 850 and pressure > 700:
@ -334,6 +340,7 @@ class RAOBObs():
def parse_ttaa_sample(self, tokens: list[str]) -> dict:
if tokens[0][0:2] == '99':
hp = self.parse_pressure(tokens[0])
hp['height'] = 0
else:
hp = self.parse_height_pressure(tokens[0])
@ -634,7 +641,7 @@ class RAOBReader():
timestamp = data['timestamp']
samples = data['samples']
sounding = self.sounding(station, timestamp)
sounding = self.sounding(station, timestamp[0:4])
for data in samples:
pressure = data.get('pressure')