How to use the eodatasets3.assemble.DatasetAssembler function in eodatasets3

To help you get started, we’ve selected a few eodatasets3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GeoscienceAustralia / digitalearthau / digitalearthau / vpmapper / worker.py View on Github external
log.info('loaded and transformed')

    dtypes = set(str(v.dtype) for v in output_data.data_vars.values())
    if 'int8' in dtypes:
        log.info('Found dtype=int8 in output data, converting to uint8 for geotiffs')
        output_data = output_data.astype('uint8', copy=False)

    if 'crs' not in output_data.attrs:
        output_data.attrs['crs'] = crs
    source_doc = _convert_old_odc_dataset_to_new(task.dataset)

    # Ensure output path exists
    output_location = Path(task.settings.output.location)
    output_location.mkdir(parents=True, exist_ok=True)

    with DatasetAssembler(output_location, naming_conventions="dea") as p:
        p.add_source_dataset(source_doc, auto_inherit_properties=True)

        # Copy in metadata and properties
        for k, v in task.settings.output.metadata.items():
            setattr(p, k, v)
        for k, v in task.settings.output.properties.items():
            p.properties[k] = v

        p.processed = datetime.utcnow()

        p.note_software_version(
            'd2dtransformer',
            "https://github.com/GeoscienceAustralia/digitalearthau",
            "0.1.0"
        )

eodatasets3

Packaging, metadata and provenance for OpenDataCube EO3 datasets

Apache-2.0
Latest version published 10 days ago

Package Health Score

75 / 100
Full package analysis