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 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!
pip install wxee
conda install -c conda-forge wxee
Once you have access to Google Earth Engine, just import and initialize ee
and wxee
.
import ee
import wxee
wxee.Initialize()
Download and conversion methods are extended to ee.Image
and ee.ImageCollection
using the
wx
accessor. Just import wxee
and use the wx
accessor.
ee.ImageCollection("IDAHO_EPSCOR/GRIDMET").wx.to_xarray()
ee.ImageCollection("IDAHO_EPSCOR/GRIDMET").wx.to_tif()
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")
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())
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")
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.