Skip to content
Snippets Groups Projects
Commit 6dd4f93b authored by Jacques Grelet's avatar Jacques Grelet
Browse files

test if global ASCII, ODV or NETCDF is defined in toml config file

parent 5107b22b
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,7 @@ def writeTrajectory(cfg, device, fe):
# write header and return file descriptor
fd = writeHeader(cfg, device, 'Trajectories')
# write variables and unit
# write variables and unit, deletes variables already in the header
for k in fe.keys:
if k == 'ID' or k == 'DAYD' or k == 'LATITUDE' or k == 'LONGITUDE':
continue
......
......@@ -519,14 +519,16 @@ class Profile:
self.read_files(cfg, ti)
# write ASCII hdr and data files
ascii.writeProfile(cfg, ti, self)
if cfg['global']['ASCII']:
ascii.writeProfile(cfg, ti, self)
# write ODV file
# write the ODV file
if cfg['global']['odv']:
odv.writeProfile(cfg, ti, self)
# write the NetCDF file
netcdf.writeProfile(cfg, ti, self)
if cfg['global']['NETCDF']:
netcdf.writeProfile(cfg, ti, self)
# for testing in standalone context
......
......@@ -367,13 +367,16 @@ class Trajectory:
self.read_files(cfg, ti)
# write ASCII hdr and data files
ascii.writeTrajectory(cfg, ti, self)
if cfg['global']['ASCII']:
ascii.writeTrajectory(cfg, ti, self)
# write the ODV file
if cfg['global']['odv']:
odv.writeTrajectory(cfg, ti, self)
# write the NetCDF file
netcdf.writeTrajectory(cfg, ti, self)
if cfg['global']['NETCDF']:
netcdf.writeTrajectory(cfg, ti, self)
# for testing in standalone context
# ---------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment