Skip to content

Commit

Permalink
ENH: update meta header values
Browse files Browse the repository at this point in the history
  • Loading branch information
jklenzing committed Oct 4, 2023
1 parent 27ebf39 commit 7e213e8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pysatNASA/instruments/reach_dosimeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 7e213e8

Please sign in to comment.