coregister#

geowombat.coregister(target, reference, band_names_reference=None, band_names_target=None, wkt_version=None, **kwargs)#

Co-registers an image, or images, using AROSICS.

While the required inputs are DataArrays, the intermediate results are stored as NumPy arrays. Therefore, memory usage is constrained to the size of the input data. Dask is not used for any of the computation in this function.

Parameters:
  • target (DataArray or str) – The target xarray.DataArray or file name to co-register to reference.

  • reference (DataArray or str) – The reference xarray.DataArray or file name used to co-register target.

  • band_names_reference (Optional[list | tuple]) – Band names to open for the reference data.

  • band_names_target (Optional[list | tuple]) – Band names to open for the target data.

  • wkt_version (Optional[str]) – The WKT version to use with to_wkt().

  • kwargs (Optional[dict]) – Keyword arguments passed to arosics.

Return type:

DataArray

Reference:

https://pypi.org/project/arosics

Return type:

DataArray

Returns:

xarray.DataArray

Parameters:
  • target (str | Path | DataArray) –

  • reference (str | Path | DataArray) –

  • band_names_reference (Sequence[str] | None) –

  • band_names_target (Sequence[str] | None) –

  • wkt_version (str | None) –

Example

>>> import geowombat as gw
>>>
>>> # Co-register a single image to a reference image
>>> with gw.open('target.tif') as tar, gw.open('reference.tif') as ref:
>>>     results = gw.coregister(
>>>         tar, ref, q=True, ws=(512, 512), max_shift=3, CPUs=4
>>>     )
>>>
>>> # or
>>>
>>> results = gw.coregister(
>>>     'target.tif',
>>>     'reference.tif',
>>>     q=True,
>>>     ws=(512, 512),
>>>     max_shift=3,
>>>     CPUs=4
>>> )