Thunderstorm Visualization

This notebook makes use of a data file in HDF format.

*NOTE*: The datafile is currently not available, but the following notebook describes how the graphics were generated from the dataset described.

SetDirectory[
        ToFileName[("FileName" /. 
                NotebookInformation[
                  EvaluationNotebook[]])[[1]]]];

Given an HDF file, you can obtain a list of all of the data subsets using the DatasetSelection ConversionOptioan as follows.

Import["may20b_h03600.hdf", 
      ConversionOptions -> {"DatasetSelection" -> 
            Information}]

Some important variables are:

• cloud rain water (QR)
• cloud liquid water/ice (QC)
• cloud water vapor (QV)
• cloud ice (QI)
• cloud snow (QS)
• cloud graupel/hail (QH)
• the perturbation potential temperature (TH)
• perturbation pressure (P)
• Diagnostic Mixing (KM)
• the east-west component of the wind (m/s) (U)
• the north-south component of the wind (m/s) (V)
• the vertical component of the wind (m/s) (W)

For this example, we will arbitrarily make use of only one dataset, the KM dataset.  The following code imports only this dataset.

\(\(km = 
        Import["may20b_h03600.hdf", 
          ConversionOptions -> {"DatasetSelection" -> "KM"}];\)\)

The imported data is stored in a structure that can be visualized as a stack of contour data. Here, we perform a ListContourPlot on 4 specific layers and apply a ColorFunction.

cloud1 = 
        ListContourPlot[km[[1]], ImageSize -> 600, 
          ColorFunction -> (Hue[ .8 -  .8 #] &), 
          Frame -> False];

cloud2 = 
        ListContourPlot[km[[6]], ImageSize -> 600, 
          ColorFunction -> (Hue[ .8 -  .8 #] &), 
          Frame -> False];

cloud3 = 
        ListContourPlot[km[[31]], ImageSize -> 600, 
          ColorFunction -> (Hue[ .8 -  .8 #] &), 
          Frame -> False];

cloud4 = 
        ListContourPlot[km[[46]], ImageSize -> 600, 
          ColorFunction -> (Hue[ .8 -  .8 #] &), 
          Frame -> False];

ListContourPlot returns a 2D plot.  To convert the graphics into 3D graphics, we need to apply several transformation rules.

1) The original ContourGraphics objects are converted into 2D Graphics objects.
2) 2D coordinates are represented as pairs of real numbers which must be transformed into triples of real numbers.  The z-values are chosen arbitrarily.
3) Hue color directives are transformed into SurfaceColor directives so that 3D lighting can be applied.

Show[
        Graphics3D[{EdgeForm[
              Black], (Graphics[cloud1][[1]] /. {x_Real, 
                      y_Real} -> {x, y, 1}) /. 
              Hue[c_] -> SurfaceColor[Hue[c]]}], 
        Graphics3D[{EdgeForm[
              Black], (Graphics[cloud2][[1]] /. {x_Real, 
                      y_Real} -> {x, y, 15}) /. 
              Hue[c_] -> SurfaceColor[Hue[c]]}], 
        Graphics3D[{EdgeForm[
              Black], (Graphics[cloud3][[1]] /. {x_Real, 
                      y_Real} -> {x, y, 30}) /. 
              Hue[c_] -> SurfaceColor[Hue[c]]}], 
        Graphics3D[{EdgeForm[
              Black], (Graphics[cloud4][[1]] /. {x_Real, 
                      y_Real} -> {x, y, 45}) /. 
              Hue[c_] -> SurfaceColor[Hue[c]]}], ImageSize -> 600, 
        Background -> Black, Boxed -> False, 
        ViewPoint -> {-1, 1,  .5}, 
        LightSources -> {{{1, 1, 1}, White}}];