From 7e213e8310bd0b4dbf27775f930a5f022d347661 Mon Sep 17 00:00:00 2001 From: Jeff Klenzing Date: Wed, 4 Oct 2023 14:07:53 -0400 Subject: [PATCH] ENH: update meta header values --- pysatNASA/instruments/reach_dosimeter.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pysatNASA/instruments/reach_dosimeter.py b/pysatNASA/instruments/reach_dosimeter.py index 8400a755..3ff9debe 100644 --- a/pysatNASA/instruments/reach_dosimeter.py +++ b/pysatNASA/instruments/reach_dosimeter.py @@ -32,6 +32,7 @@ import datetime as dt import functools +from pysat._meta import MetaHeader from pysat.instruments.methods import general as mm_gen from pysat.utils.io import load_netcdf @@ -138,6 +139,17 @@ def load(fnames, tag=None, inst_id=None): data, meta = load_netcdf(fnames, epoch_name='Epoch', meta_kwargs={'labels': labels}) + # Update header variables + header = meta.header.to_dict() + new_header = {} + for key in header.keys(): + new_key = key.replace('-', '_to_') + new_header[new_key] = header[key] + if np.isnan(new_header['Notes']): + new_header['Notes'] = '' + + meta.header = MetaHeader(new_header) + return data, meta