import zarr
from matplotlib import pyplot as plt
import colorcet
from moraine.utils_ import is_cuda_available
calamp
SLC amplitude calibration
rslc2amp
rslc2amp (rslc:numpy.ndarray)
calculation the amplitude from SLC/SLC stack
Type | Details | |
---|---|---|
rslc | ndarray | rslc, 2D/3D numpy array or cupy array |
Returns | ndarray | amplitude, 2D/3D numpy array or cupy array |
Usage:
= zarr.open('../CLI/raw/rslc.zarr/','r')[:,:,1]
rslc = rslc2amp(rslc)
amp = np.abs(rslc)
amp_ =4)
np.testing.assert_array_almost_equal(amp,amp_,decimalif is_cuda_available():
= rslc2amp(cp.asarray(rslc))
amp_gpu =4) np.testing.assert_array_almost_equal(amp,amp_gpu.get(),decimal
calamp
calamp (amp:numpy.ndarray)
calculation the calibrated amplitude from amplitude of one single SLC
Type | Details | |
---|---|---|
amp | ndarray | amplitude, 2D numpy array or cupy array |
Returns | ndarray | calibrated amplitude, 2D numpy array or cupy array |
= zarr.open('../CLI/raw/rslc.zarr/','r')[:,:,0]
rslc = np.abs(rslc)
amp = calamp(amp)
amp_caled if is_cuda_available():
= cp.asarray(amp)
amp_gpu = calamp(amp_gpu)
amp_caled_gpu =3)
np.testing.assert_array_almost_equal(amp_caled,amp_caled_gpu.get(),decimal# np.testing.assert_array_almost_equal(amp/np.nanmean(amp),amp_caled_gpu.get())
= plt.subplots(1,1,figsize=(10,10))
fig, ax = ax.imshow(np.log(amp_caled))
pcm set(title='Calibrated Amplitude in log scale',xlabel='Range Index',ylabel='Azimuth Index')
ax.
fig.colorbar(pcm) fig.show()