Skip to main content

A Google Earth Engine extension for Xarray.

Project description

Xee: Xarray + Google Earth Engine

Xee Logo

An Xarray extension for Google Earth Engine.

image image Conda Recipe image Conda Downloads

How to use

Install with pip:

pip install --upgrade xee

Install with conda:

conda install -c conda-forge xee

Then, authenticate Earth Engine:

earthengine authenticate --quiet

Now, in your Python environment, make the following imports:

import ee
import xarray

Next, initialize the EE client with the high volume API:

ee.Initialize(opt_url='https://earthengine-highvolume.googleapis.com')

Open any Earth Engine ImageCollection by specifying the Xarray engine as 'ee':

ds = xarray.open_dataset('ee://ECMWF/ERA5_LAND/HOURLY', engine='ee')

Open all bands in a specific projection (not the Xee default):

ds = xarray.open_dataset('ee://ECMWF/ERA5_LAND/HOURLY', engine='ee',
                         crs='EPSG:4326', scale=0.25)

Open an ImageCollection (maybe, with EE-side filtering or processing):

ic = ee.ImageCollection('ECMWF/ERA5_LAND/HOURLY').filterDate('1992-10-05', '1993-03-31')
ds = xarray.open_dataset(ic, engine='ee', crs='EPSG:4326', scale=0.25)

Open an ImageCollection with a specific EE projection or geometry:

ic = ee.ImageCollection('ECMWF/ERA5_LAND/HOURLY').filterDate('1992-10-05', '1993-03-31')
leg1 = ee.Geometry.Rectangle(113.33, -43.63, 153.56, -10.66)
ds = xarray.open_dataset(
    ic,
    engine='ee',
    projection=ic.first().select(0).projection(),
    geometry=leg1
)

Open multiple ImageCollections into one xarray.Dataset, all with the same projection:

ds = xarray.open_mfdataset(['ee://ECMWF/ERA5_LAND/HOURLY', 'ee://NASA/GDDP-CMIP6'],
                           engine='ee', crs='EPSG:4326', scale=0.25)

Open a single Image by passing it to an ImageCollection:

i = ee.ImageCollection(ee.Image("LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140318"))
ds = xarray.open_dataset(i, engine='ee')

See examples or docs for more uses and integrations.

License

This is not an official Google product.

Copyright 2023 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Project details


Download files

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

Source Distribution

xee-0.0.4.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

xee-0.0.4-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file xee-0.0.4.tar.gz.

File metadata

  • Download URL: xee-0.0.4.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for xee-0.0.4.tar.gz
Algorithm Hash digest
SHA256 f2e1a63e8bb58f6758a821d8508b5415b543b09bcd069a72927000bbd4ae980c
MD5 fe72ff05a1d232cf513bb2bc190e25f6
BLAKE2b-256 6b5ca2b9dfc47e312a59e4c1f2b5798f88c0b15240d8ec57efe3d65ad2453009

See more details on using hashes here.

File details

Details for the file xee-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: xee-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for xee-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3e2b9e138b584bb8606f1af0eddcdb5f20331774b761d22fcfcd3f8ad23612d0
MD5 30bac4fc6608a52293fe744b512d1297
BLAKE2b-256 3223daf0febb75752919dd6ff9e560d2d892bd73d6fcd0a18ddd2ca395c9c6b3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page