User Tools


teaching:radiative_transfer:runit

Running libRadtran

See also: http://www.libradtran.org/doku.php?id=basic_usage and http://www.libradtran.org/doku.php?id=faq

To run an input file and write the output into a file do:

  uvspec < input_file.inp > output_file.out

If irradiances are calculated, the standard output includes the following columns:

  1. wavelength (lambda)
  2. direct irradiance (edir)
  3. diffuse downwelling irradiance (edn)
  4. diffuse upwelling irradiance (eup)
  5. direct contribution to mean intensity (uavgdir)
  6. diffuse downward contribution to mean intensity (uavgdn)
  7. diffuse upward contribution to mean intensity (uavgup)

If you are only interested in irradiances you may use the option

  output_user lambda edir edn eup

which gives you only the 4 columns that you need.

Radiances are calculated if the umu and phi are specified, e.g.

  umu -1 -0.886 -0.5       # viewing zenith angle
  phi 0 45 90 135 180      # viewing azimuth angle

The output format then looks as follows:

   lambda edir edn eup uavgdir uavgdn uavgup
                    phi(0)      ...           phi(m)
   umu(0) u0u(umu(0)) uu(umu(0),phi(0)) ... uu(umu(0),phi(m))
   umu(1) u0u(umu(1)) uu(umu(1),phi(0)) ... uu(umu(1),phi(m))
   ...          ...         ...            ...    ...  
   umu(n) u0u(umu(n)) uu(umu(n),phi(0)) ... uu(umu(n),phi(m))

Here u0u is the azimuthal averaged radiance (0th Fourier mode of radiance field) and uu are the radiances (I(mu, phi)).

In order to read the radiances in phython the easiest is to cut off the two first lines, which can be done on the shell as follows

 uvspec < input_file.inp | gawk 'NR>2' > output_file.out

The output file is piped into gawk, which writes only lines with line number (NR) greater than 2.

teaching/radiative_transfer/runit.txt · Last modified: 2018/05/04 08:40 (external edit)