Skip to content

forceliuss/feup_spdat

Repository files navigation

Scour Protection Damage Assessment Tool

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.

Overview

This tool processes bathymetric data before and after construction events to:

  1. Identify and quantify scour protection damage
  2. Calculate volume of material displacement
  3. Classify damage severity
  4. Identify and analyze leg footprints
  5. Visualize results with 2D/3D plots

Data Storage

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)

Database Setup

The application uses a local PostgreSQL database that is automatically deployed with Docker Compose.

Using Docker Compose (Recommended)

  1. Copy the environment file:
cp .env.example .env
  1. Start the services:
docker-compose up -d

This 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.

Manual Database Setup (Alternative)

If you prefer to run PostgreSQL manually:

  1. Install PostgreSQL 15
  2. Create a database named scour_analysis
  3. Copy .env.example to .env and update the database connection settings
  4. Run the schema initialization:
psql -d scour_analysis -f src/utils/database/DDL.sql

Features

  • 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

Installation

  1. Clone this repository:
git clone https://github.com/yourusername/scour_analysis.git
cd scour_analysis
  1. 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

Requirements

  • 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

Usage

  1. Run the Streamlit app:
cd scour_analysis
streamlit run app.py
  1. Access the app in your browser (typically at http://localhost:8501)

  2. Use the app:

    • Adjust analysis parameters
    • View the results and visualizations
    • Export data and reports

Data Format

The application accepts the following data formats:

Bathymetry Data

  • CSV/XYZ files with columns for x, y, z coordinates
  • GeoTIFF raster files

LPA (Leg Penetration Assessment) Data

  • CSV with leg ID, position (x, y), penetration depth, radius, and date

Metocean Data

  • CSV with date, wave height, wave direction, and current speed

Configuration

Seting the authentication

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')

Create new users

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 automatically

Database implementation

Run 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

Contributors

Acknowledgments

  • Offshore Wind Industry
  • Data providers

About

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 tool was developed under a Master thesis work by Alberto Forcelius

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages