Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

One minute guide

A minimum example to do something useful with the package

Well, first, import the package

import seaduck as sd

Prepare a xarray.Dataset. For example, you could use a build in function to download a function

ds = sd.utils.get_dataset("ecco")
Downloading file 'ecco.tar.gz' from 'doi:10.5281/zenodo.15884732/ecco.tar.gz' to '/home/runner/.cache/seaduck'.
Loading...
Untarring contents of '/home/runner/.cache/seaduck/ecco.tar.gz' to '/home/runner/.cache/seaduck/ecco.tar.gz.untar'

Figure out where and when you want to do the interpolation

longitude = -11.0
latitude = 71.0
depth = -5.0
time = sd.utils.convert_time("1992-02")

That’s all you need to retrieve the data.

s = sd.OceInterp(ds, "SALT", longitude, latitude, depth, time)

The package can do much more than this, and it is not much harder than this. To learn more, take a look at other tutorials, for example here.