Tutorial 56: Nominal Diameter Tables
SIR 3S Toolkit
Regular Import/Init
[1]:
SIR3S_SIRGRAF_DIR = r"C:\3S\SIR 3S\SirGraf-90-15-00-24_Quebec-Upd2" #change to local path
[2]:
from sir3stoolkit.core import wrapper
[3]:
wrapper
[3]:
<module 'sir3stoolkit.core.wrapper' from 'C:\\Users\\aUsername\\3S\\sir3stoolkit\\src\\sir3stoolkit\\core\\wrapper.py'>
[4]:
wrapper.Initialize_Toolkit(SIR3S_SIRGRAF_DIR)
[2026-06-08 11:58:55,781] INFO in sir3stoolkit.core.wrapper: [Initialization] Using provided SirGraf path: C:\3S\SIR 3S\SirGraf-90-15-00-24_Quebec-Upd2
[2026-06-08 11:58:55,781] INFO in sir3stoolkit.core.wrapper: [Initialization] Using provided SirGraf path: C:\3S\SIR 3S\SirGraf-90-15-00-24_Quebec-Upd2
[2026-06-08 11:58:55,819] INFO in sir3stoolkit.core.wrapper: [Initialization] Initializing toolkit with SirGraf path: C:\3S\SIR 3S\SirGraf-90-15-00-24_Quebec-Upd2
Additional Import/Init for Dataframes class
[5]:
from sir3stoolkit.mantle.dataframes import SIR3S_Model_Dataframes
[6]:
s3s = SIR3S_Model_Dataframes()
[2026-06-08 11:59:04,750] INFO in sir3stoolkit.core.wrapper: [Model Class Initialization] Initialization complete
Open Model
[8]:
s3s.OpenModel(dbName=r"Toolkit_Tutorial56_Model.db3",
providerType=s3s.ProviderTypes.SQLite,
Mid="M-1-0-1",
saveCurrentlyOpenModel=False,
namedInstance="",
userID="",
password="")
[2026-06-08 11:59:13,409] INFO in sir3stoolkit.core.wrapper: Model is open for further operation
View Nominal Diameter Tables
We can use the function get_dataframes_from_nominal_diameter_tables() to obtain a dictionary of all nominal diameter tables.
[9]:
_, dfs, tks = s3s.get_dataframes_from_nominal_diameter_tables()
[10]:
for id, tk in enumerate(tks):
print(f"{id}: {tk}: {s3s.GetValue(tk, 'Name')[0]}")
0: 4929824488020291605: STDROHR
1: 4862079620528720750: FLEXWELL-F
2: 5157457566256524875: STDROHR_2
3: 4927972999088213410: KMR
Now we can view the individual nominal diameter tables.
STDROHR
[11]:
dfs[tks[0]].head(3)
[11]:
| tk_merge | Table Name | Name | Fk | Dn | Di | Da | S | Wsteig | Wtiefe | Kt | Pn | Ausfallzeit | Reparatur | Rehabilitation | Tk | Pk | InVariant | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 5515865002497708428 | STDROHR | DN 3 | 4929824488020291605 | 3 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5515865002497708428 | 5515865002497708428 | False |
| 1 | 5623248152587240406 | STDROHR | DN 4 | 4929824488020291605 | 4 | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5623248152587240406 | 5623248152587240406 | False |
| 2 | 5195383577550917235 | STDROHR | DN 5 | 4929824488020291605 | 5 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5195383577550917235 | 5195383577550917235 | False |
KMR
[12]:
dfs[tks[3]].head(3)
[12]:
| tk_merge | Table Name | Name | Fk | Dn | Di | Da | S | Wsteig | Wtiefe | Kt | Pn | Ausfallzeit | Reparatur | Rehabilitation | Tk | Pk | InVariant | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 5636244102636904922 | KMR | DN 25 | 4927972999088213410 | 25 | 22,3 | 26,9 | 2,3 | 0 | 0 | 0,19 | 0 | 0 | 0 | 100 | 5636244102636904922 | 5636244102636904922 | False |
| 1 | 4845758090437917162 | KMR | DN 32 | 4927972999088213410 | 32 | 28,5 | 33,7 | 2,6 | 0 | 0 | 0,195 | 0 | 0 | 0 | 200 | 4845758090437917162 | 4845758090437917162 | False |
| 2 | 5728256818453294508 | KMR | DN 50 | 4927972999088213410 | 50 | 54,5 | 60,3 | 2,9 | 0 | 0 | 0,225 | 0 | 0 | 0 | 300 | 5728256818453294508 | 5728256818453294508 | False |
df pipes
When creating a element dataframe of pipes, the nominal diameter table values will automatically be added with the prefix “PipeTable:”.
[15]:
df_pipes, _ = s3s.generate_element_dataframe(element_type=s3s.ObjectTypes.Pipe)
[2026-06-08 12:01:00,507] INFO in sir3stoolkit.mantle.dataframes: [generate_element_dataframe] Generating df for element type: ObjectTypes.Pipe ...
[2026-06-08 12:01:00,508] INFO in sir3stoolkit.mantle.dataframes: [generate_element_dataframe] Generating df_model_data for element type: ObjectTypes.Pipe ...
[2026-06-08 12:01:00,515] INFO in sir3stoolkit.mantle.dataframes: [model_data] Generating model_data dataframe for element type: ObjectTypes.Pipe
[2026-06-08 12:01:00,518] INFO in sir3stoolkit.mantle.dataframes: [model_data] Retrieved 524 element(s) of element type ObjectTypes.Pipe.
[2026-06-08 12:01:00,521] INFO in sir3stoolkit.mantle.dataframes: [Resolving model_data Properties] No properties given → using ALL model_data properties for ObjectTypes.Pipe.
[2026-06-08 12:01:00,522] INFO in sir3stoolkit.mantle.dataframes: [Resolving model_data Properties] Using 46 model_data properties.
[2026-06-08 12:01:00,523] INFO in sir3stoolkit.mantle.dataframes: [model_data] Retrieving model_data properties ['Name', 'FkdtroRowd', 'Fkltgr', 'Fkstrasse', 'L', 'Lzu', 'Rau', 'Jlambs', 'Lambda0', 'Zein', 'Zaus', 'Zuml', 'Asoll', 'Indschall', 'Baujahr', 'Hal', 'Fkcont', 'Fk2lrohr', 'Beschreibung', 'Idreferenz', 'Iplanung', 'Kvr', 'LineWidthMM', 'DottedLine', 'DN', 'Di', 'KvrKlartext', 'HasClosedNSCHs', 'Tk', 'Pk', 'InVariant', 'Xkor', 'Ykor', 'GeometriesDiffer', 'bz.Fk', 'bz.Qsvb', 'bz.Irtrenn', 'bz.Leckstatus', 'bz.Leckstart', 'bz.Leckend', 'bz.Leckort', 'bz.Leckmenge', 'bz.Imptnz', 'bz.Zvlimptnz', 'bz.Kantenzv', 'bz.ITrennWithNSCH'], geometry, end nodes...
[2026-06-08 12:01:03,077] INFO in sir3stoolkit.mantle.dataframes: [model_data] 2 non-empty end node columns were created.
[2026-06-08 12:01:04,100] INFO in sir3stoolkit.mantle.dataframes: [model_data] Transforming DataFrame to GeoDataFrame successful with EPSG: 25832
[2026-06-08 12:01:04,105] INFO in sir3stoolkit.mantle.dataframes: [model_data] Done. Shape: (524, 67)
[2026-06-08 12:01:04,217] INFO in sir3stoolkit.mantle.dataframes: [generate_element_dataframe] Generating df_results for element type: ObjectTypes.Pipe ...
[2026-06-08 12:01:04,217] INFO in sir3stoolkit.mantle.dataframes: [results] Generating results dataframe for element type: ObjectTypes.Pipe
[2026-06-08 12:01:04,321] INFO in sir3stoolkit.mantle.dataframes: [Resolving Timestamps] Only static timestamp 2023-02-13 00:00:00.000 +01:00 is used
[2026-06-08 12:01:04,324] INFO in sir3stoolkit.mantle.dataframes: [Resolving tks] Retrieved 524 element(s) of element type ObjectTypes.Pipe.
[2026-06-08 12:01:04,327] INFO in sir3stoolkit.mantle.dataframes: [results] Using 82 result properties.
[2026-06-08 12:01:04,365] INFO in sir3stoolkit.mantle.dataframes: [results] Retrieving result values...
[2026-06-08 12:01:12,429] INFO in sir3stoolkit.mantle.dataframes: [results] 26724 fully NaN columns dropped.
[2026-06-08 12:01:15,710] INFO in sir3stoolkit.mantle.dataframes: [results] Done. Shape: (1, 16244)
[2026-06-08 12:02:21,386] INFO in sir3stoolkit.mantle.dataframes: [rows_to_tuple_row] Collapsing dataframe rows into tuple row...
[2026-06-08 12:02:25,576] INFO in sir3stoolkit.mantle.dataframes: [rows_to_tuple_row] Done. Shape: (1, 25676)
[2026-06-08 12:02:25,600] INFO in sir3stoolkit.mantle.dataframes: [generate_element_dataframe] Merging df_model_data with df_results for element type: ObjectTypes.Pipe ...
[16]:
df_pipes.head(3)
[16]:
| tk | Name | FkdtroRowd | Fkltgr | Fkstrasse | L | Lzu | Rau | Jlambs | Lambda0 | Zein | Zaus | Zuml | Asoll | Indschall | Baujahr | Hal | Fkcont | Fk2lrohr | Beschreibung | Idreferenz | Iplanung | Kvr | LineWidthMM | DottedLine | DN | Di | KvrKlartext | HasClosedNSCHs | Tk | Pk | InVariant | Xkor | Ykor | GeometriesDiffer | bz.Fk | bz.Qsvb | bz.Irtrenn | bz.Leckstatus | bz.Leckstart | bz.Leckend | bz.Leckort | bz.Leckmenge | bz.Imptnz | bz.Zvlimptnz | bz.Kantenzv | bz.ITrennWithNSCH | geometry | fkKI | fkKK | PipeTable: Table Name | PipeTable: Name | PipeTable: Fk | PipeTable: Dn | PipeTable: Di | PipeTable: Da | PipeTable: S | PipeTable: Wsteig | PipeTable: Wtiefe | PipeTable: Kt | PipeTable: Pn | PipeTable: Ausfallzeit | PipeTable: Reparatur | PipeTable: Rehabilitation | PipeTable: Tk | PipeTable: Pk | PipeTable: InVariant | A | DTTR | DWVERL | DWVERLABS | IAKTIV | IRTRENN | JV | MVEC_end | MVEC_sequence | MVEC_start | PDAMPF | PHR | PMIN | PVECMAX_INST_end | PVECMAX_INST_sequence | PVECMAX_INST_start | PVECMIN_INST_end | PVECMIN_INST_sequence | PVECMIN_INST_start | PVEC_end | PVEC_sequence | PVEC_start | QMAV | QMI | QMK | RHOI | RHOK | RHOVEC_end | RHOVEC_sequence | RHOVEC_start | SVEC_end | SVEC_sequence | SVEC_start | TI | TK | TTRVEC_end | TTRVEC_sequence | TTRVEC_start | TVEC_end | TVEC_sequence | TVEC_start | VAV | VI | VK | VOLDA | WVL | ZVEC_end | ZVEC_sequence | ZVEC_start | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 4614463970292122863 | Rohr R-K4383S R-K4183S | 4689226368751411179 | 4779752876656844188 | 5431845028903382031 | 7.780674 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 1000 | 0 | 0 | 5029128874972463118 | 4713734746689397424 | OSM: Knoten 450994211 -> Knoten 476971188; Län... | 166815824 | 5 | 2 | 0.005 | 0 | 999 | 994.0 | Rücklauf | 4614463970292122863 | 4614463970292122863 | False | 714262.482930 | 5.578857e+06 | False | 4614463970292122863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | LINESTRING (714262.483 5578857.42, 714269.543 ... | 4730066059089961857 | 4917189080965035120 | KMR | DN 999 | 4927972999088213410 | 999 | 994.0 | 1014.0 | 10.0 | 0 | 0 | 1.212 | 0 | 0 | 0 | 1950 | 4689226368751411179 | 4689226368751411179 | False | (0.0,) | (7.780674,) | (0.0,) | (0.0,) | (1.0,) | (0.0,) | (1.765804e-22,) | (5.748007e-10,) | ((5.748007e-10, 5.748007e-10),) | (5.748007e-10,) | (0.0123,) | (1.373914e-24,) | (1.615057,) | (1.68863,) | ((1.615055, 1.68863),) | (1.615055,) | (1.68863,) | ((1.615055, 1.68863),) | (1.615055,) | (1.68863,) | ((1.615055, 1.68863),) | (1.615055,) | (2.069282e-09,) | (2.069282e-09,) | (2.069282e-09,) | (1000.3,) | (1000.3,) | (1000.3,) | ((1000.3, 1000.3),) | (1000.3,) | (7.780674,) | ((0.0, 7.780674),) | (0.0,) | (9.999994,) | (9.999994,) | (174.479,) | ((166.6983, 174.479),) | (166.6983,) | (10.0,) | ((10.0, 10.0),) | (10.0,) | (7.404988e-13,) | (7.404988e-13,) | (7.404988e-13,) | (0.0,) | (0.0,) | (544.34,) | ((545.09, 544.34),) | (545.09,) | ||
| 1 | 4615723899944629797 | Rohr V-K203S V-K213S | 4689226368751411179 | 4779752876656844188 | 5728726059620036726 | 64.287240 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 1000 | 0 | 0 | 5029128874972463118 | 4938076287810941486 | OSM: Knoten 390310977 -> Knoten 1368674233; Lä... | 24633100 | 5 | 1 | 0.005 | 0 | 999 | 994.0 | Vorlauf | 4615723899944629797 | 4615723899944629797 | False | 713738.296567 | 5.579220e+06 | False | 4615723899944629797 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | LINESTRING (713738.297 5579219.902, 713793.23 ... | 5129584372458662150 | 5332825919690090061 | KMR | DN 999 | 4927972999088213410 | 999 | 994.0 | 1014.0 | 10.0 | 0 | 0 | 1.212 | 0 | 0 | 0 | 1950 | 4689226368751411179 | 4689226368751411179 | False | (0.0,) | (64.28724,) | (0.0,) | (0.0,) | (1.0,) | (0.0,) | (4.756155e-23,) | (-2.983143e-10,) | ((-2.983143e-10, -2.983143e-10, -2.983143e-10,... | (-2.983143e-10,) | (0.0123,) | (3.057601e-24,) | (3.304769,) | (3.59023,) | ((3.30477, 3.34555, 3.38633, 3.42711, 3.46789,... | (3.30477,) | (3.59023,) | ((3.30477, 3.34555, 3.38633, 3.42711, 3.46789,... | (3.30477,) | (3.59023,) | ((3.30477, 3.34555, 3.38633, 3.42711, 3.46789,... | (3.30477,) | (-1.073931e-09,) | (-1.073931e-09,) | (-1.073931e-09,) | (1000.3,) | (1000.3,) | (1000.3,) | ((1000.3, 1000.3, 1000.3, 1000.3, 1000.3, 1000... | (1000.3,) | (64.28724,) | ((0.0, 9.183891, 18.36778, 27.55167, 36.73557,... | (0.0,) | (9.999994,) | (9.999994,) | (43.0797,) | ((107.3669, 98.18304, 88.99916, 79.81527, 70.6... | (107.3669,) | (10.0,) | ((10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10... | (10.0,) | (-3.843095e-13,) | (-3.843095e-13,) | (-3.843095e-13,) | (0.0,) | (0.0,) | (562.93,) | ((565.84, 565.4243, 565.0086, 564.5929, 564.17... | (565.84,) | ||
| 2 | 4621030304810285220 | Rohr R-K2573S R-K2583S | 5516336706687055417 | 4779752876656844188 | 5644881417512616095 | 3.956838 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 1000 | 0 | 0 | 5029128874972463118 | 5625716875961234775 | OSM: Knoten 476971211 -> Knoten 264607350; Län... | 24386111 | 0 | 2 | 0.005 | 0 | 100 | 107.1 | Rücklauf | 4621030304810285220 | 4621030304810285220 | False | 713650.613400 | 5.578990e+06 | False | 4621030304810285220 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | LINESTRING (713650.613 5578990.488, 713649.498... | 5070795580168283912 | 5725848577942138606 | KMR | DN 100 | 4927972999088213410 | 100 | 107.1 | 114.3 | 3.6 | 0 | 0 | 0.325 | 0 | 0 | 0 | 600 | 5516336706687055417 | 5516336706687055417 | False | (0.0,) | (0.00229145,) | (16.2622,) | (0.06434688,) | (0.0,) | (0.0,) | (0.2111366,) | (-4.251046,) | ((-4.251046, -4.251046),) | (-4.251046,) | (0.1980228,) | (0.0008354334,) | (2.198662,) | (2.19866,) | ((2.21037, 2.19866),) | (2.21037,) | (2.19866,) | ((2.21037, 2.19866),) | (2.21037,) | (2.19866,) | ((2.21037, 2.19866),) | (2.21037,) | (-15.30376,) | (-15.30376,) | (-15.30376,) | (983.7663,) | (983.7645,) | (983.7645,) | ((983.7663, 983.7645),) | (983.7663,) | (3.956838,) | ((0.0, 3.956838),) | (0.0,) | (59.86739,) | (59.871,) | (0.05315936,) | ((0.05545081, 0.05315936),) | (0.05545081,) | (59.871,) | ((59.8674, 59.871),) | (59.8674,) | (-0.4796621,) | (-0.4796617,) | (-0.4796625,) | (0.0,) | (0.0,) | (563.14,) | ((563.01, 563.14),) | (563.01,) |
We can access for example the heat loss of pipes, that is saved in the nominal diameter table.
[17]:
df_pipes[["tk", "Name", "PipeTable: Table Name", "PipeTable: Kt"]].head(3)
[17]:
| tk | Name | PipeTable: Table Name | PipeTable: Kt | |
|---|---|---|---|---|
| 0 | 4614463970292122863 | Rohr R-K4383S R-K4183S | KMR | 1.212 |
| 1 | 4615723899944629797 | Rohr V-K203S V-K213S | KMR | 1.212 |
| 2 | 4621030304810285220 | Rohr R-K2573S R-K2583S | KMR | 0.325 |