Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

depth

Bathymetric depth at each point, from a GEBCO gridded NetCDF file.

geoenrich depth <INPUT> --data <GEBCO.nc> [OPTIONS]

Appends one column, bathymetry (rename with --column), holding the GEBCO elevation at each point in meters.

How it works

GEBCO is a regular lon/lat grid, so no nearest-neighbor search is needed. The lat and lon axes are read once to learn each axis origin and spacing, then every point maps straight to its nearest grid cell by arithmetic and reads the single elevation cell. Longitudes are normalized to [-180, 180), and points off the grid yield a null.

GEBCO elevation is negative below sea level. By default the value is reported as stored (negative under water); --positive flips the sign so depth reads positive under water and land reads negative.

This command needs no region: a grid lookup is global by construction.

Options

Beyond the shared options:

OptionDefaultMeaning
--data <FILE>requiredGEBCO bathymetry NetCDF file
--positiveoffReport depth as positive below sea level
--column <NAME>bathymetryOutput column name

Example

# Reading and writing gzipped CSV
geoenrich depth cores.csv.gz \
  --data ./data/gebco/GEBCO_2024_sub_ice.nc \
  --positive -o cores.depth.csv.gz

The depth command links the HDF5 / NetCDF C libraries; see Installation. See Reference datasets for how to obtain the GEBCO grid.