Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AossCeilo
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MetObs
AossCeilo
Commits
5b44730f
Commit
5b44730f
authored
3 years ago
by
Marco Kurzynski
Browse files
Options
Downloads
Patches
Plain Diff
changed log variable
parent
639b0557
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aossceilo/level_b1/quicklook.py
+9
-9
9 additions, 9 deletions
aossceilo/level_b1/quicklook.py
with
9 additions
and
9 deletions
aossceilo/level_b1/quicklook.py
+
9
−
9
View file @
5b44730f
...
...
@@ -10,7 +10,7 @@ import matplotlib as mpl
mpl
.
use
(
'
agg
'
)
import
matplotlib.pyplot
as
plt
_log
=
logging
.
getLogger
(
__name__
)
LOG
=
logging
.
getLogger
(
__name__
)
def
get_img_filename
(
begin
,
end
,
site
=
''
,
description
=
''
,
tag
=
''
):
inst
=
'
ceilo
'
...
...
@@ -49,7 +49,7 @@ def make_plot(ncfiles=None, quality=1, site="", description="", start_date=None,
try
:
yield
Dataset
(
fn
)
except
FileNotFoundError
:
_log
.
warning
(
f
"
{
os
.
path
.
basename
(
fn
)
}
not found, skipping quicklook
"
);
LOG
.
warning
(
f
"
{
os
.
path
.
basename
(
fn
)
}
not found, skipping quicklook
"
);
# yields vars of datasets added together, only added together for time_offset + base_time
def
get_data
(
datasets
,
vs
):
...
...
@@ -58,7 +58,7 @@ def make_plot(ncfiles=None, quality=1, site="", description="", start_date=None,
datasets
=
tuple
(
get_datasets
(
ncfiles
))
if
not
datasets
:
_log
.
error
(
"
No valid nc files found
"
)
LOG
.
error
(
"
No valid nc files found
"
)
exit
(
1
)
combine
=
lambda
arrs
:
reduce
(
lambda
a
,
b
:
numpy
.
append
(
a
,
b
,
axis
=
0
),
arrs
)
...
...
@@ -97,7 +97,7 @@ def make_plot(ncfiles=None, quality=1, site="", description="", start_date=None,
try
:
created_files
=
_plot_quicklook
(
x
,
y
,
z
,
fcbh
,
scbh
,
tcbh
,
dt
,
quality
,
out_dir
,
site
=
site
,
description
=
description
,
daily
=
daily
)
except
Exception
as
e
:
_log
.
exception
(
"
Error in matplotlib or pylab during plotting
"
)
LOG
.
exception
(
"
Error in matplotlib or pylab during plotting
"
)
raise
e
finally
:
plt
.
close
(
'
all
'
)
...
...
@@ -154,7 +154,7 @@ def _plot_quicklook(x, y, z, fcbh, scbh, tcbh, dt, quality, image_dir, site="",
filename
=
get_img_filename
(
dt
,
end
,
tag
=
'
tn
'
,
site
=
site
,
description
=
description
)
tn_file
=
os
.
path
.
join
(
image_dir
,
filename
)
plt
.
savefig
(
tn_file
)
_log
.
debug
(
"
Ceilometer Backscatter Thumbnail saved as %s
"
%
tn_file
)
LOG
.
debug
(
"
Ceilometer Backscatter Thumbnail saved as %s
"
%
tn_file
)
# generate quicklook
# reset to default margins
...
...
@@ -175,7 +175,7 @@ def _plot_quicklook(x, y, z, fcbh, scbh, tcbh, dt, quality, image_dir, site="",
filename
=
get_img_filename
(
dt
,
end
,
site
=
site
,
description
=
description
)
ql_file
=
os
.
path
.
join
(
image_dir
,
filename
)
plt
.
savefig
(
ql_file
)
_log
.
debug
(
"
Ceilometer Backscatter Quicklook saved as %s
"
%
ql_file
)
LOG
.
debug
(
"
Ceilometer Backscatter Quicklook saved as %s
"
%
ql_file
)
plt
.
close
(
fig
=
fig
)
return
(
tn_file
,
ql_file
)
...
...
@@ -261,7 +261,7 @@ def main():
quality
=
int
(
args
.
quality
)
if
args
.
filenames
is
None
:
_log
.
error
(
"
Filenames must be passed
"
)
LOG
.
error
(
"
Filenames must be passed
"
)
return
-
1
filenames
=
tuple
(
map
(
os
.
path
.
abspath
,
args
.
filenames
))
description
=
args
.
description
...
...
@@ -270,9 +270,9 @@ def main():
# Run the make_plot function to create the images with arguments specified at command-line
make_plot
(
ncfiles
=
filenames
,
quality
=
quality
,
site
=
args
.
site
,
description
=
description
,
start_date
=
args
.
start_date
,
end_date
=
args
.
end_date
,
daily
=
args
.
daily
,
out_dir
=
args
.
out_dir
)
except
file
.
FileLockedError
as
e
:
_log
.
warning
(
"
function already locked with %s
"
,
e
)
LOG
.
warning
(
"
function already locked with %s
"
,
e
)
finally
:
_log
.
debug
(
"
terminating
"
,
exc_info
=
True
)
LOG
.
debug
(
"
terminating
"
,
exc_info
=
True
)
logging
.
shutdown
()
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment