Skip to content

Commit

Permalink
Allow adjusting field name in RADOLAN parser
Browse files Browse the repository at this point in the history
  • Loading branch information
jdemaeyer committed Dec 29, 2023
1 parent fccbe0b commit 7dddbb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dwdparse/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ class RADOLANParser(Parser):
WIDTH = 1100
INTERVAL = 5
PRECISION = 'E-02'
FIELD_NAME = 'precipitation_5'

def parse(self, path):
with tarfile.open(path, 'r:bz2') as tar:
Expand Down Expand Up @@ -844,7 +845,7 @@ def parse_data(self, f):
if sys.byteorder != 'little':
raw.byteswap()
return {
'precipitation_5': self.process_raw_data(raw),
self.FIELD_NAME: self.process_raw_data(raw),
}

def process_raw_data(self, raw):
Expand Down

0 comments on commit 7dddbb4

Please sign in to comment.