8. Using MCARaTS

Next / Return

Examples in the package

Radiation budget applications

Input files: conf_hr0213 and conf_hr1100.

These are flux and heating rate calculation examples for two wavelengths, 2130 nm and 11000 nm. Spatial distribution of cloud water density for stratocumulus cloud scene was taken from a large eddy simulation. Rayleigh scattering and typical aerosol vertical profile are assumed. Surface reflection is represented by Lambertian model. Simulations are performed for two solar zenith angles (SZAs). Fluxes at top and bottom of the atmosphere and 3-D heating rates are computed.

For these cases, important variables in the namelists are listed as follows:

Wld_mtarget = 1 ! target mode (1=flux&HR, 2=radiance, 3=volume rendering)

Src_nsrc = 2 ! two SZAs

Flx_mflx = 1 ! fluxes at TOA and BOA

Flx_mhrt = 1 ! 3D heating rates

Sfc_mtype = 1 ! Lambertian

Src_the = 180.0, 120.0 ! zenith angles of the source transport directions

Results are shown below.

Case

2130 nm, SZA = 0

2130 nm, SZA = 60

11000 nm

Direct-beam flux

Downward flux

Heating rate and fluxes

-

Remote sensing applications

Input files: conf_rs0067 and conf_rs0213.

These are radiance calculation examples for two wavelengths, 670 nm and 2130 nm. The atmosphere is synthesized as the radiation budget examples. Surface reflection is represented by RPV BRDF model. Simulations are performed for two solar zenith angles (SZAs) at the near-infrared wavelength. Normalized nadir radiances and layer air mass factors are computed.

For these cases, important variables in the namelists are listed as follows:

Wld_mtarget = 2 ! target mode (1=flux&HR, 2=radiance, 3=volume rendering)

Src_nsrc = 2 ! two SZAs

Rad_mrkind = 2 ! 2nd kind of radiance

Rad_mplen = 1 ! LAMFs are calculated

Rad_nrad = 1 ! one radiance direction

Sfc_mtype = 3 ! RPV BRDF

Src_the = 180.0, 120.0 ! zenith angles of the source transport directions

Rad_the = 180.0 ! nadir looking

Rad_zloc = 1.0e+5 ! from space

Results are shown below.

Wavelength

670

2130

670

2130

SZA = 0

SZA = 60|

Visualization applications

Input files: conf_ci0045,conf_ci0055, conf_ci0067

These are visualization examples for theree wavelengths, 450 nm, 550 nm, and 670 nm. The atmosphere is synthesized as the radiation budget examples. Surface reflection is represented by DSM BRDF model. Simulations are performed for one solar zenith angle (SZA). Normalized quasi-radiances are computed by the rendering method 4, the highest-quality method. Two images are generated. One view point is near the surface, and another is at slightly above the cloud bottom altitude. Wide field-of view camera is assumed.

For these cases, important variables in the namelists are listed as follows:

Wld_mtarget = 3 ! target mode (1=flux&HR, 2=radiance, 3=volume rendering)

Src_nsrc = 1 ! one SZA

Rad_mrkind = 1 ! the 1st kind of radiance

Rad_mpmap = 1 ! rectangular pixel mapping

Rad_nrad = 2 ! two radiance images

Rad_nxr = 400 ! # of pixels - U

Rad_nyr = 300 ! # of pixels - V

Vis_mrend = 4 ! RTE-based rendering with TMS correction

Sfc_mtype = 2 ! DSM BRDF

Src_the = 120.0 ! zenith angle of incident beam transport direction

Rad_xpos = 5*0.45

Rad_ypos = 5*0.5

Rad_zloc = 95, 305 ! altitudes of view points

Rad_the = 75, 90 ! zenith angles of the FOV center directions

Rad_phi = 0, 0 ! azimuth angles of the FOV center directions

Rad_psi = 5*90 ! image rotation around the FOV center

Rad_umax = 5*140 ! FOV U size

Rad_vmax = 5*110 ! FOV V size

Rad_qmax = 5*180.0

Generated data can be converted to gray scale images, using a utility code bin_gray. Then, using some ImageMagick tools, true color images can be generated. An example shell script, ./examples/job_colorimg.csh, is available as a solution:

#!/bin/csh -f

## To generate color images from binary (GrADS compatible) data files

# Arguments

if ($#argv < 6) then

echo "$0 blue.ctl green.ctl red.ctl outfileHead pwr rmax (timeLag timeWid fmax)"

exit 2

endif

set imgc=./$argv[4]

set pwr=$argv[5]

set rmax=$argv[6]

# User variables

set fcol=(1.28 1.0 0.8) # color balance

# System variables

set bin_exposure=../bin/bin_exposure

set bin_gray=../bin/bin_gray

set tmp0=./$$.tmp.0

set imgs=(./$$.tmp_img_B ./$$.tmp_img_G ./$$.tmp_img_R)

set imgt=./$$.tmp_img.tif

# Gray images

if ($rmax == 0) then # automatic exposure

echo $bin_exposure $argv[7] $argv[8] $argv[9] $argv[5] $argv[1] $argv[2] $argv[3]

$bin_exposure $argv[7] $argv[8] $argv[9] $argv[5] $argv[1] $argv[2] $argv[3] > $tmp0

foreach c(1 2 3)

$bin_gray $fcol[$c] $rmax $pwr $argv[$c] $imgs[$c] < $tmp0

end

else # manual exposure

foreach c(1 2 3)

$bin_gray $fcol[$c] $rmax $pwr $argv[$c] $imgs[$c]

end

endif

set nx=(`grep XDEF $argv[1] | awk '{print $2}'`)

set ny=(`grep YDEF $argv[1] | awk '{print $2}'`)

set nz=(`grep ZDEF $argv[1] | awk '{print $2}'`)

set nt=(`grep TDEF $argv[1] | awk '{print $2}'`)

set nv=(`grep VARS $argv[1] | awk '{print $2}'`)

# Color images

@ t = 1

while($t <= $nt)

if ($t <= 9) then

set tstr="000"$t

else if ($t <= 99) then

set tstr="00"$t

else if ($t <= 999) then

set tstr="0"$t

else

set tstr=$t

endif

@ v = 1

while($v <= $nv)

@ z = 1

while($z <= $nz)

if ( -r $imgs[1]"_t"$t"_var"$v"_z"$z".gray" ) then

set str="_t"$t"_var"$v"_z"$z

set str1="_t"$tstr"_var"$v"_z"$z

set pwr1=$pwr

@ ntry = 0

while($ntry < 30) # loop for trials

#// This is because the gray image file is sometimes broken.

set err=0

foreach c(1 2 3)

convert -depth 8 -size $nx"x"$ny+0 $imgs[$c]$str".gray" $imgs[$c]$str".png"

if ($status != 0) then

set err=1

echo Error: $imgs[$c]$str".gray" "with pwr1="$pwr1

endif

end

if ($err == 0) then # success

set ntry=1000000

else # error, then retry

set pwr1=`echo $pwr1"*1.00333" | bc`

foreach c(1 2 3)

if ($rmax == 0) then # automatic exposure

$bin_gray $fcol[$c] $rmax $pwr1 $argv[$c] $imgs[$c] $z $v $t < $tmp0

else # manual exposure

$bin_gray $fcol[$c] $rmax $pwr1 $argv[$c] $imgs[$c] $z $v $t

endif

end

endif

@ ntry = $ntry + 1

end

composite -compose CopyGreen $imgs[2]$str".png" $imgs[3]$str".png" $imgt

composite -compose CopyBlue $imgs[1]$str".png" $imgt $imgc$str1".tif"

echo $imgc$str1".tif" : complete

rm -f $imgs[1]$str* $imgs[2]$str* $imgs[3]$str* $imgt

endif

@ z = $z + 1

end

@ v = $v + 1

end

@ t = $t + 1

end

rm -f $tmp0

An example of usage:

./job_colorimg.csh out_ci0045.ctl out_ci0055.ctl out_ci0067.ctl img_ci 0.6 0 0 1 2

Color images in TIFF format will be generated. They can be viewed by, for example, display command (an ImageMagick tool).

Result color images are shown below.

z=95

near surface

z=305

near cloud bottom

Photorealistic visualization of 3-D cloud scene

As shown above, MCARaTS can be used as a visualization tool. We can virtually observe 3-D cloud field from various view points. By modifying the atmospheric and surface properties in the example cases, various images can be generated as follows.

Total sky imager simulation

Upward, near surface

Downward, above cloud

Sunset scenes

SH

32

18

9

5

3

z=455

z=755

z=3055

z=9050

z=28050

Aerosol effects

Images were obtained by increasing and decreasing aerosol density by a factor of 3.

Aerosol*(1/3)

Aerosol*1

Aerosol*3

Radiance mapping

For Rad_mrkind = 1 or 3, one of two angular-pixel mapping methods can be chosen. A target mode Wld_mtarget can be 2 or 3. Image axes U and V are differently defined for the two methods.

The following two examples both show hemispherical distribution of radiance looking a cloud deck from ground.

Rad_mpmap=1

Rectangular

2

Polar

Pathlength analyses

Column air mass factors (CAMFs)

Can be calculated for each radiance pixel. Weighting functions for CAMFs can be specified by the user. In the following example, the weighting function was uniform within the entire atmosphere. We can see a negative correlation between radiance and CAMF, implying that the pathlength becomes longer at cloud gaps.

In more practical applications, the weighting function should correspond to some gas profile (e.g., O2 or O4) of interest.

Radiance

CAMF

Radiance histogram wrt total pathlength

Can be calculated for each radiance pixel. The total pathlength is calculated as a sum of all photon flight paths, from radiation source to the detector. The total pathlength bins are specified by the user, with minimum and maximum values and the number of bins. This provides a time-resolved histogram, so that lidar signals can be simulated with localized radiative source, for example.

The following figure is plotted for a section at y=30, with solar radiative source.