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): ...@@ -681,8 +681,8 @@ class tests(unittest.TestCase):
n_frames += 1 n_frames += 1
print("%d frames" % n_frames) print("%d frames" % n_frames)
def write_netcdf(path, as_radiances=False, filename_format="{}.nc", complevel=None): def write_netcdf(path, as_radiances=False, filename_format="{}.nc", complevel=None, debug=False):
from goesr.rockfall import rename, nc_write, autoscale from goesr.rockfall import rename, nc_write, autoscale, debug
fnstem = os.path.splitext(os.path.split(path)[-1])[0] fnstem = os.path.splitext(os.path.split(path)[-1])[0]
fn = filename_format.format(fnstem) fn = filename_format.format(fnstem)
pathout = os.path.abspath(fn) pathout = os.path.abspath(fn)
...@@ -692,11 +692,15 @@ def write_netcdf(path, as_radiances=False, filename_format="{}.nc", complevel=No ...@@ -692,11 +692,15 @@ def write_netcdf(path, as_radiances=False, filename_format="{}.nc", complevel=No
if complevel: if complevel:
extra_data_attrs['.complevel'] = complevel if isinstance(complevel, int) else 7 extra_data_attrs['.complevel'] = complevel if isinstance(complevel, int) else 7
extra_data_attrs['.zlib'] = True 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( for fnwrit in nc_write(
rename( rename(
autoscale( lething.walk(extra_data_attrs=extra_data_attrs), upstream,
variable_names_matching={varname}
),
pathout pathout
) )
): ):
...@@ -743,7 +747,7 @@ def main(): ...@@ -743,7 +747,7 @@ def main():
return 0 return 0
for pn in args.inputs: 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 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