Skip to main content

Earth Engine to xarray interface

Project description

wxee .-- -..-

Earth Engine Python PyPI conda-forge Open in Colab Read the Docs Build status Code coverage
Demo downloading weather data to xarray using wxee.

What is wxee?

wxee was built to make processing gridded, mesoscale time series data quick and easy by integrating the data catalog and processing power of Google Earth Engine with the flexibility of xarray, with no complicated setup required. To accomplish this, wxee implements convenient methods for data processing, aggregation, downloading, and ingestion.

wxee can be found in the Earth Engine Developer Resources!

Features

To see some of the capabilities of wxee and try it yourself, check out the interactive notebooks here!

Install

Pip

pip install wxee

Conda

conda install -c conda-forge wxee

From Source

git clone https://github.com/aazuspan/wxee
cd wxee
make install

Quickstart

Setup

Once you have access to Google Earth Engine, just import and initialize ee and wxee.

import ee
import wxee

wxee.Initialize()

Download Images

Download and conversion methods are extended to ee.Image and ee.ImageCollection using the wx accessor. Just import wxee and use the wx accessor.

xarray

ee.ImageCollection("IDAHO_EPSCOR/GRIDMET").wx.to_xarray()

NetCDF

ee.ImageCollection("IDAHO_EPSCOR/GRIDMET").wx.to_xarray(path="data/gridmet.nc")

GeoTIFF

ee.ImageCollection("IDAHO_EPSCOR/GRIDMET").wx.to_tif()

Create a Time Series

Additional methods for processing image collections in the time dimension are available through the TimeSeries subclass. A TimeSeries can be created from an existing ee.ImageCollection

col = ee.ImageCollection("IDAHO_EPSCOR/GRIDMET")
ts = col.wx.to_time_series()

Or instantiated directly just like you would an ee.ImageCollection!

ts = wxee.TimeSeries("IDAHO_EPSCOR/GRIDMET")

Aggregate Daily Data

Many weather datasets are in daily or hourly resolution. These can be aggregated to coarser resolutions using the aggregate_time method of the TimeSeries class.

ts = wxee.TimeSeries("IDAHO_EPSCOR/GRIDMET")
monthly_max = ts.aggregate_time(frequency="month", reducer=ee.Reducer.max())

Calculate Climatological Means

Long-term climatological means can be calculated using the climatology_mean method of the TimeSeries class.

ts = wxee.TimeSeries("IDAHO_EPSCOR/GRIDMET")
mean_clim = ts.climatology_mean(frequency="month")

Contribute

Bugs or feature requests are always appreciated! They can be submitted here.

Code contributions are also welcome! Please open an issue to discuss implementation, then follow the steps below. Developer setup instructions can be found in the docs.

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

wxee-0.4.1.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

wxee-0.4.1-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file wxee-0.4.1.tar.gz.

File metadata

  • Download URL: wxee-0.4.1.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.24.0

File hashes

Hashes for wxee-0.4.1.tar.gz
Algorithm Hash digest
SHA256 85f29f902270121e8d1e079bf4d7f3eb7770eac2bb2737a3cc230445bdd54699
MD5 a8c3fd83ef4f8987147555ab19aa1479
BLAKE2b-256 d4544eeb22086f30bccce9fb099697b12f284a9e821feca6cb4077f426c40405

See more details on using hashes here.

File details

Details for the file wxee-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: wxee-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.24.0

File hashes

Hashes for wxee-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3514d5c1b05000e24fe4ebbabdc4445644559b3a3474930aa9d95b8a76c65fcc
MD5 9a123de432aecfeed827d25df97e80dd
BLAKE2b-256 31c8659d37973153edc6ae2ebfcc6a10938cdc1ec66b9b2bb7ec2616346dfb33

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