From 42e9cd1872a3e01372095c49e51ccfe8b0140f7d Mon Sep 17 00:00:00 2001 From: David Hoese <david.hoese@ssec.wisc.edu> Date: Fri, 21 Feb 2020 15:21:33 -0600 Subject: [PATCH] Add handling of the 4th version of the CSV/ACSII files --- aosstower/level_00/parser.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/aosstower/level_00/parser.py b/aosstower/level_00/parser.py index f49c59b..5406b13 100644 --- a/aosstower/level_00/parser.py +++ b/aosstower/level_00/parser.py @@ -141,6 +141,17 @@ class ParserV1V2(object): 'rh_shield_freq', 'rh', 'air_temp_6_3m', 'dewpoint', 'rtd_shield_freq', 'air_temp', 'solar_flux', 'precip', 'accum_precip', 'altimeter'] # , 'altimeter2'] + # These are the new fields in the input files but unused by the rest of + # the tower code. At the risk of breaking other pieces of software, these + # are not included in the above list, but are documented here for future + # reference. + # + # Altimeter2 (slightly different calculation, same units as Altimeter) + # LW_in (W/m^2) + # tempPyrg (Kelvin, temperature of pyrgeometer) + # pyrgTP (W/m^2, raw reading from the pyrgeometer thermopile) + # pyrgTC (W/m^2, temperature correction for the pyrgeometer) + # TC_110 (degC, this is a second air temperature in the new aspirated radiation shield) @staticmethod def maybe_mine(line): @@ -159,9 +170,9 @@ class ParserV1V2(object): def make_frame(self, line): parts = line.split(',') - if len(parts) not in [28, 29, 33]: - raise LineParseError("Expected 28, 29, or 33 parts", line) - version = {28: 1, 29: 2, 33: 3}[len(parts)] + if len(parts) not in [28, 29, 33, 34]: + raise LineParseError("Expected 28, 29, 33, or 34 parts", line) + version = {28: 1, 29: 2, 33: 3, 34: 4}[len(parts)] raw_data = [('version', version)] + list(zip(self.names, parts)) try: raw_data.append(('stamp', self._get_stamp(parts))) -- GitLab