xarray输出驱动程序文件夹
mapchete-xarra的Python项目详细描述
此驱动程序使mapchete能够将多维数组写入tile目录结构。
用法
示例.mapchete文件:
process:process.pyzoom_levels:min:0max:12input:output:format:xarraypath:/some/output/pathdtype:uint16bands:3pyramid:grid:geodeticmetatiling:2
流程文件示例:
fromdateutilimportparserimportnumpyasnpimportxarrayasxrdefexecute(mp,stack_height=10):# create 4D arrays with current tile shape and dtypearrs=[np.ones((3,)+mp.tile.shape,dtype="uint16")for_inrange(1,stack_height)]# create timestamps for each arraytimestamps=[parser.parse("2018-04-0%s"%i)foriinrange(1,stack_height)]# build xarray with time axistimeseries=xr.DataArray(np.stack(arrs),coords={'time':timestamps},dims=('time','bands','x','y'))# return to writereturntimeseries
安装
# install using pip: pip install mapchete_xarray # verify driver is vailable ('xarray' should be listed as output format): mapchete formats
当前限制
- 不允许重新投影 当从现有输出读取时,进程的输出必须小于输出输出电压。
- 仅写入当前实现的netcdf文件