Skip to content

19 - Sensor overview

A sensor describes from where, in what way and in which bands the scene is observed. This chapter covers what all sensors have in common: projections, bands, sampling and results. The following chapters introduce the optical, radiation-measurement, LiDAR, thermal, fluorescence and microwave sensors.

What an imaging sensor consists of

An imaging sensor combines a projection and a set of bands:

import less

sensor = less.OpticalImager(
    less.Orthographic(image_size=128),   # projection
    bands=[650, 550, 450],               # bands (nm)
    quality=32,                          # samples per pixel
)

The same projections are used for optical, thermal and fluorescence imaging.

Projections

Orthographic

All viewing rays are parallel and the pixel grid is fixed on a horizontal reference plane above the ground. The result is a map-like image with north up and east to the right:

nadir = less.Orthographic(image_size=256)                     # 256 × 256 pixels
fine = less.Orthographic(resolution=0.1)                      # 0.1 m per pixel
subset = less.Orthographic(image_size=128, extent=20, center=(25, 25))
oblique = less.Orthographic(image_size=128, view_zenith=30, view_azimuth=120)
Parameter Meaning
image_size Number of pixels, an integer or (width, height)
resolution Ground resolution (m), instead of image_size
extent Imaged area (m), the whole scene by default
center Image centre (east, south), the scene centre by default
view_zenith, view_azimuth Viewing zenith and azimuth for oblique views
terrain_following On uneven terrain, each pixel corresponds to the ground below it

For oblique views the horizontal plane holding the pixel grid is set by scene.measurement_plane: by default ("auto") it is the top of the scene, which suits canopy reflectance; with 0 it is the ground, and objects are displaced in the image along the viewing direction according to their height:

scene = less.Scene()
scene.measurement_plane = 0.0

Orthographic projection

Perspective

A normal camera, where nearer objects look larger:

camera = less.Perspective(resolution=512, fov=35,
                          position=(25, 60, 20),   # camera position
                          target=(25, 25, 5))      # point the camera looks at

fov is the field of view in degrees.

Fisheye

Hemispherical views, often used to simulate hemispherical canopy photographs:

hemispherical = less.Fisheye(resolution=512, position=(25, 25, 0.5), orientation="up", fov=180)

orientation="up" looks at the sky and "down" at the ground; projection can be "equisolid" (equal solid angle, default), "equidistant", "orthographic" or "stereographic".

Pushbroom

Satellite or airborne pushbroom imaging, see chapter 21.

Sampling method

For everyday simulations, keep the default sampling settings and choose the sample count:

sensor = less.OpticalImager(
    less.Orthographic(image_size=128), bands=[550, 850], quality=256)
image = scene.simulate(sensor)

Optical, thermal, fluorescence and passive microwave images, together with optical photon emission, use Sobol low-discrepancy sampling by default. quality sets the samples per pixel, and num_photons sets the total photon count. For Sobol, use powers of two such as 256, 1024 or 4096.

Set a random seed

Set a scene seed when repeating a comparison:

scene.sampler = less.Sampler(seed=17)
image = scene.simulate(sensor)

This keeps method="auto", which chooses the sampling method for the task:

Simulation task Default method
Optical, thermal, fluorescence and passive microwave imaging Sobol
Optical BRF, irradiance maps and forward radiation fields Sobol
Leaf radiation fields, longwave, leaf temperature, photosynthesis, active microwave and four-component images Independent random sampling
LiDAR Weighted beam integration, controlled by the scanner

seed=None uses the sensor or process seed. An explicit scene seed is used for repeated simulations of that scene. To assess sampling stability, try several seeds and increase the sample count.

Choose a sampling method

Choose a method for subsequent scene simulations and process calculations:

scene.sampler = less.Sampler("sobol", seed=17)
image = scene.simulate(sensor)
method Description
"auto" Choose the defaults in the table above
"independent" Independent random sampling, useful as a baseline
"stratified" Divide the sampling region into strata and sample randomly within each
"sobol" Sobol low-discrepancy sampling for more evenly distributed samples
"ldsampler" Mitsuba-style low-discrepancy sampling for positions, directions and subsequent paths

After changing the sampler, simulate again using the existing scene geometry. scene.solve() also follows the scene's sampling settings. Set scene.sampler = None to restore the defaults. Select "independent" when calculating optical standard_error.

Inspect the sampling settings

Check the selected method and seed before simulating:

settings = scene.sampling_info(sensor)
print(settings["method"], settings["seed"])

The same information is saved with the result:

print(image.metadata["sampler"])

scene.sampling_info() also accepts process objects, such as less.EnergyBalanceProcess(...). The sampler is saved and loaded with the scene.

Microwave angular integration

Angular integration for microwave scattering tables follows the current method. Use preparation_method to choose it separately:

scene.sampler = less.Sampler(
    "sobol", seed=17, preparation_method="independent")

This uses Sobol for the image and independent random sampling for the scattering-table angular integral. preparation_method also accepts "stratified", "sobol" and "ldsampler". Set it to None to follow the current method. scene.sampling_info(sensor) shows both choices.

Sampling within pixels

You can also set the sampling method and seed on a projection:

projection = less.Orthographic(
    image_size=128, pixel_sampling="sobol", sampling_seed=17)
sensor = less.OpticalImager(projection, bands=[550, 850], quality=256)

pixel_sampling accepts "independent", "stratified", "sobol" and "ldsampler"; it also selects the sampling method for subsequent paths. None chooses the task default. An explicit scene method takes priority over the projection; "auto" follows an explicit projection choice. An explicit scene seed takes priority over the projection seed. Passive microwave images use the sensor seed when projection sampling is not set separately.

Bands

rgb = [650, 550, 450]                          # list of band centres (nm)
sentinel = less.Sentinel2A()                   # Sentinel-2A spectral response functions
landsat = less.Landsat8_OLI()                  # Landsat 8 OLI
hyperspectral = less.Hyperspectral(start=400, stop=1000, step=10)

With a list of band centres, each band is computed at a single wavelength. With a satellite instrument, LESS samples each band across its spectral response and weights the samples; spectral_resolution is the sampling interval (nm):

s2 = less.OpticalImager(less.Orthographic(image_size=64), bands=less.Sentinel2A(),
                        spectral_resolution=5, quality=16)

Bands in the result keep the order in which they were given.

Sampling

quality is the number of samples per pixel. Monte Carlo results contain random noise, roughly inversely proportional to the square root of the number of samples: four times as many samples halves the noise. Check a scene with small values, increase them for final results, and compare results at different sample counts to make sure they are stable.

quality Use
16–64 Previews
128–256 General analysis
512 and above Quantitative work

Non-imaging sensors have their own sampling parameters, such as num_photons for multi-angle reflectance.

Sensors at a glance

Sensor Result Chapter
OpticalImager Optical images 20, 21
BRFSensor Multi-angle reflectance 22
IrradianceMapSensor Upwelling and downwelling irradiance maps 24
IrradianceRadiometer Point irradiance 25
LiDARSurvey Point clouds, waveforms 26
ThermalImager Thermal images 27
SIFImager Fluorescence images 28
RadarScatterometer Backscattering coefficients 30
MicrowaveRadiometer Brightness temperatures 31

Results

scene.size = 50.0
scene.terrain = less.Terrain(property=less.Lambertian(reflectance=0.2))
scene.illumination = less.Illumination(
    source=less.Sun(zenith=30, azimuth=150), atmosphere=less.NoAtmosphere())

image = scene.simulate(sensor)
print(image.data.shape)          # (rows, columns, bands)
image.save("image.png")          # for viewing
image.save("image.tif")          # keeps the values
image.show()                     # display with matplotlib

Image values are spectral radiance (W m⁻² sr⁻¹ nm⁻¹); image.to_brf() converts them to reflectance factor.

Next