GRASS logo

NAME

p.dem.prep - Prepare a planetary DEM for photometric and terrain analysis.
Processes a planetary elevation or radius map: optionally fills NULL voids using the reference ellipsoid radius, converts absolute radius-from-centre to topographic height above the ellipsoid, and clips extreme outliers.

KEYWORDS

Planetary, Terrain Analysis, DEM, terrain

SYNOPSIS

p.dem.prep
p.dem.prep --help
p.dem.prep [-hf] input=name output=name [a_radius=float] [c_radius=float] [fill_value=string] [minval=float] [maxval=float] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-h
Convert radius-from-centre to height above ellipsoid
-f
Fill NULL voids before other processing
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

input=name [required]
Name of input raster map
output=name [required]
Name for output raster map
a_radius=float
Ellipsoid equatorial radius [km]
Default: 3396.19
c_radius=float
Ellipsoid polar radius [km]
Default: 3376.20
fill_value=string
Value to fill NULL voids with
Options: ellipsoid, mean, null
Default: ellipsoid
minval=float
Clip values below this to NULL (km)
maxval=float
Clip values above this to NULL (km)

Table of contents

DESCRIPTION

p.dem.prep prepares a planetary Digital Elevation Model (DEM) for use in photogrammetry and shape-from-shading workflows. It applies a sequence of optional preprocessing steps:

  1. NULL filling — fills data gaps by cubic-spline interpolation
  2. Spike removal — replaces outlier values exceeding the local median by N×σ with the local median
  3. Sphere normalisation — subtracts the best-fit sphere radius to produce a height-above-reference map
  4. Smoothing — applies a Gaussian low-pass filter to reduce high-frequency noise

The output DEM is suitable as input to p.slope.planet, p.shadow.planet, and as shape-model data for p.photomet via the p_shapemodel DEM callback.

NOTES

The target body reference radius can be provided directly or looked up from SPICE PCK kernels when kernels are attached.

EXAMPLES

Prepare a MOLA gridded DEM for photoclinometry:

p.dem.prep input=mola_128ppd output=mola_prep \
    radius=3396190.0 smooth_sigma=1.5

REFERENCES

SEE ALSO

p.slope.planet, p.shadow.planet, r.fill.dir, r.neighbors

AUTHOR

Yann Chemin

SOURCE CODE

Available at: p.dem.prep source code (history)

Accessed: Sunday Nov 15 11:05:58 2026


Main index | Paint index | Topics index | Keywords index | Graphical index | Full index

© 2003-2026 GRASS Development Team, GRASS 8.5.1dev Reference Manual