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
85dc1afe
Commit
85dc1afe
authored
1 year ago
by
Sebastian Müller
🐈
Browse files
Options
Downloads
Patches
Plain Diff
update examples
parent
b9d405d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
examples/01_simple_viewer.py
+2
-2
2 additions, 2 deletions
examples/01_simple_viewer.py
examples/02_meteo_couple.py
+47
-0
47 additions, 0 deletions
examples/02_meteo_couple.py
with
50 additions
and
2 deletions
.gitignore
+
1
−
0
View file @
85dc1afe
...
...
@@ -125,6 +125,7 @@ docs/source/examples/
docs/source/generated/
examples/test_domain
examples/qmod.nc
examples/qmod_couple.nc
/docs/build/
/docs/finam_mhm.*
...
...
This diff is collapsed.
Click to expand it.
examples/simple_viewer.py
→
examples/
01_
simple_viewer.py
+
2
−
2
View file @
85dc1afe
...
...
@@ -19,6 +19,7 @@ test_domain = here / "test_domain"
shutil
.
rmtree
(
test_domain
,
ignore_errors
=
True
)
download_test
(
path
=
test_domain
)
mhm
=
fm_mhm
.
MHM
(
cwd
=
test_domain
)
runoff_viewer
=
fm_plt
.
ImagePlot
(
vmin
=
0.0
,
vmax
=
650
,
update_interval
=
24
)
# netcdf writing files
...
...
@@ -26,7 +27,6 @@ writer = fm_nc.NetCdfTimedWriter(
path
=
here
/
"
qmod.nc
"
,
inputs
=
{
"
QMOD
"
:
fm_nc
.
Layer
(
var
=
"
QMOD
"
,
xyz
=
(
"
x
"
,
"
y
"
))},
time_var
=
"
time
"
,
start
=
start_date
,
step
=
day
,
)
...
...
@@ -36,4 +36,4 @@ composition.initialize()
mhm
.
outputs
[
"
L11_QMOD
"
]
>>
writer
.
inputs
[
"
QMOD
"
]
mhm
.
outputs
[
"
L11_QMOD
"
]
>>
runoff_viewer
.
inputs
[
"
Grid
"
]
composition
.
run
(
end_time
=
datetime
(
199
1
,
1
,
1
))
composition
.
run
(
end_time
=
datetime
(
199
0
,
1
2
,
3
1
))
This diff is collapsed.
Click to expand it.
examples/02_meteo_couple.py
0 → 100644
+
47
−
0
View file @
85dc1afe
"""
Simple coupling setup using live view modules.
"""
import
shutil
from
datetime
import
datetime
,
timedelta
from
pathlib
import
Path
import
finam
as
fm
import
finam_netcdf
as
fm_nc
from
mhm
import
download_test
import
finam_mhm
as
fm_mhm
# start_date = datetime(1993, 1, 1)
# end_date = datetime(1993, 12, 31)
start_date
=
datetime
(
1990
,
1
,
1
)
end_date
=
datetime
(
1993
,
12
,
31
)
day
=
timedelta
(
days
=
1
)
here
=
Path
(
__file__
).
parent
test_domain
=
here
/
"
test_domain
"
shutil
.
rmtree
(
test_domain
,
ignore_errors
=
True
)
download_test
(
path
=
test_domain
,
domain
=
1
)
pre_reader
=
fm_nc
.
NetCdfReader
(
test_domain
/
"
input
"
/
"
meteo
"
/
"
pre
"
/
"
pre.nc
"
)
mhm
=
fm_mhm
.
MHM
(
cwd
=
test_domain
,
input_names
=
[
"
METEO_PRE
"
],
meteo_timestep
=
24
,
ignore_input_grid
=
True
,
)
# netcdf writing files
writer
=
fm_nc
.
NetCdfTimedWriter
(
path
=
here
/
"
qmod_couple.nc
"
,
inputs
=
{
"
QMOD
"
:
fm_nc
.
Layer
(
var
=
"
QMOD
"
,
xyz
=
(
"
x
"
,
"
y
"
))},
time_var
=
"
time
"
,
step
=
day
,
)
composition
=
fm
.
Composition
([
pre_reader
,
mhm
,
writer
])
composition
.
initialize
()
pre_reader
[
"
pre
"
]
>>
mhm
.
inputs
[
"
METEO_PRE
"
]
mhm
.
outputs
[
"
L11_QMOD
"
]
>>
writer
.
inputs
[
"
QMOD
"
]
composition
.
run
(
start_time
=
start_date
,
end_time
=
end_date
)
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