Skip to main content

Earth Engine to xarray interface

Project description

.. image:: :alt: wxee .-- -..- :width: 200 :target:


.. image:: :alt: PyPI :target: .. image:: :alt: conda-forge :target: .. image:: :alt: Open in Colab :target: .. image:: :alt: Read the Docs :target: .. image:: :alt: Build status :target: .. image:: :alt: Code coverage :target: .. image:: :alt: Language Grade: Python :target: .. image:: :alt: Black code style :target: .. image:: :alt: GLP3 License :target:

.. image:: :alt: 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 <>_!


  • Time series image collections to xarray <>, NetCDF <>, or GeoTIFF <>_ in one line of code
  • Climatological anomalies <>_ and temporal aggregation <>, interpolation <>, smoothing <>, and gap-filling <> in Earth Engine
  • Color composite plots <>_ from xarray datasets
  • Parallel processing for fast downloads

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



.. code-block:: bash

   pip install wxee


.. code-block:: bash

conda install -c conda-forge wxee

From Source

.. code-block:: bash

   git clone
   cd wxee
   make install


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

.. code-block:: python
   import ee
   import wxee


Download Images

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

xarray ^^^^^^

.. code-block:: python


NetCDF ^^^^^^

.. code-block:: python


GeoTIFF ^^^^^^^

.. code-block:: python


Create a Time Series

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

.. code-block:: python

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

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

.. code-block:: python

   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 :code:aggregate_time method of the :code:TimeSeries class.

.. code-block:: python

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 :code:`climatology_mean` method of the :code:`TimeSeries` class.

.. code-block:: python

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


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.

Files for wxee, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size wxee-0.3.2.tar.gz (43.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page