From cce3e51002cf915e7481318db7845efd07ea3686 Mon Sep 17 00:00:00 2001 From: Jeremy Fee <jmfee@usgs.gov> Date: Fri, 13 May 2016 12:19:11 -0600 Subject: [PATCH] Allow configuration of observatory, instead of requiring IAGA headers --- geomagio/iaga2002/IAGA2002Parser.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/geomagio/iaga2002/IAGA2002Parser.py b/geomagio/iaga2002/IAGA2002Parser.py index d3044082c..e81610d4b 100644 --- a/geomagio/iaga2002/IAGA2002Parser.py +++ b/geomagio/iaga2002/IAGA2002Parser.py @@ -34,12 +34,13 @@ class IAGA2002Parser(object): ``numpy.nan`` when values are missing. """ - def __init__(self): + def __init__(self, observatory=None): """Create a new IAGA2002 parser.""" # header fields self.headers = {} self.metadata = { - 'network': 'NT' + 'network': 'NT', + 'station': observatory } # header comments self.comments = [] @@ -173,6 +174,7 @@ class IAGA2002Parser(object): if channel == EMPTY_CHANNEL: continue data = numpy.array(data, dtype=numpy.float64) + data[data == int(EIGHTS)] = numpy.nan data[data == EIGHTS] = numpy.nan data[data == NINES] = numpy.nan self.data[channel] = data -- GitLab