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
mapchete_xarray-2022.5.0.tar.gz
(11.1 kB
view details)
Built Distribution
File details
Details for the file mapchete_xarray-2022.5.0.tar.gz
.
File metadata
- Download URL: mapchete_xarray-2022.5.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fc7ea09939d096d66dfe582c01775fc5c50c80a95277e5699bfc07cee37d210 |
|
MD5 | 14337527216e431658c8bb8eb1e402da |
|
BLAKE2b-256 | 8ce0db47ef87090cfcd7e6f14ae00fa50058e2f13005665d314cf06c14533f40 |
File details
Details for the file mapchete_xarray-2022.5.0-py3-none-any.whl
.
File metadata
- Download URL: mapchete_xarray-2022.5.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbace49051c7182aef1c2e4cf23a44d317f5766fd31139153ac08bea3ea7894c |
|
MD5 | 71910efb14e89591d60e4bf9cc808231 |
|
BLAKE2b-256 | 20a000bc6e307213bc24c29798d1cefe1c0401b1b00f154dc2be3769162babed |