Mapchete xarray output driver
Project description
This driver enables mapchete to write multidimensional arrays into a tile directory structure.
Usage
Example .mapchete file:
process: process.py
zoom_levels:
min: 0
max: 12
input:
output:
format: xarray
path: /some/output/path
dtype: uint16
bands: 3
storage: zarr # or netcdf
pyramid:
grid: geodetic
metatiling: 2
Example process file:
from dateutil import parser
import numpy as np
import xarray as xr
def execute(mp, stack_height=10):
# create 4D arrays with current tile shape and dtype
arrs = [
np.ones((3, ) + mp.tile.shape, dtype="uint16")
for _ in range(1, stack_height)
]
# create timestamps for each array
timestamps = [parser.parse("2018-04-0%s" % i) for i in range(1, stack_height)]
# build xarray with time axis
timeseries = xr.DataArray(
np.stack(arrs), coords={'time': timestamps}, dims=('time', 'bands', 'x', 'y')
)
# return to write
return timeseries
Installation
# install using pip:
pip install mapchete_xarray
# verify driver is vailable ('xarray' should be listed as output format):
mapchete formats
Current Limitations
no reprojection allowed
when reading from existing output, process metatiling must be smaller than xarray output metatiling
License
MIT License
Copyright (c) 2019-2020 EOX IT Services
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for mapchete_xarray-2021.11.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79f421ecad68d70d20f2da45b9e14fc574088da767d4f8c06af49f216da02eaf |
|
MD5 | a619f1b6ed9aec03fca8befd6e6af3ce |
|
BLAKE2b-256 | 4d8f32c5ca54b0d04a8dc9aded78ea2616a259bcd3af7a6750959237de1467b5 |
Close
Hashes for mapchete_xarray-2021.11.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ceb17efa273cbdd43eedd8adb36a5c8d8e6046c1283ba2ee680f30b027b58fd |
|
MD5 | f2a305bd607ac04ed6307d540b0dc460 |
|
BLAKE2b-256 | be8b6be6437834e3880892bda343ee71f726969349ffc35a918625a1f7020c84 |