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
Compare revisions
main to d4c96eed6e320e6d3127647dd0211cb96dcde565
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
afid.nur-kholis/finam-mhm
Select target project
No results found
d4c96eed6e320e6d3127647dd0211cb96dcde565
Select Git revision
Branches
add_logging
dirty-grid-fix
lai-adapter
main
Tags
v0.1.0
Swap
Target
FINAM/finam-mhm
Select target project
afid.nur-kholis/finam-mhm
FINAM/finam-mhm
2 results
main
Select Git revision
Branches
add_logging
dirty-grid-fix
lai-adapter
main
Tags
v0.1.0
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
dirty fix for output grid orientation and daily time step
· d4c96eed
Martin Lange
authored
3 years ago
d4c96eed
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
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
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.