table of contents
other versions
MINTPY-GENERATE_MASK(1) | User Commands | MINTPY-GENERATE_MASK(1) |
NAME¶
mintpy-generate_mask - Generate mask file from input file
DESCRIPTION¶
usage: generate_mask.py [-h] [-o OUTFILE] [--keep-nan] [--revert] [-m VMIN]
- [-M VMAX] [-p MINPIXELS] [--vx XMIN XMAX]
- [--vy YMIN YMAX] [--vroipoly] [--vstd] [--vstd-num VSTD_NUM] [-x XMIN XMAX] [-y YMIN YMAX] [--ex-circle X Y RADIUS] [--in-circle X Y RADIUS] [--base BASE_FILE] [--base-dset BASE_DATASET] [--base-value BASE_VALUE] [--roipoly] [--view-cmd VIEW_CMD] [--nonzero] [--update] file [dset]
Generate mask file from input file
positional arguments:¶
options:¶
- -h, --help
- show this help message and exit
- -o OUTFILE, --output OUTFILE
- output file name.
- --keep-nan
- Do not exclude pixels with NaN value
- --revert
- revert 0 and 1 value of output mask file
- -m VMIN, --min VMIN
- minimum value for selected pixels
- -M VMAX, --max VMAX
- maximum value for selected pixels
- -p MINPIXELS, --mp MINPIXELS, --minpixels MINPIXELS
- minimum cluster size in pixels, to remove small pixel clusters.
- --vstd
- mask according to the formula: |velocity| > a * velocityStd
- --vstd-num VSTD_NUM
- multiple of velocityStd (a) to use for cutoff
- --nonzero
- Select all non-zero pixels. i.e. maskConnComp.h5 from ifgramStack.h5
- --update
- Enable update checking for --nonzero option.
AOI for threshold:¶
- Define the AOI for thresholding operations.
- --vx XMIN XMAX
- AOI range in X for threshold operation (and keep the rest untouched.)
- --vy YMIN YMAX
- AOI range in Y for threshold operation (and keep the rest untouched.)
- --vroipoly
- AOI via interactive polygonal region of interest (ROI) selection.
AOI:¶
- define secondary area of interest
- -x XMIN XMAX, --sub-x XMIN XMAX
- selection range in x/cross-track/range direction
- -y YMIN YMAX, --sub-y YMIN YMAX
- selection range in y/along-track/azimuth direction
- --ex-circle X Y RADIUS
- exclude area defined by an circle (x, y, radius) in pixel number
- --in-circle X Y RADIUS
- include area defined by an circle (x, y, radius) in pixel number
- --base BASE_FILE
- exclude pixels == base_value output_mask[base_data == base_value] = 0
- --base-dset BASE_DATASET, --base-dataset BASE_DATASET
- dataset in base_file to be used, for file with multiple datasets. i.e.: --base inputs/geometryRadar.h5 --base-dset shadow --base-value 1
- --base-value BASE_VALUE
- value of pixels in base_file to be excluded. Default: 0
- --roipoly
- Interactive polygonal region of interest (ROI) selection.
- --view-cmd VIEW_CMD
- view.py command to facilitate the AOI selection.E.g. "-v -0.1 0.1"
example:¶
- generate_mask.py
- temporalCoherence.h5 -m 0.7 -o maskTempCoh.h5
- generate_mask.py
- temporalCoherence.h5 -m 0.7 -o maskTempCoh.h5 --base inputs/geometryRadar.h5 --base-dset shadow --base-value 1
- generate_mask.py
- avgSpatialCoh.h5 -m 0.7 --base waterMask.h5 -o maskSpatialCoh.h5
- # exclude area by min/max value and/or subset in row/col direction generate_mask.py 081018_090118.unw -m 3 -M 8 -y 100 700 -x 200 800 -o mask_1.h5
- # exclude pixel cluster based on minimum number of pixels generate_mask.py maskTempCoh.h5 -p 10 mask_1.h5
- # exclude pixels with large velocity STD: |velocity| > cutoff (2 by default) * velocityStd generate_mask.py velocity.h5 --vstd generate_mask.py velocity.h5 --vstd --vstd-num 3
- # exclude / include an circular area generate_mask.py maskTempCoh.h5 -m 0.5 --ex-circle 230 283 100 -o maskTempCoh_nonDef.h5 generate_mask.py maskTempCoh.h5 -m 0.5 --in-circle 230 283 100 -o maskTempCoh_Def.h5 # maskout an area within a circle AND with height smaller than a threshold generate_mask.py inputs/geometryGeo.h5 height --in-circle 339 370 21 -M 1400 --revert -o maskCrater.h5
- # use an specific dataset from multiple dataset file generate_mask.py geometryRadar.dem height -m 0.5 -o waterMask.h5 generate_mask.py ifgramStack.h5 unwrapPhase-20101120_20110220 -m 4
- # common mask file of pixels in all connected components / with non-zero unwrapped phase generate_mask.py ifgramStack.h5 --nonzero -o maskConnComp.h5 --update
- # interative polygon selection of region of interest # useful for custom mask generation in unwrap error correction with bridging generate_mask.py waterMask.h5 -m 0.5 --roipoly generate_mask.py azOff.h5 --roipoly --view-cmd "-v -0.1 0.1" generate_mask.py velocity.h5 --roipoly --view-cmd "--dem ./inputs/geometryGeo.h5 --contour-step 100 --contour-smooth 0.0"
May 2022 | mintpy-generate_mask v1.3.3 |