A Streamlit application for analyzing and visualizing damage to scour protection layers during offshore wind farm construction, with a focus on jack-up leg footprints.
This tool processes bathymetric data before and after construction events to:
- Identify and quantify scour protection damage
- Calculate volume of material displacement
- Classify damage severity
- Identify and analyze leg footprints
- Visualize results with 2D/3D plots
This project uses a local PostgreSQL database and local files for development environment.
- Local files path:
src/utils/source_files - Database files path:
src/utils/database - Database: PostgreSQL 15 (deployed via Docker)
The application uses a local PostgreSQL database that is automatically deployed with Docker Compose.
- Copy the environment file:
cp .env.example .env- Start the services:
docker-compose up -dThis will start:
- PostgreSQL database on port 5432
- Streamlit application on port 8501
The database schema will be automatically initialized from src/utils/database/DDL.sql.
If you prefer to run PostgreSQL manually:
- Install PostgreSQL 15
- Create a database named
scour_analysis - Copy
.env.exampleto.envand update the database connection settings - Run the schema initialization:
psql -d scour_analysis -f src/utils/database/DDL.sql- Data Processing: Handles various bathymetry formats (.csv, .xyz, .geotiff)
- Damage Quantification: Calculates volume of removed material and affected area
- Footprint Detection: Identifies and analyzes jack-up leg footprints
- Classification: Categorizes damage into low, medium, and high severity
- Visualization: Interactive 2D/3D plots of bathymetry and damage
- Reporting: Export analysis results
- Clone this repository:
git clone https://github.com/yourusername/scour_analysis.git
cd scour_analysis- Create a virtual environment and install dependencies:
# Using conda
conda create -n scour_env python=3.9
conda activate scour_env
# Or using venv
python -m venv scour_env
source scour_env/bin/activate # On Windows: scour_env\Scripts\activate
# Install requirements
pip install -r requirements.txt- Python 3.8+
- Streamlit
- NumPy
- Pandas
- Matplotlib
- Plotly
- SciPy
- scikit-learn
- PyYAML
- Rasterio
Create a requirements.txt file with:
streamlit>=1.22.0
numpy>=1.20.0
pandas>=1.3.0
matplotlib>=3.5.0
plotly>=5.10.0
scipy>=1.7.0
scikit-learn>=1.0.0
pyyaml>=6.0
rasterio>=1.3.0- Run the Streamlit app:
cd scour_analysis
streamlit run app.py-
Access the app in your browser (typically at http://localhost:8501)
-
Use the app:
- Adjust analysis parameters
- View the results and visualizations
- Export data and reports
The application accepts the following data formats:
- CSV/XYZ files with columns for x, y, z coordinates
- GeoTIFF raster files
- CSV with leg ID, position (x, y), penetration depth, radius, and date
- CSV with date, wave height, wave direction, and current speed
To setup the authentication, just descomment the Authentication Blocks on the app.py file.
Example:
# ----- AUTHENTICATION BLOCK -----
# if st.session_state["authentication_status"]:
# with st.container(key="default_page_container"):
# default_page()
# elif st.session_state["authentication_status"] == False:
# st.error('Username/password is incorrect')To create new user just add a new object the users.yaml file
credentials:
usernames:
[...]
new-user:
email: email@example.com
client_id: client_id
failed_login_attempts: 0 # Will be managed automatically
first_name: FirstName
last_name: LastName
logged_in: False # Will be managed automatically
password: new-password # Will be hashed automaticallyRun the docker compose file to setup the databse locally.
The config.yaml file contains settings for:
- Analysis parameters (resolution, thresholds)
- Visualization settings
- Sample data paths
- Coordinate reference system information
- Alberto Ribas Marcondes Forcelius (alberto@forcelius.com)
- Luciana Paiva das Neves (-)
- Offshore Wind Industry
- Data providers