Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ray Garcia
himawari
Commits
7f398fb1
Commit
7f398fb1
authored
Sep 27, 2017
by
R.K.Garcia
Browse files
expand debug output using goesr.rockfall.debug
parent
f00a3bc1
Changes
1
Hide whitespace changes
Inline
Side-by-side
himawari/ahi2cmi.py
View file @
7f398fb1
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment