| title | Quickstart |
|---|
Get up and running with Xee in a few minutes.
pip install --upgrade xeeOptional (plotting): pip install matplotlib. For full installation options, see Installation.
You need an Earth Engine–enabled Google Cloud project. If you haven't done this yet, follow the Earth Engine Access guide.
Authenticate once on a persistent machine:
earthengine authenticateOr inside ephemeral environments (e.g. Colab):
import ee
ee.Authenticate()Initialize (high-volume endpoint recommended for reading stored collections):
import ee
ee.Initialize(
project='YOUR-PROJECT-ID',
opt_url='https://earthengine-highvolume.googleapis.com'
)For computed collections (server-side expressions), omit opt_url to use the standard endpoint, which benefits from caching during iterative development.
import ee, xarray as xr
from xee import helpers
ic = ee.ImageCollection('ECMWF/ERA5_LAND/MONTHLY_AGGR')
grid = helpers.extract_grid_params(ic) # match source projection & resolution
ds = xr.open_dataset(ic, engine='ee', **grid)
print(ds):class: tip
- Exploratory analysis: use `helpers.extract_grid_params(...)`.
- Fixed output shape (for model inputs): use `helpers.fit_geometry(..., grid_shape=...)`.
- Fixed physical resolution: use `helpers.fit_geometry(..., grid_scale=...)`.
- Manual `crs` / `crs_transform` / `shape_2d`: advanced alignment workflows only.
:class: note
Xee accepts both plain Earth Engine asset IDs (for example,
`ECMWF/ERA5_LAND/MONTHLY_AGGR`) and URI forms (for example,
`ee://ECMWF/ERA5_LAND/MONTHLY_AGGR`).
:class: tip
`xr.open_dataset(..., engine='ee')` is the primary user entrypoint for Xee.
For the complete, canonical parameter reference (including defaults and backend
behavior), see [Open Dataset Reference](open_dataset.md).
Plot the first time slice (matplotlib required):
ds['temperature_2m'].isel(time=0).plot()| Goal | Where to go |
|---|---|
| Learn grid parameter patterns | Concepts |
| Fit a custom area or scale | User Guide |
| API signatures | API Reference |
| Migrate 0.0.x code | Migration Guide |
| Performance tips | Performance & Limits |
| Troubleshooting common issues | FAQ |
- Install Xee & authenticate EE
- Initialize EE client
- Derive grid parameters (match source or fit a geometry)
- Call
xr.open_dataset(..., engine='ee', **grid) - Use Xarray normally (select, compute, visualize, export)
AOI means area of interest.
import shapely
from xee import helpers
aoi = shapely.geometry.box(113.33, -43.63, 153.56, -10.66) # Australia
grid = helpers.fit_geometry(
geometry=aoi,
grid_crs='EPSG:4326', # degrees
grid_shape=(256, 256) # (width, height) pixels
)
ds = xr.open_dataset('ee://ECMWF/ERA5_LAND/MONTHLY_AGGR', engine='ee', **grid)See the FAQ and open a discussion if needed.