ecmwf / earthkit-data

A format-agnostic Python interface for geospatial data
Apache License 2.0
55 stars 13 forks source link

Add source to load sample data #318

Closed sandorkertesz closed 7 months ago

sandorkertesz commented 7 months ago

This PR adds the from_sample method to access data stored on the download server in folder earthkit/samples. The primary goal is to help users to quickly access data used for the examples in earthkit-maps and earthkit-data.

This is how it works:

from earthkit.data import from_sample
ds = from_sample("storm_ophelia_wind_850.grib")

Alternatively we could introduce another source "sample" to implement this feature, e.g.:

from earthkit.data import from_source
ds = from_source("sample", "storm_ophelia_wind_850.grib")
tlmquintino commented 7 months ago

yes please dont add another function. from_source does it well. a "sample" is a source after all :-)

sandorkertesz commented 7 months ago

The feature is now implemented as a sample source:

image