Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
IPSL
LMD
InTro
RoutingPP
Commits
e1d4f7e9
Commit
e1d4f7e9
authored
Feb 16, 2021
by
Anthony
Browse files
Avoid stations with negative upstream area in HydroGraph/position.
parent
8a138780
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
GraphHydro.py
GraphHydro.py
+3
-1
No files found.
GraphHydro.py
View file @
e1d4f7e9
...
...
@@ -144,7 +144,9 @@ class HydroGraph :
def
position
(
self
,
modelgrid
,
locations
)
:
npt
,
nbas
=
self
.
routing_fetch
.
shape
if
len
(
locations
.
lid
)
>
0
:
for
i
,
lid
in
enumerate
(
locations
.
lid
)
:
for
i
,
lid
in
enumerate
(
locations
.
lid
)
:
# Some stations have a negative upstream area (because undefined)
if
locations
.
upstream
[
i
]
>
0
:
dist
=
RPP
.
distances
(
np
.
array
(
modelgrid
.
coordll
)[:,
0
],
np
.
array
(
modelgrid
.
coordll
)[:,
1
],
\
locations
.
lon
[
i
],
locations
.
lat
[
i
])
# Calculation in km
...
...
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