Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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"
)