Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nils Brüggemann
pyicon
Commits
35cb9695
Commit
35cb9695
authored
Nov 10, 2021
by
Nils Brüggemann
Browse files
pyic_fig.py: Avoid error when units are not set in netcdf variable.
parent
bd94afa3
Pipeline
#12167
passed with stages
in 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tools/pyic_fig.py
View file @
35cb9695
...
...
@@ -256,7 +256,11 @@ else:
# --- title, colorbar, and x/y label strings
if
iopts
.
cbar_str
==
'auto'
:
iopts
.
cbar_str
=
f
'
{
data
.
long_name
}
[
{
data
.
units
}
]'
try
:
units
=
data
.
units
except
:
units
=
'NA'
iopts
.
cbar_str
=
f
'
{
data
.
long_name
}
[
{
units
}
]'
if
(
iopts
.
title_right
==
'auto'
)
and
(
'time'
in
ds
[
var
].
dims
):
tstr
=
str
(
data
.
time
.
data
)
#tstr = tstr.split('T')[0].replace('-', '')+'T'+tstr.split('T')[1].split('.')[0].replace(':','')+'Z'
...
...
Write
Preview
Markdown
is supported
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