Skip to main content

ctdcast

Tests Python 3.10–3.13 License: MIT Docs

Self-contained HTML report generator for shipboard CTD and LADCP data. Produces portable HTML files — all figures embedded as base64 PNGs, no external requests — for three report types: per-cast station pages, transect section pages, and a cruise-wide time series page.

Designed for use at sea where internet connectivity is limited or absent. All output files are fully self-contained and work offline.


Install

pip install ctdcast

For development (editable install from source):

git clone https://github.com/ocean-uhh/ctdcast
cd ctdcast
python -m venv venv
source venv/bin/activate        # macOS / Linux
# venv\Scripts\activate         # Windows
pip install -e .

Dependencies: gsw, matplotlib, numpy, xarray, netcdf4, jinja2, pyyaml, scipy

CTD conversion: seasenselib converts raw CNV files to the netCDF format expected by ctdcast (ctdcast draft or ctdcast run --ctd). Install with pip install seasenselib. Pre-converted netCDF files from other tools must match ctdcast's variable naming convention (see docs).

To verify the installation, run the bundled demo against the committed fixture casts:

ctdcast run config_demo.yaml   # writes demo_report/index.html

For a full walkthrough see the Quickstart guide.


Quick start

Quick look (no config file needed)

Raw CNV files fresh off the instrument? One command gives you station pages + index + map:

ctdcast draft /path/to/cnv/           # generates ./ctd_draft/index.html
ctdcast draft /path/to/cnv/ out/ --cruise odb2026   # with cruise ID
ctdcast draft /path/to/cnv/ --dry-run               # preview what would happen

Requires seasenselib for CNV conversion (pip install seasenselib).

Full workflow (with config)

For sections, time series, and LADCP panels you need a config.yaml:

1. Write a config

ctdcast init                        # writes a template config.yaml
ctdcast init --interactive          # guided setup: prompts for paths and
                                      # auto-detects sections/timeseries from profiles.nc
ctdcast validate config.yaml        # check paths before the first run

2. Generate

ctdcast run config.yaml             # smart update — skips up-to-date pages
ctdcast run config.yaml --force     # rebuild everything
ctdcast run config.yaml --cast 42   # rebuild one cast page

Open <output.dir>/index.html in any browser.


Input data

File Description
cnv_nc/*.nc Per-cast netCDF files, one per CTD cast
profiles.nc Compiled profiles on a 1 dbar grid
ctd_sections.yaml Section definitions — which casts belong to each transect

ctd_sections.yaml format

sections:
  KTout:
    description: "Kögur Transect outflow"
    color: "#e41a1c"
    cast_numbers: [[1, 12], 15]   # ranges and/or individual cast numbers
  FARDWO:
    description: "FARDWO mooring array"
    color: "#377eb8"
    cast_numbers: [[20, 35], "22b"]   # add "NNNb" to include a lettered sibling cast

Cast numbers are kept in the order written. An integer or range selects the plain casts; a lettered sibling event (from a NNNb / NNN_b file) is a distinct cast and must be named explicitly as a quoted "NNNb" string.


Output structure

<output.dir>/
    index.html              front page — map + stats + navigation
    casts.html      table of all casts (latest first)
    sections.html           section cards with links
    timeseries.html         T, S, O₂ vs time × pressure
    casts/
        cast_001.html
        cast_002.html
        ...
    sections/
        section_KTout.html
        ...

Each station page shows: CT profile, T/S/σ₀ triple-axis profile, T-S diagram coloured by O₂ saturation, auxiliary profiles (O₂, fluorescence, turbidity), N²/Turner-angle stability panels, and a cruise-track map with the cast highlighted.


GEBCO bathymetry

Maps show GEBCO 2025 bathymetry when gebco_nc is set in config.yaml. The file (~8 GB) is not bundled. Maps render without bathymetry if the path is missing — not an error.


Documentation

Full documentation: ocean-uhh.github.io/ctdcast

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ctdcast-0.1.0.tar.gz (181.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ctdcast-0.1.0-py3-none-any.whl (194.1 kB view details)

Uploaded Python 3

File details

Details for the file ctdcast-0.1.0.tar.gz.

File metadata

  • Download URL: ctdcast-0.1.0.tar.gz
  • Upload date:
  • Size: 181.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ctdcast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 153041769793ba204747842588027c6d1e698aec5b2026b3cd347c9616e9022b
MD5 dc9294f7a4af028a9cbb4d1291bfa68d
BLAKE2b-256 e12ab8f661df90765971b6d4301a3d1ccf7291650438924a97e1b73a1eb3820a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctdcast-0.1.0.tar.gz:

Publisher: pypi.yml on ocean-uhh/ctdcast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ctdcast-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ctdcast-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 194.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ctdcast-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e04d49917374b4ba4a4000af8e44acd0e30db6ac8bc143f85be3735ebbb78c6c
MD5 e384fdd83bd897fda196061f6618c04f
BLAKE2b-256 fae5333f534c0b2b9314c77287fbe0cee0076c1ef63be7aab25ea17825258e2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctdcast-0.1.0-py3-none-any.whl:

Publisher: pypi.yml on ocean-uhh/ctdcast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page