Skip to content

lversen/Equinor-Project

Repository files navigation

WindGNN: Graph Neural Network for Wind Field Prediction

Project Overview

WindGNN is a machine learning project that uses Graph Neural Networks (GNNs) to predict wind fields by combining CARRA (Copernicus Arctic Regional ReAnalysis) data with Sentinel-1 SAR (Synthetic Aperture Radar) satellite observations. The model aims to provide accurate wind field predictions by leveraging the spatial relationships between different data points.

Features

  • Preprocessing pipeline for CARRA and Sentinel-1 data
  • Graph Neural Network architecture for wind field prediction
  • Custom loss function for wind speed prediction
  • Training and evaluation framework
  • Data visualization tools

Requirements

  • PyTorch
  • PyTorch Geometric
  • NumPy
  • Pandas
  • Scikit-learn
  • Matplotlib
  • tqdm
  • haversine

Project Structure

WindGNN/
├── data/
│   ├── data_loader.py          # Data loading and processing utilities
│   └── preprocessing/
│       ├── preprocessing_main.py       # Main preprocessing pipeline
│       ├── preprocessing_functions.py  # Preprocessing utility functions
│       └── preprocessing_variables.py  # Configuration variables
├── models/
│   └── windnet.py              # GNN model architecture
├── training/
│   ├── trainer.py              # Training loop implementation
│   └── metrics.py              # Custom loss functions
└── main.py                     # Main training script

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/WindGNN.git
cd WindGNN
  1. Install dependencies:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
pip install -r requirements.txt

Data Preparation

The project requires two types of data:

  1. CARRA reanalysis data (.csv format)
  2. Sentinel-1 SAR observations (.csv format)

Place your data files in the following directory structure:

WindGNN/
└── csv/
    ├── carra/     # CARRA reanalysis files
    └── s1/        # Sentinel-1 observation files

Data Preprocessing

Run the preprocessing pipeline:

python preprocessing/preprocessing_main.py

This will:

  1. Create graph data from raw input files
  2. Identify suitable timestamps where data overlaps
  3. Create output edges for the graph structure
  4. Find global min/max values for normalization
  5. Perform interpolation for each suitable timestamp

Model Architecture

The WindNet model consists of:

  • CARRA node processing layers
  • CARRA to output grid message passing
  • Output grid processing layers
  • Skip connections (optional)

Key components:

  • GCN layers for node feature processing
  • Graph convolution for message passing
  • Custom scaled MSE loss function

Training

To train the model:

python main.py

The training script will:

  1. Load and preprocess the data
  2. Initialize the WindNet model
  3. Train for the specified number of epochs
  4. Save the model and training history
  5. Evaluate on the test set

Training Parameters

  • Batch size: 32
  • Learning rate: 0.001
  • Number of epochs: 100
  • Gradient clipping: 10.0
  • Loss function: Scaled MSE Loss with ε=4.0, τ=0.425

Results

The training script will generate:

  • Model checkpoint (windnet_model.pth)
  • Training history plot (training_history.png)
  • Test set evaluation metrics

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

[Your chosen license]

Citation

If you use this code in your research, please cite: [Your citation information]

Acknowledgments

  • CARRA data provided by Copernicus Climate Change Service
  • Sentinel-1 data provided by European Space Agency

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages