htrdr

Solving radiative transfer in heterogeneous media
git clone git://git.meso-star.fr/htrdr.git
Log | Files | Refs | README | LICENSE

htrdr-atmosphere.1.in (23696B)


      1 .\" Copyright (C) 2018-2019, 2022-2025 Centre National de la Recherche Scientifique
      2 .\" Copyright (C) 2020-2022 Institut Mines Télécom Albi-Carmaux
      3 .\" Copyright (C) 2022-2025 Institut Pierre-Simon Laplace
      4 .\" Copyright (C) 2022-2025 Institut de Physique du Globe de Paris
      5 .\" Copyright (C) 2018-2025 |Méso|Star> (contact@meso-star.com)
      6 .\" Copyright (C) 2022-2025 Observatoire de Paris
      7 .\" Copyright (C) 2022-2025 Université de Reims Champagne-Ardenne
      8 .\" Copyright (C) 2022-2025 Université de Versaille Saint-Quentin
      9 .\" Copyright (C) 2018-2019, 2022-2025 Université Paul Sabatier
     10 .\"
     11 .\" This program is free software: you can redistribute it and/or modify
     12 .\" it under the terms of the GNU General Public License as published by
     13 .\" the Free Software Foundation, either version 3 of the License, or
     14 .\" (at your option) any later version.
     15 .\"
     16 .\" This program is distributed in the hope that it will be useful,
     17 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
     18 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     19 .\" GNU General Public License for more details.
     20 .\"
     21 .\" You should have received a copy of the GNU General Public License
     22 .\" along with this program. If not, see <http://www.gnu.org/licenses/>.
     23 .Dd January 24, 2024
     24 .Dt HTRDR-ATMOSPHERE 1
     25 .Os
     26 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     27 .\" Name and Short description
     28 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     29 .Sh NAME
     30 .Nm htrdr-atmosphere
     31 .Nd simulate radiative transfer in cloudy atmospheres
     32 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     33 .\" Summary of options
     34 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     35 .Sh SYNOPSIS
     36 .Nm
     37 .Op Fl dfhRrv
     38 .Op Fl c Pa clouds
     39 .Op Fl C Ar persp_camera_opt Ns Op : Ns Ar persp_camera_opt No ...
     40 .Op Fl D Ar sun_azimuth , Ns Ar sun_elevation
     41 .Op Fl g Pa ground
     42 .Op Fl i Ar image_opt Ns Op : Ns Ar image_opt No ...
     43 .Op Fl M Pa materials
     44 .Op Fl m Pa mie
     45 .Op Fl n Ar sky_mtl
     46 .Op Fl O Pa cache
     47 .Op Fl o Pa output
     48 .Op Fl P Ar ortho_camera_opt Ns Op : Ns Ar ortho_camera_opt No ...
     49 .Op Fl p Ar flux_sensor_opt Ns Op : Ns Ar flux_sensor_opt No ...
     50 .Op Fl s Ar spectral_opt Ns Op : Ns Ar spectral_opt No ...
     51 .Op Fl T Ar optical_thickness
     52 .Op Fl t Ar threads_count
     53 .Op Fl V Ar x , Ns Ar y , Ns Ar z
     54 .Fl a Pa atmosphere
     55 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     56 .\" Detailed description
     57 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     58 .Sh DESCRIPTION
     59 .Nm
     60 simulates radiative transfer in scenes composed of an atmospheric gas
     61 mixture, liquid clouds, and a ground.
     62 It evaluates the intensity incoming on each pixel of the sensor array.
     63 The underlying algorithm is based on a Monte Carlo method: it consists
     64 in simulating a given number of optical paths originating from the
     65 sensor, directed into the atmosphere, taking into account light
     66 absorption and scattering phenomena.
     67 .Pp
     68 Radiative transfer can be evaluated in any part of the spectrum.
     69 It uses the k distributions to be provided for the vertical profile of
     70 atmospheric pressure and temperature
     71 .Pq option Fl a .
     72 For clouds, the user must define the liquid water content suspended in
     73 clouds
     74 .Pq option Fl c ,
     75 and the optical properties of water droplets
     76 .Pq option Fl m .
     77 All that remains is to define the position of the sun
     78 .Pq option Fl D ,
     79 the properties of the sensor
     80 .Pq options Fl C , Fl P No or Fl p
     81 and the definition of the image
     82 .Pq option Fl i .
     83 You can also enter the geometry of the ground
     84 .Pq option Fl g
     85 and its associated materials
     86 .Pq option Fl M .
     87 Note that clouds and ground can be infinitely repeated along the X and Y
     88 axis
     89 .Pq option Fl r No and Fl R .
     90 .Pp
     91 Four types of sensor are provided.
     92 The pinhole camera and the thin-lens camera
     93 .Pq option Fl C
     94 are used to calculate the image of the scene from a given viewpoint.
     95 Unlike these two cameras, the orthographic camera
     96 .Pq option Fl P
     97 uses parallel projection rather than perspective projection.
     98 Finally, the rectangular sensor
     99 .Pq option Fl p
    100 is used to calculate flux maps.
    101 .Pp
    102 The spectral dimension can be integrated in various ways
    103 .Pq option Fl s .
    104 When rendering an image
    105 .Pq options Fl C No and Fl P
    106 the calculation is by default performed for the visible part of the
    107 spectrum between
    108 .Bq 380, 780
    109 nanometers, for the three components of the CIE 1931 XYZ color space
    110 which are then recombined to obtain the final color for each pixel.
    111 The other method consists of explicitly defining the longwave or
    112 shortwave spectral range to be processed and continuously sampling a
    113 wavelength within this range.
    114 Longwave and shortwave are key words here meaning that the source of
    115 radiation is either internal or external to the medium.
    116 For short-wave images the radiance of the pixel is evaluated and stored
    117 at the output.
    118 For long-wave images this estimated radiance is then converted into
    119 brightness temperature and both are stored at the output.
    120 When calculating a flux map
    121 .Pq option Fl p
    122 the flux per pixel is stored in the output map regardless of whether the
    123 spectral range is longwave or shortwave.
    124 .Pp
    125 In
    126 .Nm
    127 the spatial unit 1.0 corresponds to one meter and temperatures are
    128 expressed in Kelvin.
    129 Estimated radiances are given in W/sr/m^2 except for monochromatic
    130 calculations where the calculated spectral radiance is defined in
    131 W/sr/m^2/nm.
    132 Flux densities are recorded in W/m^2.
    133 The results are written to the output file if the
    134 .Fl o
    135 option is set and otherwise to standard output.
    136 The output image is a list of raw ASCII data formatted using the
    137 .Xr htrdr-image 5
    138 file format.
    139 .Pp
    140 .Nm
    141 implements mixed parallelism.
    142 On a single computer (that is, a node), it uses shared memory
    143 parallelism while it relies on Message Passing Interface (MPI) to
    144 parallelize calculations between multiple nodes.
    145 .Nm
    146 can therefore be launched either directly or via a process launcher such
    147 as
    148 .Xr mpirun 1
    149 to distribute the calculation on several computers.
    150 .Pp
    151 The options are as follows:
    152 .Bl -tag -width Ds
    153 .It Fl a Ar atmosphere
    154 Optical properties of atmospheric gases saved in htgop format.
    155 .It Fl c Pa clouds
    156 Cloud properties saved in
    157 .Xr htcp 5
    158 format.
    159 .It Fl C Ar persp_camera_opt Ns Op : Ns Ar persp_camera_opt No ...
    160 Set up a pinhole or thin-lens perspective camera.
    161 .Pp
    162 The options for a perspective camera are as follows:
    163 .Bl -tag -width Ds
    164 .It Cm focal-dst= Ns Ar distance
    165 Distance to focus on with a thin lens camera, that is, a camera whose
    166 .Cm lens-radius
    167 is not zero.
    168 The default focal distance is
    169 @HTRDR_ARGS_DEFAULT_CAMERA_PERSPECTIVE_FOCAL_DST@ meters.
    170 .It Cm focal-length= Ns Ar length
    171 Focal length of a camera lens.
    172 It is another way to control the field of view of a thin lens camera.
    173 By default, the field of view is set through the
    174 .Cm fov
    175 parameter.
    176 .It Cm fov= Ns Ar angle
    177 Vertical field of view of the camera in
    178 ]@HTRDR_ARGS_CAMERA_PERSPECTIVE_FOV_EXCLUSIVE_MIN@,
    179 @HTRDR_ARGS_CAMERA_PERSPECTIVE_FOV_EXCLUSIVE_MAX@[ degrees.
    180 The default field of view is
    181 @HTRDR_ARGS_DEFAULT_CAMERA_PERSPECTIVE_FOV@ degrees.
    182 .It Cm lens-radius= Ar radius
    183 Radius of the camera lens.
    184 A non-zero radius means that the camera is a thin lens camera while a
    185 zero radius defines a pinhole camera.
    186 The default lens radius is
    187 @HTRDR_ARGS_DEFAULT_CAMERA_PERSPECTIVE_LENS_RADIUS@.
    188 .It Cm pos= Ns Ar x , Ns Ar y , Ns Ar z
    189 Camera position.
    190 Default is @HTRDR_ARGS_DEFAULT_CAMERA_POS@.
    191 .It Cm tgt= Ns Ar x , Ns Ar y , Ns Ar z
    192 Targeted position
    193 Default is @HTRDR_ARGS_DEFAULT_CAMERA_TGT@.
    194 .It Cm up= Ns Ar x , Ns Ar y , Ns Ar z
    195 Upward vector that the top of the camera is pointing towards.
    196 Default is @HTRDR_ARGS_DEFAULT_CAMERA_UP@.
    197 .El
    198 .It Fl D Ar sun_azimuth , Ns Ar sun_elevation
    199 Direction toward the sun center.
    200 The direction is defined by two angles in degrees:
    201 the
    202 .Ar sun_azimuth
    203 angle in [0, 360[ and the
    204 .Ar sun_elevation
    205 angle in [0, 90].
    206 .Pp
    207 Following the right-handed convention, the azimuthal rotation is
    208 counter-clockwise, with 0 degree on the X axis.
    209 The elevation starts from 0 degree for a direction in the XY plane, up
    210 to 90 degrees at zenith.
    211 Thus
    212 .Li -D\ 0,0 ,
    213 .Li -D\ 90,0 ,
    214 .Li -D\ 180,0
    215 and
    216 .Li -D\ 270,0
    217 will produce solar vectors
    218 .Pq +1,0,0 ,
    219 .Pq 0,+1,0 ,
    220 .Pq -1,0,0
    221 and
    222 .Pq 0,-1,0
    223 respectively, while
    224 .Li -D\  Ns Ar sun_azminuth , Ns 90
    225 will produce
    226 .Pq 0,0,+1
    227 regardless of
    228 .Ar sun_azimuth
    229 value.
    230 .It Fl d
    231 Write to
    232 .Pa output
    233 the space partitioning data structures used to speed up cloud radiative
    234 transfer calculations.
    235 The data written are octrees saved in legacy VTK file format.
    236 Each octree node stores the minimum and maximum extinction coefficients
    237 of the cloud cells covered by the octree node.
    238 In the output file, each octree is separated from the previous one
    239 by a line containing three minus characters, i.e.\&
    240 .Li --- .
    241 .It Fl f
    242 Force overwriting of
    243 .Pa output
    244 file.
    245 .It Fl g Pa ground
    246 Ground geometry saved in
    247 .Xr htrdr-obj 5
    248 format.
    249 .It Fl h
    250 Display short help and exit.
    251 .It Fl i Ar image_opt Ns Op : Ns Ar image_opt No ...
    252 Configure sensor image.
    253 .Pp
    254 The image options are as follows:
    255 .Bl -tag -width Ds
    256 .It Cm def= Ns Ar width Ns x Ns Ar height
    257 Image definition.
    258 Default is
    259 @HTRDR_ARGS_DEFAULT_IMG_WIDTH@x@HTRDR_ARGS_DEFAULT_IMG_HEIGHT@.
    260 .It Cm spp= Ns Ar samples_per_pixel
    261 Number of samples to solve the Monte Carlo estimation of each pixel.
    262 In normal image rendering, a pixel will be estimated with
    263 .No 3\ *\  Ns Ar samples_per_pixel
    264 of Monte Carlo realisations, one set of
    265 .Ar samples_per_pixel
    266 for each X, Y and Z component of the CIE 1931 XYZ color space.
    267 In shortwave and longwave
    268 rendering or flux calculation, only one set of
    269 .Ar samples_per_pixel
    270 is used.
    271 By default,
    272 .Cm spp
    273 is set to @HTRDR_ARGS_DEFAULT_IMG_SPP@.
    274 .El
    275 .It Fl R
    276 Repeat the ground along the X and Y axes to infinity.
    277 .It Fl r
    278 Repeat the clouds along the X and Y axes to infinity.
    279 .It Fl M Pa materials
    280 Ground materials saved in
    281 .Xr htrdr-materials 5
    282 format.
    283 .It Fl m Pa mie
    284 Optical properties of water droplets saved in
    285 .Xr htmie 5
    286 format.
    287 .It Fl n Ar sky_mtl
    288 Name in the
    289 .Pa materials
    290 file representing the sky, i.e. the semi-transparent material.
    291 Default is @HTRDR_ATMOSPHERE_ARGS_DEFAULT_SKY_MTL_NAME@.
    292 .It Fl O Pa cache
    293 File where atmospheric acceleration structures are stored/loaded.
    294 If the
    295 .Pa cache
    296 file does not exist, it is created and filled with acceleration
    297 structures constructed from the clouds
    298 .Pq option Fl c ,
    299 atmosphere
    300 .Pq option Fl a
    301 and mie
    302 .Pq option Fl m
    303 input files.
    304 This cached data can then be reused in subsequent executions, provided
    305 that the input files supplied to the command are the same as those used
    306 to set up the cache, thus considerably speeding up the pre-processing
    307 stage.
    308 .Pp
    309 If
    310 .Pa cache
    311 contains data generated from input files that are not those submitted on
    312 the command line, an error is notified and execution is aborted, thus
    313 avoiding the use of bad cached data.
    314 .Pp
    315 Note that when the cache is used,
    316 .Nm
    317 ignores the options used to build acceleration structures
    318 .Pq options Fl T No and Fl V .
    319 .It Fl o Pa output
    320 Output file.
    321 If not defined, data is written to standard output.
    322 .It Fl P Ar ortho_camera_opt Ns Op : Ns Ar ortho_camera_opt No ...
    323 Set up an orthographic camera.
    324 .Pp
    325 The options for an orthographic camera are as follows:
    326 .Bl -tag -width Ds
    327 .It Cm height= Ns Ar lenght
    328 Image plane height.
    329 Its width is calculated from this length and the image ratio
    330 to guarantee square pixels
    331 .Pq see Fl i No option .
    332 .It Cm pos= Ns Ar x , Ns Ar y , Ns Ar z
    333 Camera position.
    334 Default is @HTRDR_ARGS_DEFAULT_CAMERA_POS@.
    335 .It Cm tgt= Ns Ar x , Ns Ar y , Ns Ar z
    336 Targeted position.
    337 Default is @HTRDR_ARGS_DEFAULT_CAMERA_TGT@.
    338 .It Cm up= Ns Ar x , Ns Ar y , Ns Ar z
    339 Upward vector that the top of the camera is pointing towards.
    340 Default is @HTRDR_ARGS_DEFAULT_CAMERA_UP@.
    341 .El
    342 .It Fl p Ar flux_sensor_opt Ns Op : Ns Ar flux_sensor_opt No ...
    343 Set up a flux sensor.
    344 The flux is computed for the part of the sensor that is outside any
    345 geometry.
    346 .Pp
    347 The flux sensor options are as follow:
    348 .Bl -tag -width Ds
    349 .It Cm pos= Ns Ar x , Ns Ar y , Ns Ar z
    350 Sensor center.
    351 Default is @HTRDR_ARGS_DEFAULT_RECTANGLE_POS@.
    352 .It Cm tgt= Ns Ar x , Ns Ar y , Ns Ar z
    353 Targeted position.
    354 Default is @HTRDR_ARGS_DEFAULT_RECTANGLE_TGT@.
    355 .It Cm up= Ns Ar x , Ns Ar y , Ns Ar z
    356 Upward vector that the top of the sensor is pointing towards.
    357 Default is  @HTRDR_ARGS_DEFAULT_RECTANGLE_UP@.
    358 .It Cm sz= Ns Ar width , Ns Ar height
    359 Sensor size in meters.
    360 Default is @HTRDR_ARGS_DEFAULT_RECTANGLE_SZ@.
    361 .El
    362 .It Fl s Ar spectral_opt Ns Op : Ns Ar spectral_opt No ...
    363 Configure spectral integration.
    364 .Pp
    365 The spectral integration options are as follows:
    366 .Bl -tag -width Ds
    367 .It Cm cie_xyz
    368 Calculate the radiance for the visible part of the spectrum between
    369 .Bq 380, 780
    370 nanometers using the XYZ CIE 1931 color matching functions.
    371 This is the default behavior.
    372 .It Cm lw= Ns Ar wlen_min , Ns Ar wlen_max
    373 Calculate the radiance using the internal source of radiation, i.e. the
    374 radiance emitted by the medium and its boundaries (ground and space).
    375 .Pp
    376 Calculations are performed between
    377 .Bq Ar wlen_min ,  Ar wlen_max
    378 nanometers according to Planck's function for a reference temperature.
    379 As the application mainly concerns the earth's atmosphere, internal
    380 radiation is emitted in the thermal, longwave part of the
    381 electromagnetic spectrum.
    382 Consequently, the default reference temperature is set at 290\ K.
    383 .Pp
    384 If
    385 .Ar wlen_min
    386 and
    387 .Ar wlen_max
    388 are equal, the calculation is monochromatic.
    389 .It Cm sw= Ns Ar wlen_min , Ns Ar wlen_max
    390 Calculate the radiance using the external source of radiance, i.e. the sun.
    391 .Pp
    392 Calculations are performed between
    393 .Bq Ar wlen_min ,  Ar wlen_max
    394 nanometers according to Planck's function for a reference temperature.
    395 As the application mainly concerns the earth's atmosphere, the default
    396 reference temperature is 5778\ K, i.e. the temperature of the sun's
    397 black body.
    398 .Pp
    399 If
    400 .Ar wlen_min
    401 and
    402 .Ar wlen_max
    403 are equal, the calculation is monochromatic.
    404 .It Cm Tref= Ns Ar temperature
    405 Reference temperature when integrating with respect to the Planck function.
    406 The default value is 290\ K or 5778\ K, depending on whether the
    407 radiation source is internal
    408 .Pq option Cm lw
    409 or external
    410 .Pq option Cm sw .
    411 .El
    412 .It Fl T Ar optical_thickness
    413 Optical thickness used as threshold criterion for building acceleration
    414 structures.
    415 Default is @HTRDR_ATMOSPHERE_ARGS_DEFAULT_OPTICAL_THICKNESS_THRESHOLD@.
    416 This option is ignored if a cache is used
    417 .Pq option Fl O .
    418 .It Fl t
    419 Advice on the number of threads to use.
    420 By default,
    421 .Nm
    422 uses many threads as processor cores.
    423 .It Fl V Ar x , Ns Ar y , Ns Ar z
    424 Maximum definition of acceleration structures.
    425 By default, the finest definition is that of clouds.
    426 This option is ignored if a cache is used
    427 .Pq option Fl O .
    428 .It Fl v
    429 Make
    430 .Nm
    431 verbose.
    432 .El
    433 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    434 .\" Output image
    435 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    436 .Sh OUTPUT IMAGE
    437 Images calculated by
    438 .Nm
    439 are saved in
    440 .Xr htrdr-image 5
    441 format.
    442 This section describes the nature and arrangement of image data
    443 depending on the type of calculation performed.
    444 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    445 .Ss XYZ image
    446 For an image rendering in the visible part of the spectrum
    447 .Pq default behavior or option Fl s Cm cie_xyz ,
    448 the pixel components store 4 estimates.
    449 The first, second, and third pairs of floating point values encode the
    450 estimated integrated radiance in W/sr/m^2 for the X, Y, and Z components
    451 of the CIE 1931 XYZ color space.
    452 The first value of each pair is the expected value of the
    453 average radiance of the pixel.
    454 The second value is its associated standard deviation.
    455 The fourth and final pair records the microsecond estimate of the
    456 computation time per radiative path and its standard error.
    457 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    458 .Ss Longwave image
    459 For infrared calculations
    460 .Pq option Fl s Cm lw= Ns Ar wlen_min , Ns Ar wlen_max
    461 the first and second pixel components store the expected value and the
    462 standard error of the estimated brightness temperature (in K),
    463 respectively.
    464 The third and fourth components record the expected value and the
    465 standard deviation of the pixel radiance which is either an integrated
    466 radiance in W/sr/m^2 or a spectral radiance in W/sr/m^2/nm depending on
    467 whether this radiance was calculated for a spectral range or at a single
    468 wavelength.
    469 The fifth and sixth pixel components are not used.
    470 Finally, the last 2 components of the pixel record the estimate in
    471 microseconds of the computation time per radiative path and its standard
    472 error.
    473 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    474 .Ss Shortwave image
    475 For shortwave calculations
    476 .Pq option Fl s Cm sw= Ns Ar wlen_min , Ns Ar wlen_max
    477 the output image is formatted as for a longwave image except that the
    478 first and second components of the pixels are not used, as no brightness
    479 temperature has been evaluated.
    480 .Ss Flux density map (shortwave and longwave)
    481 A flux density map
    482 .Pq option Fl p
    483 store on its first and second component
    484 the expected value and the standard error of the pixel radiative flux
    485 density
    486 .Pq in W/m^2 .
    487 All other components are unused excepted the seventh and eighth
    488 components that store the estimate of the radiative path computation
    489 time
    490 .Pq in microseconds
    491 and its standard error.
    492 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    493 .\" Returned status
    494 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    495 .Sh EXIT STATUS
    496 .Ex -std
    497 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    498 .\" Examples of use
    499 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    500 .Sh EXAMPLES
    501 Render a clear sky scene, i.e. a scene without any cloud, whose sun is at
    502 zenith.
    503 The vertical atmospheric gaz mixture along the Z axis is described in
    504 the
    505 .Pa gas.txt
    506 file.
    507 The ground geometry is a quad repeated to the infinity
    508 whose materials are listed in the
    509 .Pa material.mtl
    510 file.
    511 The camera is positioned at
    512 .Ar 400
    513 meters height and looks toward the positive Y axis.
    514 The definition of the rendered image is
    515 .Ar 800 No by Ar 600
    516 pixels and the radiance of each pixel component is estimated with
    517 .Ar 64
    518 Monte-Carlo realisations.
    519 The resulting image
    520 is written to
    521 .Pa output
    522 excepted if the file already exists; in this case an
    523 error is notified, the program stops and the
    524 .Pa output
    525 file remains unchanged:
    526 .Bd -literal -offset Ds
    527 htrdr-atmosphere -D 0,90 \\
    528                  -a gas.txt \\
    529                  -Rg quad.obj \\
    530                  -M materials.mtl \\
    531                  -C pos=0,0,400:tgt=0,1,0:up=0,0,1 \\
    532                  -i def=800x600:spp=64 \\
    533                  -o output
    534 .Ed
    535 .Pp
    536 Add clouds to the previous scene and use a more complex geometry to
    537 represent the ground; it has been carefully designed to be cyclical and
    538 can therefore be repeated ad infinitum without visual glitches.
    539 Use the
    540 .Fl f
    541 option to write the rendered
    542 image to
    543 .Pa output
    544 even though the file already exists.
    545 Use
    546 .Xr htpp 1
    547 to convert the output
    548 .Xr htrdr-image 5
    549 in a regular PPM image:
    550 .Bd -literal -offset Ds
    551 htrdr-atmosphere -D 0,90 \\
    552                  -a gas.txt \\
    553                  -Rg mountains.obj \\
    554                  -M materials.mtl \\
    555                  -c clouds.htcp \\
    556                  -m Mie.nc \\
    557                  -C pos=0,0,400:tgt=0,1,0:up=0,0,1 \\
    558                  -i def=800x600:spp=64 \\
    559                  -fo output
    560 htpp -o image.ppm output
    561 .Ed
    562 .Pp
    563 Render the previous scene in infrared for the wavelengths in
    564 .Bq Ar 9200 , Ar 10000
    565 nanometers with a reference temperature of
    566 .Ar 300
    567 Kelvin:
    568 .Bd -literal -offset Ds
    569 htrdr-atmosphere -a gas.txt \\
    570                  -Rg mountains.obj -R \\
    571                  -M materials.mtl \\
    572                  -c clouds.htcp \\
    573                  -m Mie.nc \\
    574                  -C pos=0,0,400:tgt=0,1,0:up=0,0,1 \\
    575                  -i def=800x600:spp=64 \\
    576                  -s lw=9200,10000:Tref=300 \\
    577                  -fo output
    578 .Ed
    579 .Pp
    580 Move the sun by setting its azimuthal and elevation angles to
    581 .Ar 120 No and Ar 40
    582 degrees respectively.
    583 Use the
    584 .Fl O
    585 option to enable the cache mechanism of acceleration structures.
    586 Increase the image definition to
    587 .Ar 1280 No by Ar 720
    588 pixels and set the number of samples per pixel component to
    589 .Ar 1024 :
    590 .Bd -literal -offset Ds
    591 htrdr-atmosphere -D 120,40 \\
    592                  -a gas.txt \\
    593                  -Rg mountains.obj \\
    594                  -M materials.mtl \\
    595                  -c clouds.htcp \\
    596                  -m Mie.nc \\
    597                  -O my_cache \\
    598                  -C pos=0,0,400:tgt=0,1,0:up=0,0,1 \\
    599                  -i def=1280x720:spp=1024 \\
    600                  -fo output
    601 .Ed
    602 .Pp
    603 Compute the downward flux for the shortwave interval
    604 .Bq Ar 350 , Ar 4000
    605 nanometers on a square of
    606 .Ar 100
    607 meters side positioned at the origin at
    608 .Ar 1
    609 meter height.
    610 The resolution of the flux map is
    611 .Ar 500 No by Ar 500
    612 pixels and
    613 .Ar 1000
    614 realisations is used to estimate the flux per pixel.
    615 It is saved in the
    616 .Pa flux_map.txt
    617 file even though this file already exists:
    618 .Bd -literal -offset Ds
    619 htrdr-atmosphere -D 0,90 \\
    620                  -a gas.txt \\
    621                  -Rg plane.obj \\
    622                  -M materials.mtl \\
    623                  -c clouds.htcp \\
    624                  -m Mie.nc \\
    625                  -O my_cache \\
    626                  -p pos=0,0,1:tgt=0,0,2:up=0,1,0:sz=100,100 \\
    627                  -i def=500x500:spp=1000 \\
    628                  -s sw=350,4000 \\
    629                  -fo flux_map.txt
    630 .Ed
    631 .Pp
    632 Write cloud acceleration structures as output.
    633 Use
    634 .Xr csplit 1
    635 to save each of them in a specific VTK file named
    636 .Pa octree Ns Ar ID ,
    637 .Ar ID
    638 being between
    639 .Bq 0, N-1
    640 and N being the total number of acceleration structures (N > 1):
    641 .Bd -literal -offset Ds
    642 htrdr-atmosphere -a gas.txt -m Mie.nc -c clouds.htcp -d -fo output
    643 N="$(grep -ce "^# vtk" output)"
    644 sed /^---$/d output \\
    645 | csplit -f octree -k - %^#\\ vtk% /^#\\ vtk/ {$((${N}-2))}
    646 .Ed
    647 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    648 .\" References
    649 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    650 .Sh SEE ALSO
    651 .Xr mpirun 1 ,
    652 .Xr htcp 5 ,
    653 .Xr htmie 5 ,
    654 .Xr htrdr-image 5 ,
    655 .Xr htrdr-materials 5 ,
    656 .Xr htrdr-obj 5
    657 .Rs
    658 .%A |Méso|Star>
    659 .%T High-Tune: gas optical properties file format
    660 .%D November 2018
    661 .%U https://www.meso-star.com/projects/htrdr/downloads/gas_opt_prop_en.pdf
    662 .Re
    663 .Rs
    664 .%A Najda Villefranque
    665 .%A Richard Fournier
    666 .%A Fleur Couvreux
    667 .%A Stéphane Blanco
    668 .%A Céline Cornet
    669 .%A Vincent Eymet
    670 .%A Vincent Forest
    671 .%A Jean-Marc Trégan
    672 .%T A Path-Tracing Monte Carlo library for 3-D Radiative Transfer in \
    673 Highly Resolved Cloudy Atmospheres
    674 .%J Journal of Advances in Modeling Earth Systems
    675 .%V 11
    676 .%N 8
    677 .%P 2449-2473
    678 .%D 2019
    679 .%U https://dx.doi.org/10.1029/2018MS001602
    680 .Re
    681 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    682 .\" Used and implemented standards
    683 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    684 .Sh STANDARDS
    685 .Rs
    686 .%A International Organization for Standardization / CIE
    687 .%R ISO/CIE 11664-1:2019
    688 .%D June 2019
    689 .%T Colorimetry - Part 1: CIE standard colorimetric observers
    690 .Re
    691 .Pp
    692 .Rs
    693 .%A OpenMP Architecture Review Board
    694 .%D March 2002
    695 .%T OpenMP C and C++ Application Interface
    696 .%O version 2.0
    697 .Re
    698 .Pp
    699 .Rs
    700 .%A Message Passing Interface Forum
    701 .%D July 1997
    702 .%T MPI-2: Extensions to The Message-Passing Interface
    703 .Re
    704 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    705 .\" Brief implementation history
    706 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    707 .Sh HISTORY
    708 .Nm
    709 has been initially developed as part of
    710 .Li ANR-16-CE01-0010
    711 High-Tune project.
    712 It was then extended in
    713 .Li MODEVAL-URBA 2019 .