Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
thopri
PyNEMO
Commits
8168bddc
Commit
8168bddc
authored
4 years ago
by
thopri
Browse files
Options
Download
Email Patches
Plain Diff
added try except to catch missing input files due to THREDDS server being down
parent
55587d9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
pynemo/nemo_bdy_gen_c.py
pynemo/nemo_bdy_gen_c.py
+5
-1
pynemo/pynemo_exe.py
pynemo/pynemo_exe.py
+1
-1
No files found.
pynemo/nemo_bdy_gen_c.py
View file @
8168bddc
...
...
@@ -11,6 +11,7 @@ Ported from Matlab code by James Harle
#External Imports
import
numpy
as
np
import
logging
import
sys
#Local Imports
from
.utils.nemo_bdy_lib
import
sub2ind
...
...
@@ -74,7 +75,10 @@ class Boundary:
bdy_msk
[
grid_ind
]
=
fval
# Create padded array for overlays
msk
=
np
.
pad
(
bdy_msk
,((
1
,
1
),(
1
,
1
)),
'constant'
,
constant_values
=
(
-
1
))
try
:
msk
=
np
.
pad
(
bdy_msk
,((
1
,
1
),(
1
,
1
)),
'constant'
,
constant_values
=
(
-
1
))
except
ValueError
:
raise
Exception
(
'the ValueError above is commonly due to PyNEMO not finding the bathymetry/mask file'
)
# create index arrays of I and J coords
igrid
,
jgrid
=
np
.
meshgrid
(
np
.
arange
(
bdy_msk
.
shape
[
1
]),
np
.
arange
(
bdy_msk
.
shape
[
0
]))
...
...
This diff is collapsed.
Click to expand it.
pynemo/pynemo_exe.py
View file @
8168bddc
...
...
@@ -40,7 +40,7 @@ def main():
elif
opt
in
(
"-d"
,
"--download_cmems"
):
setup_file
=
arg
t0
=
time
.
time
()
with
yaspin
(
Spinners
.
earth
,
text
=
'
PyNEMO
is running'
):
with
yaspin
(
Spinners
.
earth
,
text
=
'
Download CMEMS function
is running'
):
profile
.
download_cmems
(
setup_file
)
t1
=
time
.
time
()
print
(
"CMEMS download time: %s"
%
(
t1
-
t0
))
...
...
This diff is collapsed.
Click to expand it.
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