import mikeio1d
= mikeio1d.open("../data/mikep_cs_demo.xns11")
xns xns
<mikeio1d.Xns11 (103)>
cross_section | |||
---|---|---|---|
location_id | chainage | topo_id | |
basin_left1 | 2.004 | 1 | <CrossSection: basin_left1, 2.004, 1> |
33.774 | 1 | <CrossSection: basin_left1, 33.774, 1> | |
80.945 | 1 | <CrossSection: basin_left1, 80.945, 1> | |
122.042 | 1 | <CrossSection: basin_left1, 122.042, 1> | |
166.107 | 1 | <CrossSection: basin_left1, 166.107, 1> |
markers | marker_labels | x | z | resistance | |
---|---|---|---|---|---|
0 | 0.000 | 4059.508 | 25.0 | ||
1 | 2.062 | 4059.624 | 25.0 | ||
2 | 1 | Left Levee Bank (1) | 4.124 | 4059.754 | 25.0 |
3 | 6.186 | 4059.607 | 25.0 | ||
4 | 14.435 | 4058.882 | 25.0 |
marker | marker_label | x | z | |
---|---|---|---|---|
0 | 1 | Left Levee Bank (1) | 4.124 | 4059.754 |
1 | 2 | Lowest Point (2) | 72.914 | 4052.803 |
2 | 3 | Right Levee Bank (3) | 195.897 | 4057.989 |
3 | 4 | Left Low Flow Bank (4) | 71.119 | 4053.263 |
4 | 5 | Right Low Flow Bank (5) | 74.003 | 4053.357 |
level | flow_area | radius | storage_width | additional_storage_area | resistance | conveyance_factor | |
---|---|---|---|---|---|---|---|
0 | 4052.803000 | 0.000000 | 0.000000 | 0.000000 | 0.0 | 25.0 | 0.000000 |
1 | 4052.944857 | 0.160191 | 0.075978 | 2.743476 | 0.0 | 25.0 | 0.718409 |
2 | 4053.086714 | 0.790062 | 0.165315 | 6.136873 | 0.0 | 25.0 | 5.949433 |
3 | 4053.228571 | 3.633195 | 0.172199 | 29.866016 | 0.0 | 25.0 | 28.113531 |
4 | 4053.370429 | 9.264321 | 0.251109 | 50.128968 | 0.0 | 25.0 | 92.185348 |
<CrossSection: basin_left1, 122.042, 1>
[<CrossSection: basin_left1, 2.004, 1>,
<CrossSection: basin_left1, 33.774, 1>,
<CrossSection: basin_left1, 80.945, 1>,
<CrossSection: basin_left1, 122.042, 1>,
<CrossSection: basin_left1, 166.107, 1>,
<CrossSection: basin_left1, 184.886, 1>,
<CrossSection: basin_left1, 210.212, 1>,
<CrossSection: basin_left1, 264.614, 1>,
<CrossSection: basin_left1, 284.638, 1>,
<CrossSection: basin_left1, 341.152, 1>,
<CrossSection: basin_left1, 413.617, 1>,
<CrossSection: basin_left1, 481.451, 1>]
[<CrossSection: basin_left1, 2.004, 1>,
<CrossSection: basin_left1, 33.774, 1>,
<CrossSection: basin_left1, 80.945, 1>,
<CrossSection: basin_left1, 122.042, 1>,
<CrossSection: basin_left1, 166.107, 1>,
<CrossSection: basin_left1, 184.886, 1>,
<CrossSection: basin_left1, 210.212, 1>,
<CrossSection: basin_left1, 264.614, 1>,
<CrossSection: basin_left1, 284.638, 1>,
<CrossSection: basin_left1, 341.152, 1>,
<CrossSection: basin_left1, 413.617, 1>,
<CrossSection: basin_left1, 481.451, 1>]
xns_custom = Xns11()
xns_custom.add(xs)
xns_custom.write("my_custom.xns11")
xns_custom.to_dataframe()
cross_section | |||
---|---|---|---|
location_id | chainage | topo_id | |
my_reach | 100.000 | my_topo | <CrossSection: my_reach, 100.000, my_topo> |
# Subset an existing Xns11 file
subset = xns.sel(location_id='basin_left1')
xns_subset = Xns11(subset)
xns_subset.write("my_subset.xns11")
xns_subset.to_dataframe()
cross_section | |||
---|---|---|---|
location_id | chainage | topo_id | |
basin_left1 | 2.004 | 1 | <CrossSection: basin_left1, 2.004, 1> |
33.774 | 1 | <CrossSection: basin_left1, 33.774, 1> | |
80.945 | 1 | <CrossSection: basin_left1, 80.945, 1> | |
122.042 | 1 | <CrossSection: basin_left1, 122.042, 1> | |
166.107 | 1 | <CrossSection: basin_left1, 166.107, 1> | |
184.886 | 1 | <CrossSection: basin_left1, 184.886, 1> | |
210.212 | 1 | <CrossSection: basin_left1, 210.212, 1> | |
264.614 | 1 | <CrossSection: basin_left1, 264.614, 1> | |
284.638 | 1 | <CrossSection: basin_left1, 284.638, 1> | |
341.152 | 1 | <CrossSection: basin_left1, 341.152, 1> | |
413.617 | 1 | <CrossSection: basin_left1, 413.617, 1> | |
481.451 | 1 | <CrossSection: basin_left1, 481.451, 1> |
markers | marker_labels | x | z | resistance | |
---|---|---|---|---|---|
0 | 0.000 | 4059.508 | 25.0 | ||
1 | 2.062 | 4059.624 | 25.0 | ||
2 | 1 | Left Levee Bank (1) | 4.124 | 4059.754 | 25.0 |
3 | 6.186 | 4059.607 | 25.0 | ||
4 | 14.435 | 4058.882 | 25.0 |
markers | marker_labels | x | z | resistance | |
---|---|---|---|---|---|
0 | 0.000 | 5059.508 | 25.0 | ||
1 | 2.062 | 5059.624 | 25.0 | ||
2 | 1 | Left Levee Bank (1) | 4.124 | 5059.754 | 25.0 |
3 | 6.186 | 5059.607 | 25.0 | ||
4 | 14.435 | 5058.882 | 25.0 |
from mikeio1d.cross_sections import Marker
xs.set_marker(Marker.LEFT_LOW_FLOW_BANK, x=70)
xs.set_marker(Marker.RIGHT_LOW_FLOW_BANK, x=74)
xs.markers
marker | marker_label | x | z | |
---|---|---|---|---|
0 | 1 | Left Levee Bank (1) | 4.124 | 5059.754 |
1 | 2 | Lowest Point (2) | 72.914 | 5052.803 |
2 | 3 | Right Levee Bank (3) | 195.897 | 5057.989 |
3 | 4 | Left Low Flow Bank (4) | 71.119 | 5053.263 |
4 | 5 | Right Low Flow Bank (5) | 74.003 | 5053.357 |