Skip to content

ocean-uhh/cruiseplan

Repository files navigation

CruisePlan

🌊 Comprehensive Oceanographic Research Cruise Planning System β€” Streamlining the process of planning oceanographic research expeditions.

Tests Python 3.9+ License: MIT Documentation

Background & Context

The Challenge: Oceanographic cruise planning involves complex route and timing calculations, frequent unit conversions (nautical miles <-> kilometers, decimal degrees <-> degrees decimal minutes), and rapid plan updates. Different people may need different formats--spreadsheets for quick calculations, degrees/decimal minutes for navigation, kilometers for station spacing, knots for voyage timing. Using historical station locations may be preferred, but can be tricky to access.

  • Fragmented Tools: Scattered spreadsheets, manual calculations, custom code snippets
  • Time-Intensive Processes: Semi-manual station planning, timing calculations, and proposal formatting
  • Error-Prone Workflows: Manual depth lookups, coordinate formatting, and schedule validation

The Solution: CruisePlan provides an integrated, semi-automated system for an efficient cruise-planning workflow.

Target Audience

Primary Users:

  • πŸ”¬ Oceanographic Researchers: Principal investigators designing research expeditions
  • πŸ“Š Students: Graduate students learning cruise planning methodology
  • πŸ“‹ Proposal Writers: Scientists preparing funding proposals with detailed cruise plans

Research Domains: The primary development of CruisePlan is for physical oceanographers, with CTD stations, mooring deployments and glider operations as default. However, it is possible to incorporate any type of point, line or area operation of a ship with a specified manual duration based on your own experience.

CruisePlan transforms complex cruise planning from a weeks-long manual process into a structured, validated workflow that produces proposal-ready documentation with some checks on operational feasibility.

⚠️ Breaking Changes in v0.3.0: Commands cruiseplan download and cruiseplan pandoi have been removed. Parameter names shortened (--bathymetry-* β†’ --bathy-*). See MIGRATION_v0.3.0.md for migration guide and CHANGELOG.md for complete changes.

⚠️ Breaking Changes in v0.3.3: YAML configuration now uses transects: instead of transits: for scientific line operations and waypoints: instead of stations: for point operations.

⚠️ Breaking Changes in v0.3.6: Major architecture refactoring - module renaming for improved clarity:

  • cruiseplan.schema β†’ cruiseplan.config (Configuration schemas and validation)
  • cruiseplan.core β†’ cruiseplan.runtime (Business logic and data processing)
  • cruiseplan.calculators β†’ cruiseplan.timeline (Scheduling algorithms and timeline generation)

Disclaimer: This software is provided "as is" without warranty of any kind. Users are responsible for validating all calculations, timing estimates, and operational feasibility for their specific cruise requirements. Always consult with marine operations staff and verify all outputs before finalizing cruise plans.

πŸ“˜ Full documentation available at:
πŸ‘‰ https://ocean-uhh.github.io/cruiseplan/


πŸš€ What's Included

  • βœ… Interactive station planning: Click-to-place stations on bathymetric maps with real-time depth feedback
  • πŸ““ PANGAEA integration: Browse and incorporate past cruise data for context
  • πŸ“„ Multi-format outputs: Generate NetCDF, LaTeX reports, PNG maps, KML files, and CSV data
  • πŸ” Cruise validation: Automated checking of cruise configurations and operational feasibility
  • 🎨 Documentation: Sphinx-based docs with API references and usage guides
  • πŸ“¦ Modern Python packaging: Complete with testing, linting, and CI/CD workflows
  • 🧾 Scientific citation support: CITATION.cff for academic attribution

Architecture Overview

CruisePlan follows a modular architecture with clear separation of concerns:

πŸ—οΈ Core Module Structure

  • cruiseplan.config: Configuration schemas and validation (CruiseConfig, activities, ports)
  • cruiseplan.runtime: Business logic and data processing (CruiseInstance, enrichment, validation)
  • cruiseplan.timeline: Scheduling algorithms and timeline generation

πŸ”„ API-First Design

CruisePlan provides both programmatic API and command-line interface:

import cruiseplan

# Notebook-friendly API
timeline, files = cruiseplan.schedule(config_file="cruise.yaml", format="html")

# Advanced usage
from cruiseplan.runtime.cruise import CruiseInstance
from cruiseplan.timeline.scheduler import generate_timeline

πŸ“ Project Structure

cruiseplan/
β”œβ”€β”€ .github/workflows/          # CI/CD: tests, docs, PyPI publishing
β”œβ”€β”€ docs/                       # Sphinx documentation (when available)
β”œβ”€β”€ notebooks/                  # Example notebooks and demos
β”œβ”€β”€ cruiseplan/                 # Main Python package
β”‚   β”œβ”€β”€ api/                    # High-level API functions
β”‚   β”œβ”€β”€ cli/                    # Command-line interface modules  
β”‚   β”œβ”€β”€ config/                 # πŸ†• Configuration schemas and validation
β”‚   β”‚   └── exceptions.py       # Custom exception classes
β”‚   β”œβ”€β”€ runtime/                # πŸ†• Business logic and data processing
β”‚   β”œβ”€β”€ timeline/               # πŸ†• Scheduling and timeline generation
β”‚   β”œβ”€β”€ data/                   # Bathymetry and PANGAEA data handling
β”‚   β”œβ”€β”€ interactive/            # Interactive station picking tools
β”‚   β”œβ”€β”€ output/                 # Multi-format output generators
β”‚   └── utils/                  # Utilities and coordinate handling
β”œβ”€β”€ tests/                      # Comprehensive pytest test suite
β”‚   β”œβ”€β”€ api/, cli/, core/       # Organized test modules
β”‚   β”œβ”€β”€ fixtures/               # Test data and configurations
β”‚   β”œβ”€β”€ integration/            # End-to-end workflow tests
β”‚   └── unit/                   # Fast unit tests
β”œβ”€β”€ data/                       # Sample bathymetry datasets
└── Configuration files...      # .gitignore, pyproject.toml, etc.

Key Improvements in v0.3.6:

  • βœ… Clear module boundaries: Config β†’ Runtime β†’ Timeline data flow
  • βœ… Better discoverability: Module names match main data types (CruiseConfig, CruiseInstance, CruiseSchedule)
  • βœ… Hierarchical organization: Cruise β†’ Leg β†’ Cluster β†’ Operations
  • βœ… Pydantic validation: Type-safe configuration throughout

πŸ”§ Installation

Option 1: Install from PyPI (Most Users)

For general use, install the latest stable release from PyPI. Note: CruisePlan is in active development (0.x versions) with occasional breaking changes.

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install CruisePlan
pip install cruiseplan

Option 2: Install Latest from GitHub

For the latest features and bug fixes:

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install directly from GitHub
pip install git+https://github.com/ocean-uhh/cruiseplan.git

Option 3: Development Installation

For development or contributing to CruisePlan:

# Clone the repository
git clone https://github.com/ocean-uhh/cruiseplan.git
cd cruiseplan

# Option A: Using conda/mamba
conda env create -f environment.yml
conda activate cruiseplan
pip install -e ".[dev]"

# Option B: Using pip with virtual environment
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -e ".[dev]"

Dependencies: Core packages are listed in requirements.txt, development tools in requirements-dev.txt. The conda environment.yml loads from these files automatically.

To run tests:

pytest tests/

To build the documentation locally:

cd docs
make html

πŸ“š Learn More


🀝 Contributing

Contributions are welcome! Please see our Contributing Guidelines for details on how to get started.

For information about planned improvements and development priorities, see our Development Roadmap.


πŸ™ Acknowledgments & Citation

The original timing algorithms were developed by Yves Sorge and Sunke Trace-Kleeberg. CruisePlan initial software development by Yves Sorge and redesigned by Eleanor Frajka-Williams.

If you use CruisePlan in your research, please cite it using the information in CITATION.cff.


Related Software

The following cruise planning tools may also be of interest (Disclaimer: We have not tested these):

Python/GIS:

Python:

  • dreamcoat - Personal tools for cruise planning

R:

MATLAB:

About

A software tool for planning research cruises. Includes interactive station picking and rough cruise-timing estimators.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors