跳转至

co: Covariance and coherence matrix estimation (CLI)

moraine.cli.co 的命令(源码);同样的函数在 Python 里以 mc.<name>(...) 调用(import moraine.cli as mc)。下面的帮助由 docstring 生成,与 moraine COMMAND --help 相同(docstring 为英文)。

命令 摘要
emperical-co-pc estimate emperical coherence matrix on point cloud data.

emperical-co-pc

estimate emperical coherence matrix on point cloud data.

moraine emperical-co-pc --rslc STR --is_shp_dir STR --gix STR --coh_dir STR [--n_looks_dir STR] [--image_pairs FILE] [--chunks INT INT] [--cuda | --no-cuda] [--processes VALUE] [--n_workers VALUE] [--threads_per_worker VALUE]
参数 类型 默认值 说明
--rslc str 必需 input rslc stack, shape (nlines, width, nimages)
--is_shp_dir str 必需 input directory with the SHP bool arrays of the points, one zarr per raster chunk, made by ras2pc_ras_chunk
--gix str 必需 input grid index of the point cloud (azimuth, range), shape (n_points, 2), int
--coh_dir str 必需 output directory with the complex coherence of the image pairs of the points, shape (n_points, n_image_pairs), one zarr per raster chunk; merge with pc_concat and the key of ras2pc_ras_chunk
--n_looks_dir str None output directory with the effective number of independent looks of the SHP set of each point, float32, shape (n_points,), one zarr per raster chunk (merge as coh_dir): the number of independent looks with the same variance of the coherence estimate as the correlated SHPs, from their positions and the speckle correlation of rslc; input n_looks of ds-temp-coh
--image_pairs np.ndarray None input image pairs (element in the coherence matrix) to be calculated, all image pairs by default
--chunks tuple[int, int] None parallel processing (azimuth, range) chunk size. Default: rslc.chunks[:2]
--cuda bool False if use cuda for processing, false by default
--processes None use processes (True) or threads (False) for the workers, only for cpu processing. Default: False
--n_workers None number of workers. Default: 1 for cpu, one per GPU for cuda
--threads_per_worker None tasks a worker runs at the same time. Default: 2

全局选项:--json、--traceback、--log FILE、-q / --quiet(约定)。

在 pipeline 文件中(示例 pipeline 未使用此命令;只列必需参数):

[[step]]
name = "emperical_co_pc"
run = "emperical-co-pc"
rslc = "..."
is_shp_dir = "..."
gix = "..."
coh_dir = "..."

在 Python 中:

import moraine.cli as mc
mc.emperical_co_pc(rslc, is_shp_dir, gix, coh_dir, n_looks_dir=None, image_pairs=None, chunks=None, cuda=False, processes=None, n_workers=None, threads_per_worker=None)

数组函数 mr.emperical_co_pc 对内存中的 numpy / cupy 数组做同样的事。