Skip to content

Commit

Permalink
Working test config for DE Africa WOfS
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgleith authored and omad committed Jun 2, 2021
1 parent f4b1ea5 commit 7ab06b2
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 4 deletions.
42 changes: 42 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,48 @@ find_missing:
--queue alex-dev-alive \
--dryrun

# Africa Examples
product-africa:
docker-compose exec alchemist \
datacube product add \
https://raw.githubusercontent.com/digitalearthafrica/config/master/products/ls8_sr.odc-product.yaml \
https://raw.githubusercontent.com/digitalearthafrica/config/master/products/ls7_sr.odc-product.yaml \
https://raw.githubusercontent.com/digitalearthafrica/config/master/products/ls5_sr.odc-product.yaml

index-africa:
docker-compose exec --env AWS_DEFAULT_REGION=af-south-1 alchemist \
bash -c "\
s3-to-dc --stac --no-sign-request \
s3://deafrica-landsat/collection02/level-2/standard/oli-tirs/2017/160/071/LC08_L2SP_160071_20170830_20200903_02_T1/*SR_stac.json \
ls8_sr && \
s3-to-dc --stac --no-sign-request \
s3://deafrica-landsat/collection02/level-2/standard/etm/2021/170/052/LE07_L2SP_170052_20210316_20210412_02_T1/*_SR_stac.json \
ls7_sr && \
s3-to-dc --stac --no-sign-request \
s3://deafrica-landsat/collection02/level-2/standard/tm/1994/176/044/LT05_L2SP_176044_19940714_20210402_02_T1/*_SR_stac.json \
ls5_sr"

wo-africa-one:
docker-compose exec \
--env AWS_DEFAULT_REGION=af-south-1 \
--env AWS_S3_ENDPOINT=s3.af-south-1.amazonaws.com \
alchemist \
datacube-alchemist run-one --config-file ./examples/wofs_ls.alchemist.yaml \
--uuid 1f88087d-0da6-55be-aafb-5e370520e405

THREE_AFRICA=1f88087d-0da6-55be-aafb-5e370520e405 272c298f-03e3-5a08-a584-41a0a3c3cb95 834d56e2-7465-5980-a6af-615ef0f67e28

wo-africa-three:
docker-compose exec \
--env AWS_DEFAULT_REGION=af-south-1 \
--env AWS_S3_ENDPOINT=s3.af-south-1.amazonaws.com \
alchemist bash -c\
"echo '${THREE_AFRICA}' | \
xargs -n1 datacube-alchemist run-one --config-file ./examples/wofs_ls.alchemist.yaml --uuid \
"




# Queue testing
wofs-to-queue:
Expand Down
6 changes: 4 additions & 2 deletions datacube_alchemist/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,10 @@ def execute_task(
# Copy in metadata and properties
for k, v in task.settings.output.metadata.items():
setattr(dataset_assembler, k, v)
for k, v in task.settings.output.properties.items():
dataset_assembler.properties[k] = v

if task.settings.output.properties:
for k, v in task.settings.output.properties.items():
dataset_assembler.properties[k] = v

# Update the GSD
dataset_assembler.properties["eo:gsd"] = self._native_resolution(task)
Expand Down
1 change: 1 addition & 0 deletions examples/c3_config_fc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ output:
dataset_version: 2.5.0
collection_number: 3
naming_conventions: dea_c3

properties:
dea:dataset_maturity: interim

Expand Down
61 changes: 61 additions & 0 deletions examples/wofs_ls.alchemist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
specification:
products:
- ls8_sr
- ls7_sr
- ls5_sr
measurements:
["blue", "green", "red", "nir", "swir_1", "swir_2", "pixel_quality"]
measurement_renames:
blue: nbart_blue
green: nbart_green
red: nbart_red
nir: nbart_nir
swir_1: nbart_swir_1
swir_2: nbart_swir_2
pixel_quality: fmask
resampling:
fmask: nearest
"*": bilinear

aws_unsigned: True
transform: wofs.virtualproduct.WOfSClassifier
transform_url: "https://github.com/GeoscienceAustralia/wofs/"
override_product_family: ard # The relationship of the source dataset to the newly derived dataset

transform_args:
c2_scaling: True
dsm_path: "https://deafrica-input-datasets.s3.af-south-1.amazonaws.com/srtm_dem/srtm_africa.tif"

output:
location: /tmp/alchemist
nodata: 1
dtype: uint8
explorer_url: https://explorer.digitalearth.africa/products/wofs_ls/extents
preview_image_singleband:
measurement: water
lookup_table:
0: [150, 150, 110] # dry
1: [0, 0, 0] # nodata
16: [119, 104, 87] # terrain
32: [89, 88, 86] # cloud_shadow
64: [216, 215, 214] # cloud
80: [242, 220, 180] # cloudy terrain
128: [79, 129, 189] # water
160: [51, 82, 119] # shady water
192: [186, 211, 242] # cloudy water
write_data_settings:
overview_resampling: nearest
reference_source_dataset: True
write_stac: True
inherit_geometry: True

metadata:
product_family: wofs
producer: digitalearthafrica.org
dataset_version: 0.0.2
naming_conventions: deafrica

processing:
dask_chunks:
x: 4096
y: 4096
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ odc-apps-cloud
odc-apps-dc-tools
odc-aws
odc-index
wofs==1.6.1
wofs==1.6.2
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
include_package_data=True,
install_requires=[
"datacube",
"eodatasets3>=0.19.2",
"eodatasets3>=0.20.1",
"attrs>=18.1",
"cattrs==1.0.0",
"structlog",
Expand Down

0 comments on commit 7ab06b2

Please sign in to comment.