diff --git a/xee/__init__.py b/xee/__init__.py index d38c319..cc7643b 100644 --- a/xee/__init__.py +++ b/xee/__init__.py @@ -42,3 +42,4 @@ 'EarthEngineStore', 'EarthEngineBackendArray', ] + diff --git a/xee/micro_benchmarks.py b/xee/micro_benchmarks.py index 18d2af8..3f1479f 100644 --- a/xee/micro_benchmarks.py +++ b/xee/micro_benchmarks.py @@ -37,22 +37,31 @@ def init_ee_for_tests(): + ee.Initialize(opt_url='https://earthengine-highvolume.googleapis.com') +_GRID_PARAMS = { + 'crs': 'EPSG:4326', + 'crs_transform': (0.25, 0, -180.0, 0, -0.25, 90.0), + 'shape_2d': (1440, 720), +} + + def open_dataset() -> None: _ = xarray.open_dataset( - 'NASA/GPM_L3/IMERG_V06', engine=xee.EarthEngineBackendEntrypoint + 'NASA/GPM_L3/IMERG_V06', + engine=xee.EarthEngineBackendEntrypoint, + **_GRID_PARAMS, ) def open_and_chunk() -> None: ds = xarray.open_dataset( 'NASA/GPM_L3/IMERG_V06', - crs='EPSG:4326', - scale=0.25, chunks={'index': 24, 'width': 512, 'height': 512}, engine=xee.EarthEngineBackendEntrypoint, + **_GRID_PARAMS, ) ds.chunk() @@ -61,10 +70,9 @@ def open_and_write() -> None: with tempfile.TemporaryDirectory() as tmpdir: ds = xarray.open_dataset( 'NASA/GPM_L3/IMERG_V06', - crs='EPSG:4326', - scale=0.25, chunks={'time': 24, 'lon': 1440, 'lat': 720}, engine=xee.EarthEngineBackendEntrypoint, + **_GRID_PARAMS, ) ds = ds.isel(time=slice(0, 24)) ds.to_zarr(os.path.join(tmpdir, 'imerg.zarr'))