Skip to content

Latest commit

 

History

History
62 lines (50 loc) · 3.05 KB

File metadata and controls

62 lines (50 loc) · 3.05 KB

Data formats and validation

Binary records

LoopDataParserRevB parses 99-byte LOOP records. Alarm flags use least-significant-bit-first numbering; the four soil/leaf bytes each contain eight distinct flags. StormStartDate encodes month in bits 12–15, day in bits 7–11, and year since 2000 in bits 0–6. Missing values and invalid calendar dates become None.

ArchiveDataParserRevB parses 52-byte archive records. Its date word uses day in bits 0–4, month in bits 5–8, and year since 2000 in bits 9–15; time is hour * 100 + minute. Archive dates and LOOP storm dates must not share a decoder.

Parsers expose raw_bytes and a hexadecimal raw representation. Formats that include CRC expose crc_error. Parsing a LOOP packet does not itself raise an exception for a bad CRC; inspect that flag if using raw parser data for integrity-sensitive collection.

Protocol reference: Davis serial communications reference.

Normalized live data

JSON/list methods convert supported temperature fields to degrees Celsius, pressure to hPa, rain/ET to mm, and wind speed to m/s. Humidity stays in percent. Temperature conversion is (F - 32) * 5 / 9; offset temperature sensor codes first subtract 90. Other conversion factors are 33.86389 (inHg to hPa), 25.4 (inches to mm), and 0.44704 (mph to m/s).

Selected fields are rounded; the conversion and validation tables live on VantagePro2 in device.py. Numeric non-finite values are rejected. Known sensor sentinels and sanity ranges filter invalid readings. JSON omits sanity-check failures and lists their names under failed; lists retain positions with None. Inactive known alarms and missing optional sensor codes are also omitted from JSON, but are not added to failed.

Datetime objects serialize as ISO8601 strings. Live Datetime is the host clock at parsing time; archive timestamps are console-local times. Neither is automatically timezone-aware or converted to UTC. Sunrise/sunset strings are exported as HH:MM:00. Applications must supply timezone policy.

Archive compatibility limits

Archive wrappers currently reuse live normalization rules. They are not a complete SI schema: archive-only WindAvg, WindHi and RainRateHi retain parser units, and archive extra/soil/leaf temperatures have already had their offset removed before the shared normalization runs. Avoid those normalized temperature fields for scientific use until that mismatch is resolved; use raw archive fields with explicit conversions instead.

Archive field names and order differ from live fields. Derive column names from raw archive rows for list exports; do not align them with meta(). The legacy RainRate archive name is retained. Rain scaling assumes the existing hundredths-of-inch convention; verify rain collector calibration before interpreting rainfall from other bucket sizes.