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()
intf.shape
(2500, 1834)
filtered_intf = n2f(intf,depths=(10,10),model='../../../noise2fringe_ps_cos/model_saved/noise2fringe_model_depth_4_0712_5/n2f.onnx')
CPU times: user 4min 11s, sys: 43.8 s, total: 4min 55s
Wall time: 4.63 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'])
)

source

n2fs3d

 n2fs3d (adi:numpy.ndarray, intf:numpy.ndarray, chunks:tuple=None,
         depths:tuple=(0, 0), model:str=None)
Type Default Details
adi ndarray amplitude dispersion index, 2d np.float32 or cp.float32
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()
adi = zarr.open('../CLI/ps/adi.zarr/','r')[:]
filtered_intf = n2fs3d(adi,intf,depths=(200,200),model='../../../noise2fringe_ps_cos_adi/model_saved/noise2fringe_model_depth_4_0721_8/n2fs3d.onnx')
CPU times: user 4min 12s, sys: 46.8 s, total: 4min 59s
Wall time: 4.22 s
if is_cuda_available():
    intf_cp = cp.asarray(intf)
    adi_cp = cp.asarray(adi)
    filtered_intf_cp = n2fs3d(adi_cp,intf_cp)
CPU times: user 3.69 s, sys: 625 ms, total: 4.31 s
Wall time: 4.11 s