Metadata-Version: 2.4
Name: less3d
Version: 3.1.1
Summary: GPU-accelerated 3D radiative transfer model for remote sensing
Keywords: remote-sensing,radiative-transfer,ray-tracing,GPU,OptiX,vegetation,LiDAR,LAI
Author: LESS Development Team
License-Expression: LicenseRef-LESS-Academic-Research-1.0 AND LicenseRef-LESS-Third-Party-Notices
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: C++
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Project-URL: Homepage, https://cnb.cool/lessrt3d/LESSPRO
Requires-Python: >=3.10
Requires-Dist: numpy>=1.24
Requires-Dist: pillow>=9.0
Requires-Dist: viser>=0.2.0
Requires-Dist: matplotlib>=3.5
Requires-Dist: rasterio>=1.3
Requires-Dist: scipy>=1.10
Requires-Dist: trimesh>=4.0
Provides-Extra: service
Requires-Dist: aiohttp<4,>=3.9; extra == "service"
Provides-Extra: lidar
Requires-Dist: laspy>=2.0; extra == "lidar"
Requires-Dist: cloth-simulation-filter>=1.1; extra == "lidar"
Provides-Extra: atmosphere
Requires-Dist: filelock>=3.12; extra == "atmosphere"
Requires-Dist: h5py>=3.8; extra == "atmosphere"
Requires-Dist: Py6S>=1.9; extra == "atmosphere"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: mpmath>=1.3; extra == "dev"
Requires-Dist: psutil>=5; extra == "dev"
Requires-Dist: numba; extra == "dev"
Requires-Dist: h5py>=3.8; extra == "dev"
Requires-Dist: filelock>=3.12; extra == "dev"
Description-Content-Type: text/markdown

# LESS

**3D Radiative Transfer Model**

Version 3.1.1

[![PyPI version](https://img.shields.io/pypi/v/less3d.svg)](https://pypi.org/project/less3d/)
[![Python](https://img.shields.io/pypi/pyversions/less3d.svg)](https://pypi.org/project/less3d/)
[![License: Academic and Commercial](https://img.shields.io/badge/license-academic%20%7C%20commercial-blue.svg)](LICENSE)

LESS is a GPU- and CPU-accelerated 3D radiative transfer model for quantitative remote sensing. It combines a Python interface with NVIDIA OptiX, Vulkan Ray Query, and Intel Embree native backends for optical, thermal, solar-induced fluorescence (SIF), vegetation photosynthesis, energy-balance, and LiDAR simulations.

LESS 3.x is a completely new native implementation of the original [LESS model](http://lessrt.org). The original LESS 2.x implementation remains available at [lessrt.org](http://lessrt.org).

## Highlights

- **Remote-sensing-oriented Python API** — describe a scene using terrain, objects, optical properties, illumination, sensors, and products.
- **Three native backends** — OptiX for NVIDIA GPUs, Vulkan Ray Query for supported GPUs, and Embree for CPU execution for simulation across supported platforms.
- **Persistent scenes** — geometry is prepared automatically on the first simulation and reused when only illumination, spectra, or properties change.
- **Mesh and turbid vegetation** — simulate explicit geometry, volume canopies, or mixed scenes.
- **Imaging and biophysical products** — optical and thermal imagery, BRF, radiation fields, irradiance maps, SIF, photosynthesis, energy balance, and LiDAR.
- **Sensor effects** — pushbroom geometry, spectral response, PSF/MTF, detector noise, ADC quantisation, and geolocation.
- **Interactive inspection** — use `scene.show()` to explore scenes and products in a browser-based viewer.

## Find your way around the source

| What you want to understand | Where to start |
| --- | --- |
| How a scene is defined | [Scene API](python/less/scene.py), [sensors](python/less/sensors), [surface properties](python/less/surfaces), and [media](python/less/media) |
| How BRF is calculated | [BRF workflow](python/less/_compile/workflows/brf.py), [forward transport](src/integrators/optical_forward), and [BRF product](src/products/brf) |
| How LiDAR returns become a waveform | [LiDAR workflow](python/less/_compile/workflows/lidar.py), [LiDAR transport](src/integrators/lidar), and [waveform product](src/products/lidar_waveform) |
| Where a surface interaction is defined | [Lambertian property](python/less/surfaces/lambertian.py) and its [shared native model](src/surfaces/lambertian) |

[Source architecture](docs/architecture.md) describes the ownership of scene preparation,
scientific workflows, native programs, and results. [Development](DEVELOPMENT.md) covers
building the three backends and running tests.

## Installation

Install the wheel that matches your operating system and Python version. See the
[installation guide](docs/tutorials/en/02-installation.md) for platform requirements.
The Apple Silicon wheel uses Embree on the CPU. GPU backends require compatible drivers.

| Backend          | Typical hardware         | Recommended memory | Suggested use                          |
| ---------------- | ------------------------ | ------------------:| -------------------------------------- |
| Embree           | x86-64 or Apple Silicon CPU | System RAM      | CPU simulation and comparison          |
| Vulkan Ray Query | Vulkan 1.2 Ray Query GPU | 4 GB+ VRAM         | Supported non-CUDA GPU workflows       |
| OptiX + CUDA     | Compatible NVIDIA GPU    | 8 GB+ VRAM         | High-throughput Monte Carlo simulation |

Check whether a feature can run with a particular backend on the current computer:

```python
import less

less.can_use("optical_imaging", backend="optix")
less.can_use("irradiance_map", backend="embree")
```

After creating a scene, `scene.can_use("feature")` performs the same check using that scene's selected backend.

## Available in 3.1.1

The following workflows are available with OptiX, Vulkan, and Embree when the selected backend meets its hardware and driver requirements:

| Domain                | Capabilities                                                               |
| --------------------- | -------------------------------------------------------------------------- |
| Optical               | Mesh, turbid-vegetation and homogeneous-medium imaging, BRF, radiation fields, and irradiance maps |
| Atmosphere            | Shortwave gas absorption, molecular and aerosol scattering, and volumetric clouds |
| Water                 | Finite water bodies, submerged objects, regular waves, and wind-roughened deep-water surfaces |
| Spatial properties    | UV and georeferenced textures for optical, thermal, LiDAR, and physiology  |
| Scene layout          | Dynamic instances, repetitive scenes, and terrain-following placement      |
| Thermal               | Thermal imaging and per-primitive temperatures                             |
| Scene components      | Sunlit/shaded leaf and soil classification with per-component area         |
| Vegetation physiology | SIF imaging and processes, photosynthesis, and energy balance              |
| LiDAR                 | Point clouds, full waveforms, and turbid-volume returns                    |

The microwave extension provides SAR imaging on platforms that include it.
See the [SAR tutorial](docs/tutorials/en/sar-imaging.md) and the
[3D atmosphere and cloud tutorial](docs/tutorials/en/16-illumination-and-atmosphere.md).



Repetitive scenes require flat, statistically homogeneous terrain and cannot be combined with `terrain_following=True`. Moving a `TurbidBoundary` instance requires `scene.rebuild()`; ordinary property and illumination changes do not.

## Quick start

```python
import less

# Create a 10 m × 10 m bare-soil scene.
scene = less.Scene()
scene.size = 10.0
scene.terrain = less.Terrain(
    property=less.Lambertian(reflectance=0.3)
)
scene.illumination = less.Illumination(
    source=less.Sun(zenith=30, azimuth=150),
    atmosphere=less.NoAtmosphere(),
)

# Simulate a nadir RGB image.
sensor = less.OpticalImager(
    less.Orthographic(image_size=256),
    bands=[650, 550, 450],
    quality=128,
)
image = scene.simulate(sensor)
image.save("output.png")
```

Change the illumination and simulate again; the prepared geometry is reused automatically:

```python
scene.illumination = less.Illumination(
    source=less.Sun(zenith=60, azimuth=90),
    atmosphere=less.NoAtmosphere(),
)
image2 = scene.simulate(sensor)
```

## Forest example

```python
import less
import numpy as np

scene = less.Scene()
scene.size = 30.0
scene.terrain = less.Terrain(
    property=less.Lambertian(reflectance=0.12)
)
scene.illumination = less.Illumination(
    source=less.Sun(zenith=35, azimuth=225),
    atmosphere=less.NoAtmosphere(),
)

birch = less.Object("birch", mesh=less.asset_path("FREX.obj"))
birch.set_property(
    "leaves",
    less.Prospect(cab=40, car=8, cw=0.012, cm=0.009, N=1.5),
)
birch.set_property("stem_branch", less.Lambertian(reflectance=0.1))

xy = np.random.default_rng(42).random((50, 2)) * 30
scene.add(birch, positions=np.c_[xy, np.zeros(50)])

image = scene.simulate(less.OpticalImager(
    less.Orthographic(image_size=512),
    bands=[550, 670, 800],
    quality=256,
))
image.save("forest.tif")
```

GeoTIFF output preserves the physical values of the simulated product.

## Examples and viewer

```python
import less

less.examples.list()
less.examples.run("autumn_forest")
less.examples.run("maize_field")

scene.show()
```

## Numerical results

Simulation products use the same physical quantities and units on all three backends. Monte Carlo estimates can differ because their random samples differ. For quantitative work, increase the sampling quality until your scene averages and spatial patterns are stable.



## Documentation

Start with the public tutorials:

- [中文：安装](docs/tutorials/zh/02-installation.md)
- [中文：LESS 的工作方式](docs/tutorials/zh/04-how-less-works.md)
- [中文：API 参考](docs/tutorials/zh/api-reference.md)
- [English: Installation](docs/tutorials/en/02-installation.md)
- [English: How LESS works](docs/tutorials/en/04-how-less-works.md)
- [English: API reference](docs/tutorials/en/api-reference.md)

Building LESS from source, running the test suites, or extending it with new
sensors, products or backends is covered in [DEVELOPMENT.md](DEVELOPMENT.md).
None of it is needed to use the published wheel.

## Citation

If you use LESS in your research, please cite:

> Qi, J., Xie, D., Yin, T., Yan, G., Gastellu-Etchegorry, J.-P., Li, L., Zhang, W., Mu, X., and Norford, L. K. (2019). LESS: LargE-Scale remote sensing data and image Simulation framework over heterogeneous 3D scenes. *Remote Sensing of Environment*, 221, 695–706.

## License

LESS is free for academic teaching and qualifying non-commercial research.
Use is governed by the current [LICENSE](LICENSE). Commercial use requires a
separate written license.

Commercial use includes company use, commercial consulting or services,
commissioned research, commercial synthetic-data generation, and integration
into commercial products, platforms, or services. University or non-profit
projects performed for a company, or projects that give a company confidential
deliverables, preferential access, publication control, or intellectual-
property rights, are commercial use. An unrestricted donation or public
research grant does not by itself make qualifying academic research commercial;
use by a company remains commercial regardless of its funding source.

Third-party components remain subject to their respective license terms. See
the LICENSE file for details. Earlier LESS releases remain governed by the
license terms that accompanied those releases; those earlier grants are not
revoked.

For commercial licensing or clarification, contact the LESS Development Team
through the project homepage.
