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

_rad and _cmi suffixes

parent 28e1d07b
......@@ -661,9 +661,11 @@ class tests(unittest.TestCase):
n_frames += 1
print("%d frames" % n_frames)
def write_netcdf(path, as_radiances=False):
def write_netcdf(path, as_radiances=False, filename_format="{}.nc"):
from goesr.rockfall import rename, nc_write, autoscale
fnout = os.path.abspath(os.path.splitext(os.path.split(path)[-1])[0] + '.nc')
fnstem = os.path.splitext(os.path.split(path)[-1])[0]
fn = filename_format.format(fnstem)
pathout = os.path.abspath(fn)
lething = HimawariAHIasCMIP(path, as_radiances=as_radiances)
varname = DEFAULT_CMIP_RAD_NAME if as_radiances else DEFAULT_CMIP_NAME
for fnwrit in nc_write(
......@@ -671,7 +673,7 @@ def write_netcdf(path, as_radiances=False):
autoscale( lething.walk(),
variable_names_matching={varname}
),
fnout
pathout
)
):
print("> " + fnwrit)
......@@ -715,7 +717,7 @@ def main():
return 0
for pn in args.inputs:
write_netcdf(pn, args.rad)
write_netcdf(pn, args.rad, "{}_rad.nc" if args.rad else "{}_cmi.nc")
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