We have created a TileDB-SAR library to perform coherence change detection in a temporal collection of registered SAR images. Our library uses Dask to perform the change detection operation in parallel on a collection of array data. The library also provides a set of command line tools to perform the operations of stacking and processing the input SAR data.
The TileDB-SAR library has been designed to support products from different vendors. Currently, the library supports SLC products from the UAVSAR mission.
In the above command, stack_arr is the input stack above and result is the output array .
The result array contains values between zero and one and indicate the likelihood of their being a change between the two collected SAR scenes. A result value of 1 indicates no change between the two images. This algorithm is most easily demonstrated by creating a complex test image and adding a known shift to the original complex image data:
The code to generate these images is as follows:
import mathimport dask.array as daimport matplotlib.pyplot as pltimport numpy as npfrom insar import uavsarfrom insar.sar import local_ccdmu, sigma =0.5,0.24defadd_change(x):# use zero for thermal noise in this synthetic dataset r = np.random.rand()# weight shift to determine alphareturn x * r + math.sqrt(1- r**2)* xnp.random.seed(0)s = np.random.normal(mu, sigma, 10000)data = s.reshape((100, 100))arr1 = data +1.j*dataarr2 = np.copy(arr1)# treat additive thermal noise as zero in this dataset# alpha is the change metric we wish to estimate in the interval [0, 1]# 0 indicates complete change, 1 no changevfunc = np.vectorize(add_change)for c inrange(0, 100):if c inrange(48, 52): arr2[:, c]=vfunc(arr2[:, c]) arr2[c,:]=vfunc(arr2[c, :])da1 = da.from_array(arr1).rechunk((window, window))da2 = da.from_array(arr2).rechunk((window, window))change_result = da.map_blocks(local_ccd, da1, da2).compute()
Flight path
It is useful to plot the flight path of a SAR data collection to debug missing output values when necessary.
rioflight-path--helpUsage:rioflight-path [OPTIONS] INPUT_ [INTERVAL]CreateGeoJSONflightpath.Options:-t,--type [uavsar] SAR sensor type. [default: 0]--helpShowthismessageandexit.