Commit 7f398fb1 authored by R.K.Garcia's avatar R.K.Garcia
Browse files

expand debug output using goesr.rockfall.debug

parent f00a3bc1
......@@ -681,8 +681,8 @@ class tests(unittest.TestCase):
n_frames += 1
print("%d frames" % n_frames)
def write_netcdf(path, as_radiances=False, filename_format="{}.nc", complevel=None):
from goesr.rockfall import rename, nc_write, autoscale
def write_netcdf(path, as_radiances=False, filename_format="{}.nc", complevel=None, debug=False):
from goesr.rockfall import rename, nc_write, autoscale, debug
fnstem = os.path.splitext(os.path.split(path)[-1])[0]
fn = filename_format.format(fnstem)
pathout = os.path.abspath(fn)
......@@ -692,11 +692,15 @@ def write_netcdf(path, as_radiances=False, filename_format="{}.nc", complevel=No
if complevel:
extra_data_attrs['.complevel'] = complevel if isinstance(complevel, int) else 7
extra_data_attrs['.zlib'] = True
upstream = autoscale( lething.walk(extra_data_attrs=extra_data_attrs),
variable_names_matching={varname} )
if debug:
upstream = debug(upstream)
for fnwrit in nc_write(
rename(
autoscale( lething.walk(extra_data_attrs=extra_data_attrs),
variable_names_matching={varname}
),
upstream,
pathout
)
):
......@@ -743,7 +747,7 @@ def main():
return 0
for pn in args.inputs:
write_netcdf(pn, args.rad, "{}_rad.nc" if args.rad else "{}_cmi.nc", complevel=args.compress)
write_netcdf(pn, args.rad, "{}_rad.nc" if args.rad else "{}_cmi.nc", complevel=args.compress, debug=args.debug)
return 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment