Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MIKE+Py_scripts_ENTfrachtEN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Kerger
MIKE+Py_scripts_ENTfrachtEN
Commits
bc30e0e9
Commit
bc30e0e9
authored
4 months ago
by
Sebastian Kerger
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
436cf6d0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Water quality calibration/check_column_names_res1d.ipynb
+136
-0
136 additions, 0 deletions
Water quality calibration/check_column_names_res1d.ipynb
with
136 additions
and
0 deletions
Water quality calibration/check_column_names_res1d.ipynb
0 → 100644
+
136
−
0
View file @
bc30e0e9
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "214f6c0e-b23f-41e9-946d-9151b77d591c",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"from mikeplus import DataTableAccess\n",
"from mikeplus.engines import Engine1D\n",
"from mikeio1d import Res1D\n",
"from mikeio1d.query import QueryDataStructure\n",
"from pathlib import Path"
]
},
{
"cell_type": "markdown",
"id": "07c9bb35-946c-4f24-a70b-645452dfa1be",
"metadata": {},
"source": [
"# ST column names"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "573590c1-ba7c-45b0-984a-c0fe751a5d1d",
"metadata": {},
"outputs": [],
"source": [
"# Construct the file path\n",
"result_file_path = r\"path\\example_ST.res1d\"\n",
"res1d = Res1D(str(result_file_path)) # Create a Res1D instance with the file\n",
"df = res1d.read() # Read all data from the .res1d file"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e022f845-8b2b-4666-a79e-b3a56b95dd75",
"metadata": {},
"outputs": [],
"source": [
"matching_columns = [col for col in df.columns if \"reach|node|structure_name\" in col]\n",
"print(matching_columns)"
]
},
{
"cell_type": "markdown",
"id": "0373a6a7-42a1-498a-a4b9-f9bfa2ad16b6",
"metadata": {},
"source": [
"# AD column names"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "594eb63b-940e-4300-bf07-f928ed9e2df0",
"metadata": {},
"outputs": [],
"source": [
"# Construct the file path\n",
"result_file_path_ad = r\"path\\exmaple_AD.res1d\"\n",
"res1d_ad = Res1D(str(result_file_path_ad)) # Create a Res1D instance with the file\n",
"df_ad = res1d_ad.read() # Read all data from the .res1d file"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ee6ed680-a425-4b2c-9a4c-9a8fea7a6dc9",
"metadata": {},
"outputs": [],
"source": [
"matching_columns_ad = [col for col in df_ad.columns if \"reach|node|structure_name\" in col]\n",
"print(matching_columns_ad)"
]
},
{
"cell_type": "markdown",
"id": "d2cdf6b2-af96-42be-a389-96836c03bfb3",
"metadata": {},
"source": [
"# Catchment column names"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fcaba177-d464-4368-be7b-5cf293b271d5",
"metadata": {},
"outputs": [],
"source": [
"# Construct the file path\n",
"result_file_path_catch = r\"path\\example_Catchment_discharge_quality.res1d\"\n",
"res1d_catch = Res1D(str(result_file_path_catch)) # Create a Res1D instance with the file\n",
"df_catch = res1d_catch.read() # Read all data from the .res1d file"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4855dd6e-523c-4547-87d5-7806e88afbc9",
"metadata": {},
"outputs": [],
"source": [
"matching_columns_catch = [col for col in df_catch.columns if \"Catchment_name\" in col]\n",
"print(matching_columns_catch)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (Spyder)",
"language": "python3",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.21"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
%% Cell type:code id:214f6c0e-b23f-41e9-946d-9151b77d591c tags:
```
python3
import pandas as pd
from mikeplus import DataTableAccess
from mikeplus.engines import Engine1D
from mikeio1d import Res1D
from mikeio1d.query import QueryDataStructure
from pathlib import Path
```
%% Cell type:markdown id:07c9bb35-946c-4f24-a70b-645452dfa1be tags:
# ST column names
%% Cell type:code id:573590c1-ba7c-45b0-984a-c0fe751a5d1d tags:
```
python3
# Construct the file path
result_file_path = r"path\example_ST.res1d"
res1d = Res1D(str(result_file_path)) # Create a Res1D instance with the file
df = res1d.read() # Read all data from the .res1d file
```
%% Cell type:code id:e022f845-8b2b-4666-a79e-b3a56b95dd75 tags:
```
python3
matching_columns = [col for col in df.columns if "reach|node|structure_name" in col]
print(matching_columns)
```
%% Cell type:markdown id:0373a6a7-42a1-498a-a4b9-f9bfa2ad16b6 tags:
# AD column names
%% Cell type:code id:594eb63b-940e-4300-bf07-f928ed9e2df0 tags:
```
python3
# Construct the file path
result_file_path_ad = r"path\exmaple_AD.res1d"
res1d_ad = Res1D(str(result_file_path_ad)) # Create a Res1D instance with the file
df_ad = res1d_ad.read() # Read all data from the .res1d file
```
%% Cell type:code id:ee6ed680-a425-4b2c-9a4c-9a8fea7a6dc9 tags:
```
python3
matching_columns_ad = [col for col in df_ad.columns if "reach|node|structure_name" in col]
print(matching_columns_ad)
```
%% Cell type:markdown id:d2cdf6b2-af96-42be-a389-96836c03bfb3 tags:
# Catchment column names
%% Cell type:code id:fcaba177-d464-4368-be7b-5cf293b271d5 tags:
```
python3
# Construct the file path
result_file_path_catch = r"path\example_Catchment_discharge_quality.res1d"
res1d_catch = Res1D(str(result_file_path_catch)) # Create a Res1D instance with the file
df_catch = res1d_catch.read() # Read all data from the .res1d file
```
%% Cell type:code id:4855dd6e-523c-4547-87d5-7806e88afbc9 tags:
```
python3
matching_columns_catch = [col for col in df_catch.columns if "Catchment_name" in col]
print(matching_columns_catch)
```
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