register_relative

register_relative#

Register a relative DEM or orthoimage to a reference DEM and/or orthorectified image.

usage: register_relative [-h] [-ref FN_REF] [-ort FN_ORTHO]
                         [-glacmask GLACMASK] [-landmask LANDMASK]
                         [-footprints FOOTPRINTS] [-globstr GLOBSTR]
                         [-im_subset IM_SUBSET [IM_SUBSET ...]] [-b BLOCK_NUM]
                         [--subscript SUBSCRIPT] [-ori ORI]
                         [-imgsource IMGSOURCE] [-strategy STRATEGY]
                         [--dir_homol DIR_HOMOL] [-density DENSITY]
                         [-no_allfree] [-useortho] [-max_iter MAX_ITER]
                         [-use_cps] [-cp_frac CP_FRAC] [-o] [-fn_gcps FN_GCPS]
                         [-blur] [-no_hp] [-hs]
                         [--hillshade_kwargs HILLSHADE_KWARGS]
                         dirmec fn_dem

Positional Arguments#

dirmec

the name of the MEC directory to read the relative DEM from (e.g., MEC-Relative)

fn_dem

path to reference DEM

Named Arguments#

-ref, --fn_ref

path to reference orthorectified image (optional)

-ort, --fn_ortho

path to relative orthoimage (optional)

-glacmask

path to shapefile of glacier outlines (i.e., an exclusion mask)

-landmask

path to shapefile of land outlines (i.e., an inclusion mask)

-footprints

path to shapefile of image outlines. If not set, will look for Footprints.gpkg in the current directory. If this file does not exist, will attempt to download from USGS using imgsource.

-globstr

the search string to use to find images in the current directory (OIS*.tif)

Default: 'OIS*.tif'

-im_subset

subset of raw images to work with (default: all)

-b, --block_num

block number to use if processing multiple image blocks.

--subscript

optional subscript to use for output filenames.

-ori

name of orientation directory (after Ori-) (default: Relative).

Default: 'Relative'

-imgsource

USGS dataset name for images (default: DECLASSII).

Default: 'DECLASSII'

-strategy

strategy for generating GCPs. Must be one of: grid, random, chebyshev, or peaks. Note that if ‘random’ is used, density is the approximate number of points, rather than the distance between grid points. If ‘peaks’ is used, peaks will bespaced by at least (density / 2) pixels. (default: grid).

Default: 'grid'

--dir_homol

the name of the Homol directory to use for Campari

Default: 'Homol'

-density

pixel spacing to look for GCPs (default: 200)

Default: 200

-no_allfree

run Campari with AllFree set to False

Default: False

-useortho

use the orthomosaic in Ortho-{dirmec} rather than the DEM. If fn_ortho is set, uses that file instead (default: False).

Default: False

-max_iter

the maximum number of Campari iterations to run (default: 5)

Default: 5

-use_cps

split the GCPs into GCPs and checkpoints (CPs), to quantify the uncertainty of the camera model (default: False).

Default: False

-cp_frac

the fraction of GCPs to use as CPs when splitting into GCPs and CPs (default: 0.2)

Default: 0.2

-o, --use_orb

use skimage.feature.ORB to identify GCP locations in the reference image (default: use points generated by strategy)

Default: False

-fn_gcps

(optional) shapefile or CSV of GCP coordinates to use. Column names should be [(name | id), (z | elevation), x, y]. If CSV is used, x,y should have the same CRS as the reference image.

-blur, --use_blur

use a gaussian blur on the relative image before matching.

Default: False

-no_hp, --no_highpass

match templates using a highpass filter.

Default: False

-hs, --use_hillshade

match templates using DEM hillshade rather than elevation.

Default: False

--hillshade_kwargs

kwargs to pass to xdem.DEM.hillshade(), formatted as a dictionary.

Default: '{}'