opendatacube eo3数据集的打包、元数据和出处
eodatasets3的Python项目详细描述
地球观测数据集
一个易于编写、验证和转换ODC的工具 数据集和元数据。
安装
pip install eodatasets3
支持Python3.6+。
元数据创建API
todo:编写概述。
参见tests/integration/test_assemble.py
中的示例验证器
eo3-validate
检查ODC元数据的类似于lint的检查器。
$ eo3-validate --help
Usage: eo3-validate [OPTIONS] [PATHS]...
Validate ODC dataset documents
Paths can be both product and dataset documents, but each product must
come before its datasets to be matched against it.
Options:
-W, --warnings-as-errors Fail if any warnings are produced
--thorough Attempt to read the data/measurements, and check
their properties match the product
-q, --quiet Only print problems, one per line
--help Show this message and exit.
转换为STAC元数据
eo3-to-stac
:将odc元数据转换为stac项json文件(beta/不完整)
$ eo3-to-stac --help
Usage: eo3-to-stac [OPTIONS] [ODC_METADATA_FILES]...
Convert a new-style ODC metadata doc to a Stac Item.
Options:
--help Show this message and exit.
开发
使用pytest运行测试。
pytest
所有代码都使用black格式化,并选中 用pyflakes。
在安装测试依赖项时,它们包括在内:
pip install -e .[test]
您可能需要将编辑器配置为在文件保存时自动运行黑色 (有关说明,请参见黑页),或在git中安装预提交挂钩:
预提交设置
提供一个pre-commit配置来自动格式化 并检查代码更改。这使您可以立即捕获并修复 在引发失败的拉取请求(在 特拉维斯)。
如果不使用conda,请从pip安装预提交:
pip install pre-commit
如果使用conda,请从conda forge安装(required,因为pip 版本使用与conda环境不兼容的virtualenvs)
conda install pre_commit
现在将预提交挂钩安装到当前存储库:
pre-commit install
现在,您的代码将在每次提交之前进行格式化和验证。你也可以
通过运行pre-commit run
DEA准备
包括编写现有DEA产品的脚本。
eo3-prepare
:从命令行准备odc元数据。
一些准备程序需要辅助依赖项:pip install .[ancillary]
$ eo3-prepare --help
Usage: eo3-prepare [OPTIONS] COMMAND [ARGS]...
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
landsat-l1 Prepare eo3 metadata for USGS Landsat Level 1 data.
modis-mcd43a1 Prepare MODIS MCD43A1 tiles for indexing into a Data...
noaa-prwtr Prepare NCEP/NCAR reanalysis 1 water pressure datasets...
s2-awspds Preparation code for Sentinel-2 L1C AWS PDS Generates...
s2-cophub Preparation code for Sentinel-2 L1C SCIHUB ZIP Generates...
eo3-package-wagl
:转换并打包wagl hdf5输出。
需要wagl依赖项组:pip install .[wagl]
$ eo3-package-wagl --help
Usage: eo3-package-wagl [OPTIONS] H5_FILE
Package WAGL HDF5 Outputs
This will convert the HDF5 file (and sibling fmask/gqa files) into
GeoTIFFS (COGs) with datacube metadata using the DEA naming conventions
for files.
Options:
--level1 FILE Optional path to the input level1 metadata
doc (otherwise it will be loaded from the
level1 path in the HDF5)
--output DIRECTORY Put the output package into this directory
[required]
-p, --product [nbar|nbart|lambertian|sbt]
Package only the given products (can specify
multiple times)
--with-oa / --no-oa Include observation attributes (default:
true)
--help Show this message and exit.