Skip to content

Commit

Permalink
FIX: improve CF and gliderdac compliance; add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jklymak committed Jul 14, 2024
1 parent 0a823d7 commit 9e60d17
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions pyglider/ncprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,19 @@ def extract_timeseries_profiles(inname, outdir, deploymentyaml, force=False):

dss.attrs['date_modified'] = str(np.datetime64('now')) + 'Z'

# ancillary variables::
if True:
to_fill = ['temperature', 'pressure', 'conductivity',
'salinity', 'density', 'lon', 'lat', 'depth']
for name in to_fill:
qcname = name + '_qc'
dss[name].attrs['ancillary_variables'] = qcname
if qcname not in dss.keys():

dss[qcname] = ('time', 2 * np.ones(len(dss[name]), np.int8))
dss[qcname].attrs = utils.fill_required_qcattrs({}, name)
# 2 is "not eval"
# ancillary variables: link and create with values of 2. If
# we dont' want them all 2, then create these variables in the
# time series
to_fill = ['temperature', 'pressure', 'conductivity',
'salinity', 'density', 'lon', 'lat', 'depth']
for name in to_fill:
qcname = name + '_qc'
dss[name].attrs['ancillary_variables'] = qcname
if qcname not in dss.keys():

dss[qcname] = ('time', 2 * np.ones(len(dss[name]), np.int8))
dss[qcname].attrs = utils.fill_required_qcattrs({}, name)
# 2 is "not eval"
# outname = outdir + '/' + utils.get_file_id(dss) + '.nc'
_log.info('Writing %s', outname)
timeunits = 'nanoseconds since 1970-01-01T00:00:00Z'
Expand Down

0 comments on commit 9e60d17

Please sign in to comment.