GRASS logo

NAME

p.photrim - Trim a planetary raster by photometric angle thresholds.
Sets pixels to NULL where the incidence, emission, or phase angle exceeds the specified maximum (or falls below minimum). Angle backplanes are those produced by p.phocube.

KEYWORDS

Planetary, Photometric Analysis, photometry, mask

SYNOPSIS

p.photrim
p.photrim --help
p.photrim input=name output=name [incidence=name] [emission=name] [phase=name] [maxincidence=float] [maxemission=float] [maxphase=float] [minincidence=float] [minemission=float] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

--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
incidence=name
Incidence angle backplane [deg] (optional)
emission=name
Emission angle backplane [deg] (optional)
phase=name
Phase angle backplane [deg] (optional)
maxincidence=float
Maximum allowed incidence angle [deg]
Default: 85.0
maxemission=float
Maximum allowed emission angle [deg]
Default: 85.0
maxphase=float
Maximum allowed phase angle [deg]
Default: 120.0
minincidence=float
Minimum allowed incidence angle [deg]
Default: 0.0
minemission=float
Minimum allowed emission angle [deg]
Default: 0.0

Table of contents

DESCRIPTION

p.photrim masks out pixels where the photometric geometry is outside physically valid limits. Pixels where incidence angle ≥ 90° (beyond the terminator) or emission angle ≥ 90° (beyond the limb) are set to GRASS NULL. Additionally, pixels whose phase angle falls outside the user-specified range [min_phase, max_phase] are masked.

This step is typically applied after p.photomet to remove artefacts at terminator and limb areas where the photometric correction diverges.

NOTES

If incidence or emission backplane rasters are not provided, only the phase angle trimming is applied. All three geometry rasters (from p.phocube) should be used together for best results.

EXAMPLES

Trim terminator and limb pixels, restrict phase to 0–70°:

p.photrim input=ctx_phocorr \
    incidence=ctx_incidence emission=ctx_emission phase=ctx_phase \
    min_phase=0 max_phase=70 output=ctx_trimmed

ISIS3-equivalent workflow

ISIS3's photrim masks pixels by per-pixel illumination / emission / phase angles, identically to this module. To replicate

phocube  from=ctx.cub  to=ctx_cube.cub  incidence=true emission=true phase=true
photrim  from=ctx.cub  to=ctx_trim.cub  cubefile=ctx_cube.cub \
         minemission=0  maxemission=80 \
         minincidence=0 maxincidence=80 \
         minphase=0     maxphase=70

in GRASS, the equivalent chain is:

# 1. ISIS3 .cub -> GRASS raster
p.in.isis input=ctx.cub output=ctx
# 2. Backplanes (replaces ISIS3 phocube)
p.phocube -i -e -p input=ctx output=ctx
# 3. Trim by angles (replaces ISIS3 photrim)
p.photrim input=ctx \
    incidence=ctx_incidence emission=ctx_emission phase=ctx_phase \
    min_incidence=0 max_incidence=80 \
    min_emission=0  max_emission=80 \
    min_phase=0     max_phase=70 \
    output=ctx_trim
# 4. (optional) export the trimmed raster back to ISIS3 .cub
p.out.isis input=ctx_trim output=ctx_trim.cub

The output ctx_trim carries the same masking semantics as ISIS3's ctx_trim.cub: pixels outside the requested angular envelope become GRASS NULL (mapped to ISIS3 NULL on export).

REFERENCES

SEE ALSO

p.phocube, p.photomet

AUTHOR

Yann Chemin

SOURCE CODE

Available at: p.photrim source code (history)

Accessed: Sunday Nov 15 11:06:05 2026


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

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