Quickstart

The Descartes Labs Platform simplifies analysis of global-scale raster data by providing:

  • Access to a catalog of petabytes of disparate geospatial data, all normalized and interoperable through one common interface
  • Infrastructure to parallelize any code across thousands of machines co-located with that data
  • The ability to add new data to that catalog—whether the output of analysis on existing data, or from a proprietary source—which can then be used as an input for more analysis
  • A Python client library to access these systems
  • Web interfaces to browse this catalog and view imagery, including your data you create

You can use it like this:

$ pip install "descarteslabs[complete]"
$ descarteslabs auth login
In [1]: import descarteslabs as dl

In [2]: import numpy as np

In [3]: sangre_de_cristo_geojson = {
   ...:   "type": "Polygon",
   ...:   "coordinates": [[
   ...:     [-106, 35.5], [-105, 35.5], [-105, 36.5], [-106, 36.5], [-106, 35.5]
   ...:   ]]
   ...: }
   ...: 

In [4]: scenes, geoctx = dl.scenes.search(
   ...:   sangre_de_cristo_geojson,
   ...:   products=["sentinel-2:L1C", "landsat:LC08:01:T1:TOAR"],
   ...:   start_datetime="2016-12-01",
   ...:   end_datetime="2018-03-01",
   ...:   cloud_fraction=0.1,
   ...: )
   ...: 

In [5]: winter_scenes = scenes.filter(
   ...:   lambda scene: scene.properties.date.month in [12, 1, 2]
   ...: )
   ...: 

In [6]: winter_scenes
Out[6]: 
SceneCollection of 30 scenes
  * Dates: Dec 03, 2016 to Feb 12, 2018
  * Products: landsat:LC08:01:T1:TOAR: 17, sentinel-2:L1C: 13

In [7]: ndarray_stack = winter_scenes.stack(
   ...:   "red green blue",
   ...:   geoctx.assign(resolution=150)
   ...: )
   ...: 

In [8]: ndarray_stack.shape
Out[8]: (30, 3, 737, 606)

In [9]: winter_composite = np.ma.median(ndarray_stack, axis=0)

In [10]: dl.scenes.display(winter_composite, title="Median composite of winter Sange de Cristo range 2016-2018", size=6)
https://cdn.descarteslabs.com/docs/_images/winter_composite.png

This example shows the core interaction with the Platform: searching for imagery and loading it.

These are the components of the Python client to explore next:

  • descarteslabs.scenes: Object-oriented interface to search for and load imagery. This is the recommended interface for new users.
  • Lower-level clients to search for and load imagery. Note that these will eventually be deprecated as functionality is added to the object-oriented interface.
    • Metadata: Find out what data exists that matches your criteria.
    • Raster: Load data as ndarrays or image files, while handling clipping, reprojection, resampling, and mosaicing of overlapping scenes.
  • Tasks: Run any Python function in parallel in the cloud: similar to AWS Batch or Google Cloud Functions, but with unlimited execution time and zero setup.
    • Storage: Key-value blob storage atop Google Cloud Storage, authenticated through your Descartes Labs account—helpful for persisting data from Tasks.
  • Catalog: Add new data to the Platform. The interface overlaps somewhat with Metadata; the two may eventually be merged.