.. _sparse_disp: sparse_disp ----------- The ``sparse_disp`` program creates a low-resolution initial disparity (``D_sub.tif``, :numref:`out_corr_files`) from the full-resolution stereo images, computed at a sparse set of pixels for speed. This is meant for difficult terrain, such as snow or ice, where the subsampled images used by the default seed approach appear blank (:numref:`d_sub_corr`). This program is invoked automatically by :ref:`parallel_stereo` with the option ``--corr-seed-mode 3``, and is customized with the ``parallel_stereo`` option ``--sparse-disp-options``. An example is in :numref:`sparse_disp_example`. ``sparse_disp`` is written in Python and uses the ``numpy``, ``scipy``, and ``gdal`` modules. Installation ~~~~~~~~~~~~ As of the 2026/06 build (:numref:`release`), the needed Python modules ship with ASP, so no separate installation or environment setup are required. For older builds, the ``numpy``, ``scipy``, and ``gdal`` Python modules must be available. It is important to use the same version of ``python``, ``numpy``, and ``gdal`` as in ASP. Make adjustments below and then run:: conda create -n sparse_disp -c conda-forge \ python=3.12.2 numpy=1.26.4 gdal=3.8.1 scipy ASP is told where to find these modules via:: export ASP_PYTHON_MODULES_PATH=$HOME/miniconda3/envs/sparse_disp/lib/python3.x/site-packages Adjust the ``conda`` installation location and ``python`` version as needed. If ASP is installed with ``conda`` (:numref:`conda_intro`), and the ISIS version is at least 9.0.0, the ASP environment already has all the needed modules. Then ``ASP_PYTHON_MODULES_PATH`` can point to the ``site-packages`` directory of the ASP conda environment. Command-line options ~~~~~~~~~~~~~~~~~~~~ -x, --xsearch Initial x search range, in pixels. -y, --ysearch Initial y search range, in pixels. -t, --template Template size, in pixels. -c, --coarse Initial search-point spacing, in pixels. -f, --fine Final search-point spacing, in pixels. -r, --refine_tol Pixel range tolerance for refinement. -d, --output_dec_scale If set, also output a second copy of the offsets scaled by this amount. -p, --output_pad Pad the output search range by this amount. -s, --sigma_t_min Matches are not computed if the standard deviation of the template is below this value. -R, --R_lim_min Lower bound on the minimum-neighbor-disparity parameter, used to reject points whose neighbors have too large a disparity range. -l, --R_limax_disp_range Upper bound on the minimum-neighbor-disparity parameter. -m, --mask_file A GeoTIFF mask to reject template points that should not be searched (1 = search, 0 = skip). -M, --Max_disp_range Limit the unscaled output disparity range to this value. -P, --processes The number of processes to use. --no_epipolar_fltr Disable filtering of disparities by distance from the epipolar vector. -e, --epipolar_axis The axis that is epipolar (0 = x, 1 = y). -n, --nodata-value The no-data value. Pixels at or below this value are not used. -w, --fill-dist Fill gaps of this size or larger with smoothed values. -D, --Debug Output debugging information and a text file of correlation-estimate points.