The Monte-Carlo radiative transfer simulator
htrdr 0.9.1 is available
- Build from sources: git
htrdr evaluates the intensity at any position (probe) of the
scene, in any direction, in the presence of surfaces and an absorbing
and diffusing semi-transparent medium, for both internal (longwave)
or external (shortwave) radiation sources. The intensity is
calculated using the Monte-Carlo method: a number of optical paths are
simulated backward, from the probe position and into the medium. Various
algorithms are used, depending on the specificities of the nature and shape of
the radiation source.
Caliot et al.
Villefranque et al.
(Science Advances 2022)
Sans et al.
Villefranque et al.
Applications are theoretically possible to any configuration. However, it
all eventually comes down to the possibility of using the physical data of
interest, in their most common formats, in each scientific community.
htrdr is currently suitable for three main application fields:
Atmospheric radiative transfer: a clear-sky atmosphere is vertically stratified, neglecting Earth sphericity, and described in terms of absorption coefficients as a function of height and spectral quadrature point as per a correlated-k model. Cloud physical properties are provided on a 3D rectangular grid. Surface geometrical and optical properties can be provided for an arbitrary number of geometries. Internal radiation and solar radiation are taken into account.
Combustion processes: thermodynamic data is provided at the nodes of an unstructured tetrahedral mesh, while surface properties can still be provided for various materials. The radiation source is only external: a monochromatic laser sheet illuminates the inside of the combustion chamber for diagnostic purposes.
Planetology: takes into account the geometry of a "ground" of arbitrary shape, described by a triangular mesh, with the possibility of using an arbitrary number of materials. The radiative properties of a gas mixture must be provided on a tetrahedral mesh, using the k-distribution spectral model. The radiative properties of an arbitrary number of aerosol and hydrometeores can also be provided on their individual tetrahedral mesh. Calculations can be made for both internal and external radiation sources. In the case of an external source, a sphere of arbitrary size and position is used. This sphere can radiate as a Planck source at a specified brightness temperature, or be associated with a high-resolution radiance spectrum.
Since any radiative transfer observable is expressed as an integral of the radiance, and since there is a strict equivalence between the integral to be solved and the underlying Monte-Carlo algorithm (each integral is associated with the sampling of a random variable), the algorithms that calculate the radiance are used for computing various quantities:
Images on a camera sensor, in a given field of view. For combustion applications, only monochromatic images are supported. In atmospheres and in planetology, spectral integration is also possible, both for solar and thermal images: CIE colorimetry is used for solar images, while thermal images are in fact brightness temperature maps, obtained from the incoming radiative flux over a specified spectral interval.
Flux density maps, on a grid of sensors, integrated over an entire hemisphere. In the case of combustion chambers, flux density maps can be calculated, while spectrally integrated flux density maps are also possible for atmospheric application, both for solar and thermal radiation.
htrdr has been used, developped and extended in the following
- The development of
htrdrbegan with the High-Tune project. Originally, it simulated the radiative transfer of an external source (solar) in a scene composed of a triangulated ground and an atmosphere, neglecting Earth sphericity, in the presence of a cloud field provided over a structured grid. It was later extended in order to take into account a non-gray surface, and the possibility to perform radiative transfer computations for a internal source (ground and atmosphere).
- In project ModRadUrb the emphasis was put on taking into account the representation of complex geometries (detailled city scenes) using spectral properties of an arbitrary number of materials. The solver was extended to solve upward and downward hemispherical atmospheric fluxes on a plane positioned anywhere in the scene, both in the visible and the infrared spectral ranges.
- In project MCG-Rad
htrdrcodebase was used to explore a whole new class of radiative transfer algorithms: instead of relying on the full atmospheric radiative properties data set (prerequisite for current algorithms), the so-called line sampling algorithms will not require nor compute the absorption coefficient of the atmosphere. Instead, it will sample energetic transitions and use a Line-by-Line parameters database (such as HITRAN) in order to perform a rigorous spectral integration, both in the visible and the infrared spectral ranges.
- In project Astoria,
htrdrwas used to produce images in the visible, in the presence of combustion chambers where radiation scattering is performed by soot aggregates. One of the main difficulty resides in the fact that the chamber is illuminated by a laser: the classical solar radiative transfer algorithm then fails to converge because of the collimated radiation source, and a new algorithm was thus designed in order to ensure numerical convergence.
- In project Rad-Net,
htrdrwas adapted for applications in planetology and astrophysics. The application is now a scene composed of an arbitrary number of solid surfaces (a planet, satellites) represented by triangular meshes and materials which describe their spectral reflectivity/emissivity properties. The 3D atmopshere is defined by a number of participating semi-transparent media (a gas mixture and an arbitrary number of aerosol modes) whose radiative properties are provided at the nodes of a unstructured tetrahedral volumetric grid, independant for each medium.
A straight interface
htrdr is a command-line tool that performs computations
on input data, writes the rendered image and nothing more. No assumption is
made on how input data are created, the only requirement is compliance with
the expected file formats. In the same spirit, the output image is written in
plain text, as a list of raw pixel estimations, which makes it easier to
This thin interface is, by nature, particularly well suited to be
extended and integrated into any workflow. For instance, one can
save the cloud properties used by htrdr-atmosphere directly in the
htcp file format or use the les2htcp tool to convert cloud properties
from NetCDF to
htcp. In the same way, the output image can be post-processed
through gnuplot or converted in a regular
PPM image by the htpp program, and then
visualised in an image viewer as for instance feh or display.
No pre-compiled version of
htrdr is provided; it must be
compiled directly from its source tree. A simple way is to rely on the
htrdr branch of the Star-Engine
project: it provides CMake scripts that automate the download, the compilation
and the installation of
htrdr and its dependencies. This build
procedure assumes the following prerequisites:
- CMake in version 3.5 or higher.
- git source control.
- GNU Compiler Collection in version 4.8 or higher.
- NetCDF library and headers in version 4 or higher.
- OpenMPI library and headers in version 2 or higher.
- Optionally, the scdoc tool to generate the reference documentation man pages.
Assuming that the aforementioned prerequisites are available, the build procedure is summed up to:
~ $ git clone -b htrdr-0.9.1\ https://gitlab.com/meso-star/star-engine.git\ htrdr-0.9.1 ~ $ mkdir htrdr-0.9.1/build ~ $ cd htrdr-0.9.1/build ~/htrdr-0.9.1/build $ cmake ../cmake ~/htrdr-0.9.1/build $ make
Tune the build
By default, the whole
htrdr project is built but you may prefer
htrdr only for a specific application, i.e. only for
atmospheric radiative transfer, combustion processes or planetology. In this
case, only activate the desired application during the CMake configuration
step. For example, to install only the atmospheric part of
~ $ git clone -b htrdr-0.9.1\ https://gitlab.com/meso-star/star-engine.git\ htrdr-0.9.1 ~ $ mkdir htrdr-0.9.1/build ~ $ cd htrdr-0.9.1/build ~/htrdr-0.9.1/build $ cmake ../cmake\ -DHTRDR_BUILD_ATMOSPHERE=On\ -DHTRDR_BUILD_COMBUSTION=Off\ -DHTRDR_BUILD_PLANETO=Off ~/htrdr-0.9.1/build $ make
Visit the Star-Engine git
htrdr for a complete description of the build
process and available options.
htrdr is installed in the
htrdr-0.9.1. Evaluate the provided
htrdr.profile file in the current shell to register
htrdr against it.
~ $ . ~/htrdr-0.9.1/local/etc/htrdr.profile ~ $ htrdr -h
If the scdoc tool was installed
make invocation, the reference documentation of the
htrdr program and its associated file formats should be available
through man pages. Use the
man command-line to consult them. For
~ $ man htrdr ~ $ man htrdr-atmosphere ~ $ man htrdr-combustion ~ $ man htrdr-planeto
Refer to the Starter Packs to quickly run a
htrdr rendering; these archives provide input data and scripts
that are good starting points to use
Once built, the
htrdr installation can be packaged in an
archive that can then be deployed on compatible systems, i.e. systems
whose C library, NetCDF library and MPI implementation are compatibles with the
ones available on the system used to build
~/htrdr-0.9.1/build $ make pkg ~/htrdr-0.9.1/build $ ls package/htrdr-0.9.1*
- Fix invalid read/write memory access when ray tracing the ground in
- Fix compilation warning detected by GCC 12.
htrdr-planetoman page (-S option): the unit of the radius and the distance from the source is not the meter but the kilometer.
htrdrman page: replaced long options with short options.
- Reference and install the rnrl fileformat man page.
- Proofreading the README and man pages: correcting typos, spelling and formatting errors and turns of phrase
Adds radiative transfer simulation in 3D planetary atmospheres
htrdr-planeto command simulates radiative transfer in planetology
context, i.e. in the 3D atmosphere of a telluric planet. Both infrared and
visible computations are supported.
htrdr-planeto is actually a renderer that
calculates an image for a given observation position. Its internal rendering
algorithm is based on Monte-Carlo integration, which consists for each pixel in
simulating a given number of optical paths from the sensor, taking into account
the phenomena of light absorption and scattering.
The planet's ground can be any set of triangles with BRDFs and temperatures defined per triangle. The atmosphere is composed of a gas mixture and a potentially empty set of aerosols. Both can have arbitrary tetrahedral meshes with per-node radiative properties.
- Use scdoc rather than asciidoc as file format for man sources.
- Update all dependencies. More notably, use MruMtl 0.1 which introduces API breaks.
- Add the discrete wavelength distribution currently used in
Sets the required version of Star-SampPling to 0.12. This version fixes compilation errors with gcc 11 but introduces API breaks.
- Adds support for a thin lens camera model and an orthographic camera model for combustion and atmosphere modes.
- Updates the size of a tile from 32x32 pixels to 8x8 pixels. A tile is a block of pixels rendered by a thread. However, a size of 32x32 pixels could be too large when rendering on several dozen threads: the image definition could be insufficient to give tiles to all threads.
- Fixes the calculation of shortwave radiance by
htrdr-combustionand the calculation of longwave radiance by
htrdr-atmosphere. At each scattering position, the range of the traced ray could be incorrect.
Adds the simulation of radiative transfer in combustion media
htrdr-combustion command performs radiative transfer computations in
a scene representing a semi-transparent medium enlightened by a laser sheet. It
uses Monte-Carlo to calculate a monochromatic image of the medium or the
radiative flux density. Both computations are performed in the visible at a
The medium data are defined on the vertices of an unstructured tetrahedral mesh that may be surrounded by a triangular surface mesh representing the inner limits of the combustion chamber.
htrdr command is renamed to
a proxy for the
htrdr-atmosphere command or the
htrdr with the
<atmosphere|combustion> options is equivalent to
directly calling the
- Major update of the entire codebase to add multiple applications to
htrdr: It was originally designed to handle atmospheric applications only.
- Always displays the number of processes and the number of threads: previously they were only printed on multi-node executions.
- Fixed auto intersection issue on surfaces not facing the sun.
- Fixed writing of pixel data: assumed pixel layout could be wrong.
- Fix the self-intersection issue in shortwave computations introduced by the 0.6 version.
- Add support of flux map computation for both shortwave and longwave. The flux
is computed for the part of the flux map lying outside any geometry. The new
command line option
-pdefines the rectangle in the scene onto which the flux is going to be integrated. The flux map resolution and the realisations count per pixel is controlled by the
- Add support of thin materials, i.e. materials without geometric thickness as for instance the leaves of the trees.
- Add the temperature property to the materials and used it as the limit condition during longwave computations. Previously, the surface temperatures were fetched from the atmosphere at the given surface position.
- Add the
-noption to fix the name of the material defining the atmosphere.
- In shortwave, fix how direct contribution is handled for purely specular BRDF.
- Fix the
undefined strtok_r symbolissue exhibited by some GCC versions that leads to memory corruption and segmentation fault when parsing the ground interfaces.
- Fix typos in the man pages.
Add support of shortwave integration with respect to the Planck function for a reference temperature whose default value is the blackbody temperature of the sun. Actually this is the counterpart of the longwave integration introduced by the "infrared rendering" in the 0.4 version. The main difference is that the source of radiation is the sun rather than the medium and its boundaries.
-l that enabled the infrared rendering is now replaced by the new
-s option that controls the spectral integration that can be CIE XYZ (i.e.
regular image rendering), longwave or shortwave.
- Fix the returned sun radiance: the precomputed per spectral band solar incoming flux is removed and the sun radiance is now retrieved by directly evaluating the monochromatic Planck for the blackbody temperature of the sun.
- Fix CIE XYZ spectral integration: the pdf used to sample the CIE tristimulus values was not correctly handled in the Monte-Carlo weight.
- Fix the longwave spectral integration: the Monte-Carlo weight was wrong leading to overestimated temperatures.
- Add support of infrared rendering: when defined, the new
-loption setups the range of longwave into which the rendering is performed. In infrared rendering, each pixel stores the radiance per pixel and its associated brightness temperature. Spectral integration is done with respect to the Planck function for a reference temperature of 290 K.
- The ground geometry can now have several materials whose data vary over the
spectrum. These materials are listed in a new
file where each materials is defined by a name and a file storing its spectral
data with respect to the
fileformat. A material is mapped to a part of the OBJ geometry by using the
usemtldirective of the OBJ fileformat.
- Improve the sampling of the spectral dimension: the per wavelength realisation is now precisely sampled rather than arbitrarly fixed to the center of the sampled spectral band. Consequently, high resolution data defined per wavelength (e.g. Mie's properties and the reflectivity of the materials) are now fully taken into account.
- Fix a deadlock when
htrdrwas run through MPI.
- Fix a memory leak: the output file was not closed on exit.
- Add the
-Ooption that defines the file where the sky data are cached. If the file does not exist, the sky data structures are built from scratch and serialized into this new file. If this file exists, these data structures are directly read from it, leading to a huge speed up of the
htrdrpre-processing step. Note that if the provided file exists but is filled with data that do not match the submitted HTGOP, HTCP and HTMie files, an error is detected and the program stops.
- Rely on the HTSky library to manage the sky data. This library handles the
code previously defined into the
htrdr_sky.<c|h>files. The HTCP, HTGOP, HTMie libraries are thus no more dependencies of
htrdrsince only the
htrdr_skyfiles used them.
- Add the
-boption that controls the BRDF of the ground geometry.
- Make optional the use of a ground geometry (option
- Make optional the definition of the optical properties of water droplets
-m) when no cloud field is used.
- Add the
-Voption that fixes the maximum definition of the octrees used to partitioned the radiative properties of the clouds.
- Add a per pixel estimation of the per radiative path computation time.
- Fix the computation of the surface scattering: there was a bug in how Russian roulette was implemented at surface scattering leading to an underestimation of the surface reflection.
- Update the thread allocation policy: by default, the number of threads is now
defined as the maximum between the number of processors detected by OpenMP
and the number of threads defined by the
OMP_NUM_THREADSenvironment variable. This variable can be used to counteract the number of processors detected by OpenMP that can be lower than the real number of processors of the system.
- Fix compilation on systems with a GNU C Library whose version is less than 2.19.
- Fix a possible invalid memory access to cloud data leading to segmentation faults.
Copyright © 2018-2019, 2022-2023 Centre National de la Recherche Scientifique
Copyright © 2020-2022 Institut Mines Télécom Albi-Carmaux
Copyright © 2022-2023 Institut Pierre-Simon Laplace
Copyright © 2022-2023 Institut de Physique du Globe de Paris
Copyright © 2018-2023 |Méso|Star> (email@example.com)
Copyright © 2022-2023 Observatoire de Paris
Copyright © 2022-2023 Université de Reims Champagne-Ardenne
Copyright © 2022-2023 Université de Versaille Saint-Quentin
Copyright © 2018-2019, 2022-2023 Université Paul Sabatier
htrdr is free software released under the GPL v3+ license: GNU GPL version 3 or
later. You are welcome to redistribute it under certain conditions; refer to
the COPYING file for details.