API Reference
This page lists the public Python API for LESS 3.0.5. User code starts with import less; every name below is available from the top-level less namespace. Tutorials explain complete workflows, while this page provides a searchable inventory of interfaces, result types, and related chapters.
Compute availability depends on the installed platform and native backends. Use less.can_use() or scene.can_use() before submitting a workflow. If an implementation is unavailable, LESS raises an explicit error and does not silently substitute an approximation.
Scenes, objects, and geometry
| API |
Purpose |
less.Scene |
Persistent scene that owns geometry, illumination, backend selection, and simulation lifecycle. |
less.InstanceHandle |
Updates position, rotation, and scale of placed instances. |
less.Object |
Scene object containing one or more geometry components. |
less.Terrain |
Flat, DEM, or mesh terrain. |
less.Geometry |
Base class for geometry components. |
less.Mesh |
Explicit triangle mesh. |
less.TurbidBoundary |
Closed boundary for statistical vegetation media. |
less.TurbidSampling |
Quality, budget, and seed configuration for resident Turbid leaf samples. |
less.BoundaryValidationReport |
Turbid boundary validation result. |
less.TurbidBoundaryError |
Raised for an invalid Turbid boundary. |
Scene lifecycle and common operations
Scene.simulate(sensor_or_process, **kwargs)
Scene.build()
Scene.rebuild()
Scene.update_instances()
scene = less.Scene(backend="auto", device=0)
product = scene.simulate(sensor_or_process)
scene.build() # Optional preparation; reuses unchanged state
scene.rebuild() # Force geometry reload and acceleration rebuild
scene.update_instances() # Commit InstanceHandle transform changes
Common public methods:
| Method |
Description |
Scene.add(obj, positions=..., rotations=..., scales=...) |
Adds one or more instances and returns an InstanceHandle. |
Scene.get_object(name) |
Returns a named object. |
Scene.simulate(sensor_or_process, **kwargs) |
Builds when required, then executes a simulation or process. |
Scene.measure(measurement) |
Runs a non-radiative geometric measurement. |
Scene.solve_energy_balance(...) |
Solves scene energy balance. |
Scene.update_property(path, property) |
Updates the property of a selected scene element. |
Scene.apply_temperatures(product) / Scene.clear_temperatures() |
Applies or clears temperature state. |
Scene.validate_turbid_boundaries() |
Validates all Turbid boundaries. |
Scene.can_use(feature, explain=False) |
Checks whether the scene and backend can execute a feature. |
Scene.backend_info() |
Returns the selected backend and device information. |
Scene.inspect_recipe() |
After a successful simulation, returns JSON-safe workflow, component, cache, and native artifact identity for diagnostics. |
Scene.show(...) |
Opens the interactive scene viewer. |
Scene.save(path, pack=True) / Scene.load(path) |
Saves and loads a scene. |
Common object and terrain methods include Object.add_component(), Object.set_property(), Object.get_property(), Terrain.set_property(), and Terrain.height_at().
Properties
| API |
Purpose |
less.Property |
Base property class. |
less.OpticalVegetation |
Base class for two-sided vegetation optics. |
less.Lambertian |
Lambertian reflectance. |
less.Prospect |
PROSPECT leaf optical model. |
less.Fluspect |
Leaf reflectance, transmittance, and fluorescence. |
less.RPV |
RPV non-Lambertian reflectance model. |
less.WaterSurface |
Wind-dependent directional reflection and an optional water-leaving term for optically deep water. |
less.CoxMunk |
Cox–Munk water-surface slope statistics from 10 m wind speed and direction. |
less.PrescribedRrs |
User-supplied, glint-removed above-water remote-sensing reflectance. |
less.DeepWaterIOP |
Deep-water water-leaving estimate from absorption and backscattering coefficients. |
less.SpectrumDB |
Property values from a spectral database. |
less.ThermalProperty |
Temperature and longwave emissivity. |
less.BiophysicalProperty |
Physiology and energy-balance parameters. |
less.Farquhar |
Farquhar photosynthesis and stomatal-conductance model. |
less.Microclimate |
Air temperature, humidity, wind, carbon dioxide, and related conditions. |
Spatial texture inputs
Textures are spatial inputs to named Property parameters; they are not
standalone properties. See Spatial textures and property fields
for complete UV, GeoTIFF, RGB, thermal, and serialization examples.
| API |
Purpose |
less.Texture |
Abstract base type for public texture declarations. |
less.ScalarTexture |
One scalar value per pixel, including temperature in K. |
less.SpectralTexture |
Measured values on an explicit or metadata wavelength grid. |
less.RGBTexture |
RGB input with explicit empirical spectral reconstruction. |
less.WorldXY |
Georeferenced world-X/Y mapping and outside-raster policy. |
Property.with_field(name, texture) |
Attaches one texture while retaining the Property's constant fallback. |
Property.with_fields(**textures) |
Attaches multiple named texture parameters. |
Common texture controls are mapping, filter, wrap, nodata,
missing_uv, outside_spectral_domain, raster_bands, scale, and offset.
ScalarTexture and SpectralTexture also accept
class_values={class_code: physical_value} for categorical rasters such as
land cover. Scene-level resident-data controls are
Scene.texture_memory_budget_bytes and Scene.texture_tile_size.
Microwave-domain properties are less.MicrowaveSoil, less.MicrowaveVegetation, less.MicrowaveTrunk, less.MicrowaveDisc, less.MicrowaveCylinder, less.MicrowaveLeaf, less.MicrowaveNeedle, and less.MicrowaveBranch. Check capability status before using a specialized domain workflow.
Illumination and atmosphere
| API |
Purpose |
less.Illumination |
Combines a top-of-atmosphere source with an atmosphere model. |
less.Sun |
Solar direction and TOA beam-normal spectral irradiance. |
less.NoAtmosphere |
Vacuum boundary: unattenuated direct beam and no diffuse sky. |
less.PrescribedAtmosphere |
User-specified direct-beam and diffuse-horizontal transmittance. |
less.SimpleSpectralAtmosphere |
Fast simplified spectral atmosphere. |
less.HosekWilkieAtmosphere |
Directional Hosek–Wilkie sky. |
less.SixSAtmosphere |
Optional 6S atmosphere. |
less.Atmosphere |
Built-in layered atmosphere and surface-to-sensor transport. |
less.CloudLayer |
1-D thermal cloud slab with independent-pixel cover mixing. |
less.AtmosphericProfile |
Layered atmospheric profile. |
less.AtmosphereDatabase |
Built-in atmosphere, aerosol, and spectral database. |
less.AtmosphereResult |
Atmospheric solver result. |
less.LibRadtranRunner |
Optional libRadtran runner. |
less.LibRadtranUnavailableError |
Raised when libRadtran is unavailable. |
See Atmosphere and Surface–Atmosphere Transport for model parameters and units.
Projections, sensors, and instruments
Projections
| API |
Purpose |
less.Orthographic |
Orthographic projection. |
less.Perspective |
Perspective projection. |
less.Fisheye |
Fisheye projection. |
less.Pushbroom |
Satellite or airborne pushbroom projection. |
Imaging and non-imaging sensors
| API |
Product |
less.OpticalImager |
less.ImageProduct |
less.ThermalImager |
less.ImageProduct |
less.SIFImager |
less.ImageProduct |
less.BRFSensor |
less.BRFProduct |
less.RadiationFieldSensor |
less.RadiationFieldProduct |
less.IrradianceMapSensor |
less.IrradianceMapProduct |
less.MicrowaveRadiometer |
Microwave radiometry product; check capability first. |
less.RadarScatterometer |
Radar scattering product; check capability first. |
less.Instrument |
Instrument and multi-band response configuration. |
Processes and measurements
| API |
Purpose |
less.RadiationFieldProcess |
Computes scene radiation state. |
less.EnergyBalanceProcess |
Jointly solves sunlit/shaded temperatures and energy fluxes. |
less.PhotosynthesisProcess |
Solves photosynthesis and stomatal conductance. |
less.SIFProcess |
Solves solar-induced chlorophyll fluorescence. |
less.Measurement |
Base class for non-radiative measurements. |
less.LAIMeasurement |
Computes leaf area index. |
less.CHMMeasurement |
Produces a canopy height model. |
Related results and errors include less.EnergyBalanceResult, less.ComponentEnergyBalanceResult, less.JointThermoPhysiologySummary, less.ConvergenceError, and less.SolveResult.
LiDAR
| API |
Purpose |
less.Scanner |
Scanner configuration. |
less.Platform |
Base platform class. |
less.Aircraft, less.UAV |
Airborne platforms. |
less.Tripod, less.Vehicle |
Terrestrial platforms. |
less.Waypoint, less.ScanPosition |
Flight waypoints and scan positions. |
less.LiDARSurvey |
Combines a platform, scanner, and acquisition plan. |
less.PointCloud |
LiDAR point-cloud product. |
Spectral configuration and satellite bands
| API |
Purpose |
less.SpectralBands |
Base spectral-band collection. |
less.DiscreteBands |
Arbitrary non-uniform discrete bands. |
less.Hyperspectral |
Uniform hyperspectral sampling. |
less.SRFBands |
Bands with spectral response functions. |
less.gaussian_bands |
Gaussian SRFs from centre wavelength and FWHM. |
less.Sentinel2A |
Sentinel-2A bands and SRFs. |
less.Landsat8_OLI |
Landsat 8 OLI bands and SRFs. |
less.SpectralProfile, less.SpectralBand |
Spectral response descriptions. |
Products
Products carry scientific arrays and actual native execution metadata. Use each product's save() and show() methods for export and visualization.
| API |
Purpose |
less.ImageProduct |
Optical, thermal, or SIF image. |
less.InstrumentImageProduct |
Image retaining instrument-band metadata. |
less.BRFProduct |
Multi-direction BRF. |
less.RadiationFieldProduct |
Three-dimensional radiation field. |
less.IrradianceMapProduct |
Upwelling and downwelling irradiance maps. |
less.EnergyBalanceProduct |
Temperatures and energy fluxes. |
less.RadiationFieldProcessProduct |
Radiation-process state. |
less.PhotosynthesisProcessProduct |
Photosynthetic rate and stomatal conductance. |
less.SIFProcessProduct |
SIF process result. |
less.CHMProduct |
Canopy height model. |
less.SceneElementRef, less.SceneElementRows |
Unified rows for Mesh, Turbid, and Terrain results. |
Projects, resources, and serialization
| API |
Purpose |
less.Project |
Manages a scene, named sensors, resources, and task snapshots. |
less.ProjectValidationReport, less.ValidationIssue |
Project validation results. |
less.SnapshotInfo |
Remote-task snapshot metadata. |
less.ProjectResource, less.ResourceRegistry |
Project resources and checksums. |
less.load_scene |
Loads a scene from a file. |
Principal Project methods are create(), open(), add_sensor(), build(), simulate(), validate(), save(), pack(), and export_snapshot(). See Scene and Project Serialization.
Scene generation and utilities
| API |
Purpose |
less.place |
Grid, random, and Poisson-disc instance placement. |
less.asset_path |
Locates a bundled example mesh by filename. |
less.CrownGenerator, less.CrownShape, less.LeafAngle |
Parametric crown generation. |
less.SunPosition, less.compute_sun_position, less.compute_day_of_year |
Solar-position calculations. |
less.SolarSpectrum, less.SpectrumLibrary, less.MaterialDB |
Solar, material, and spectral databases. |
Backends, capability checks, and errors
| API |
Purpose |
less.list_backends |
Lists discoverable backends. |
less.list_backend_features |
Lists feature names. |
less.available_features |
Lists features executable in the current environment. |
less.can_use |
Tests whether a feature can execute. |
less.feature_status |
Returns feature status and explanation. |
less.backend_capability_matrix |
Returns the backend capability matrix. |
less.BackendFeature, less.BackendFeatureStatus, less.BackendInfo |
Feature and device information types. |
less.BackendUnavailableError |
Requested backend is unavailable. |
less.BackendFeatureUnavailableError |
Requested native feature is unavailable and no fallback was performed. |
Public API boundary
This reference contains interfaces intended for user code. Names beginning with an underscore, _native_optix, _native_vulkan, _native_embree, native scene managers, GPU buffers, artifact validators, and debug hooks are implementation details and are not public APIs.