Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
finam-mhm
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Afid Nur Kholis
finam-mhm
Commits
d4c96eed
Commit
d4c96eed
authored
3 years ago
by
Martin Lange
Browse files
Options
Downloads
Patches
Plain Diff
dirty fix for output grid orientation and daily time step
parent
32019d7c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/simple_viewer.py
+1
-0
1 addition, 0 deletions
examples/simple_viewer.py
src/finam_mhm_module/mhm.py
+7
-6
7 additions, 6 deletions
src/finam_mhm_module/mhm.py
with
8 additions
and
6 deletions
examples/simple_viewer.py
+
1
−
0
View file @
d4c96eed
...
...
@@ -11,6 +11,7 @@ from finam.modules.visual import time_series
from
finam_mhm_module
import
Mhm
from
matplotlib
import
pyplot
as
plt
def
grid_select
(
grid
):
col
,
row
=
3
,
5
return
grid
[
col
+
row
*
5
]
...
...
This diff is collapsed.
Click to expand it.
src/finam_mhm_module/mhm.py
+
7
−
6
View file @
d4c96eed
...
...
@@ -2,10 +2,11 @@
FINAM mHM module.
"""
from
datetime
import
datetime
import
mhm_pybind
as
mp
from
finam.core.sdk
import
ATimeComponent
,
Output
import
mhm_pybind
as
mp
import
numpy
as
np
from
finam.core.interfaces
import
ComponentStatus
from
finam.core.sdk
import
ATimeComponent
,
Output
from
finam.data.grid
import
Grid
,
GridSpec
...
...
@@ -35,14 +36,14 @@ class Mhm(ATimeComponent):
# set time
year
,
month
,
day
,
hour
=
mp
.
run
.
current_time
()
print
(
"
time
"
,
year
,
month
,
day
,
hour
)
if
hour
==
-
1
:
if
hour
<
0
:
hour
=
0
self
.
_time
=
datetime
(
year
=
year
,
month
=
month
,
day
=
day
,
hour
=
hour
)
# get grid info
ncols
,
nrows
,
ncells
,
xll
,
yll
,
cell_size
,
no_data
=
mp
.
get
.
l1_domain_info
()
self
.
no_data
=
no_data
self
.
gridspec
=
GridSpec
(
ncols
=
n
col
s
,
nrows
=
n
row
s
,
cell_size
=
cell_size
,
xll
=
xll
,
yll
=
yll
ncols
=
n
row
s
,
nrows
=
n
col
s
,
cell_size
=
cell_size
,
xll
=
xll
,
yll
=
yll
)
self
.
outputs
[
"
runoff
"
]
=
Output
()
self
.
_status
=
ComponentStatus
.
INITIALIZED
...
...
@@ -54,7 +55,7 @@ class Mhm(ATimeComponent):
data
=
Grid
(
spec
=
self
.
gridspec
,
no_data
=
self
.
no_data
,
data
=
runoff
.
filled
().
reshape
(
-
1
),
data
=
np
.
fliplr
(
runoff
.
filled
()
)
.
reshape
(
-
1
,
order
=
"
F
"
),
),
time
=
self
.
time
,
)
...
...
@@ -82,7 +83,7 @@ class Mhm(ATimeComponent):
data
=
Grid
(
spec
=
self
.
gridspec
,
no_data
=
self
.
no_data
,
data
=
runoff
.
filled
().
reshape
(
-
1
),
data
=
np
.
fliplr
(
runoff
.
filled
()
)
.
reshape
(
-
1
,
order
=
"
F
"
),
),
time
=
self
.
time
,
)
...
...
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