dl

Deep learning based operators

source

n2f

 n2f (intf:numpy.ndarray, chunks:tuple=None, depths:tuple=(0, 0),
      model:str=None)
Type Default Details
intf ndarray interferogram, 2d np.complex64 or cp.complex64
chunks tuple None chunksize, intf.shape by default
depths tuple (0, 0) width of the boundary
model str None path to the model in onnx format, use the model comes with this package by default

Usage:

import zarr
import numpy as np
import holoviews as hv
hv.extension('bokeh')
hv.output(widget_location='bottom')
from bokeh.models import WheelZoomTool
from holoviews import opts
rslc_zarr = zarr.open('../CLI/raw/rslc.zarr/','r')
intf = rslc_zarr[:,:,7]*rslc_zarr[:,:,13].conj()
filtered_intf = n2f(intf,depths=(10,10))
CPU times: user 4min 1s, sys: 41 s, total: 4min 42s
Wall time: 4.4 s
raw_intf_plot = mr.ras_plot(np.angle(intf))
filtered_intf_plot = mr.ras_plot(np.angle(filtered_intf))
(raw_intf_plot+filtered_intf_plot).opts(
    opts.Image(
        cmap='colorwheel',width=600, height=600, colorbar=True,invert_yaxis=True,
        default_tools=['pan',WheelZoomTool(zoom_on_axis=False),'save','reset','hover'],
        active_tools=['wheel_zoom'])
)
if is_cuda_available():
    intf_cp = cp.asarray(intf)
if is_cuda_available():
    filtered_intf_cp = n2f(intf_cp)
CPU times: user 4.52 s, sys: 1.59 s, total: 6.12 s
Wall time: 6.02 s
if is_cuda_available():
    filtered_intf_ = _n2f_np_in_gpu(intf)
    raw_intf_plot = mr.ras_plot(np.angle(intf))
    filtered_intf_plot = mr.ras_plot(np.angle(filtered_intf_))
(raw_intf_plot+filtered_intf_plot).opts(
        opts.Image(
            cmap='colorwheel',width=600, height=600, colorbar=True,invert_yaxis=True,
            default_tools=['pan',WheelZoomTool(zoom_on_axis=False),'save','reset','hover'],
            active_tools=['wheel_zoom'])
)