Compare commits

..

No commits in common. "eee4c781cc8088e64183af4d3efc998870a6bce7" and "2c7c1cfc840e29ec69073eb21139e81d381b3c8c" have entirely different histories.

View file

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