Keywords: thermal, dynamic maps

Summary

This demo shows how to use a raster image to define the temperature of an object. In addition to including a static scenario (temperatures that do not vary with time) this demo includes a dynamic scenario where the temperatures vary with time using a series of raster images.

Details

Like many of the other map types available in DIRSIG, a temperature map leverages a raster image file to drive a material property. In this case, that property is the temperature. The user can drive the temperature using either a floating-point image (single- or double-precision with an ENVI header) that specifies the absolute temperature (in Celsius) directly or as an 8-bit image (as a TIFF, JPEG, PNG, etc.) with a gain and bias to scale the values into degrees Celsius. This example uses 8-bit PNG image files to define the temperatures.

This demo contains two separate simulation configurations:

  • A static simulation using a single raster image, which results in temperatures that are constant with time.

  • A dynamic simulation using multiple raster images, which results in temperatures that vary with time.

Important Files

The scene in this demo is composed of a box placed on a background. The flat background is assigned material ID #1 and it is configured to use the THERM temperature solver. In contrast, the box is assigned material ID #2 and the temperature will be driven by a raster image map.

Material Setup

Although temperature maps can be defined in the scene file, a temperature map is actually a specialized Temperature Solver and the preferred method for configuring it is via the material file. The entry for the box material (ID = 2) from the demo/static.mat material file is shown below:

MATERIAL_ENTRY {
    ID           = 2
    NAME         = Box
    EDITOR_COLOR = 0, 1, 0

    TEMP_SOLVER_NAME = Map
    TEMP_SOLVER {
        IMAGE_FILENAME = hot_spot.png
        DRAPE_PROJECTOR {
            INSERT_POINT = -5, -5, 0
            GSD = 0.10
            ORIGIN = IMAGE
            FLIPX = FALSE
            FLIPY = FALSE
            EXTENDX = MIRROR
            EXTENDY = MIRROR
        }
        OPTIONS {
            GAIN = 0.1
            BIAS = 40
        }
    }
    RAD_SOLVER_NAME = Classic
    RAD_SOLVER {
        ENABLE_SAMPLED_DIFFUSE = FALSE
    }
    SURFACE_PROPERTIES {
        EMISSIVITY_PROP_NAME = ClassicEmissivity
        EMISSIVITY_PROP {
            FILENAME          = black.ems
            SPECULAR_FRACTION = 0.0
        }
    }
    DOUBLE_SIDED = FALSE
}

The key to the configuration is the Map keyword assigned to the TEMP_SOLVER_NAME, which indicates we want to use the temperature map solver. The corresponding TEMP_SOLVER section contains the configuration of the map including the raster image filename (see the IMAGE_FILENAME variable), the image projection information (see the DRAPE_PROJECTION section) and the options to scale the raster image pixel values with a gain and bias (see the OPTIONS section).

Note
The default GAIN and BIAS are 1 and 0, respectively.

The box in the scene is 10 x 10 x 10 meters and centered at the scene origin (0,0). The drape projector is setup to project the 100 x 100 pixel raster images onto that box using a GSD of 0.1 (which scales the images to 100 * 0.1 = 10 meters) and an offset of -5,-5 meters (which moves the image origin to the lower-left corner of the box’s top surface).

Static Scenario

The static scenario is defined by the temperature map configuration in the materials/static.mat file. In this case, the IMAGE_FILENAME variable is assigned the name of an 8-bit, PNG raster image file and the supplied gain and bias options scale those temperatures into degrees Celsius:

    TEMP_SOLVER_NAME = Map
    TEMP_SOLVER {
        IMAGE_FILENAME = hot_spot.png
        DRAPE_PROJECTOR {
            ...
        }
        OPTIONS {
            GAIN = 0.1
            BIAS = 40
        }
    }

The single 8-bit PNG image used is shown below. The peak digital count (DC) in the image is 250, which corresponds to a temperature of (250 * 0.1) + 40 = 65 C.

The single 8-bit PNG image used to drive the static simulation.

maps/hot_spot.png

Dynamic Scenario

The dynamic scenario is defined by the temperature map configuration in the materials/dynamic.mat file. The key difference is passing the IMAGE_FILENAME variable the name of a temporal image list (TIL) file:

    TEMP_SOLVER_NAME = Map
    TEMP_SOLVER {
        IMAGE_FILENAME = hot_spot.til
        DRAPE_PROJECTOR {
            ..
        }
        OPTIONS {
            GAIN = 0.1
            BIAS = 40
        }
    }
Important
The .til file extension is specifically reserved for these temporal image list files. Failure to use this extension will result in the code trying to find the appropriate image file reader instead of treating it as TIL.

The contents of the maps/hot_spot.til file specify a series of image files to be used as a function of time:

0.0 hot_spot_000.png
1.0 hot_spot_020.png
2.0 hot_spot_040.png
3.0 hot_spot_060.png
4.0 hot_spot_080.png
5.0 hot_spot_100.png

The first column is time (in seconds) since the simulation reference time. The second column is the name of the image file to be used. This series of files will be used in the following manner:

  • Any times before the first time will use the first file.

  • Any times after the last time will use the last file.

  • The first file is used until the time corresponding to the second tile is reached. There is no temporal interpolation of the image data.

In this simulation, the six image files have a simple "hot spot" that slowly increases in magnitude. Note that the same gain and bias values are used for all the images in the temporal image list.

The six 8-bit PNG images used to drive the dynamic simulation.

maps/hot_spot_000.png maps/hot_spot_020.png maps/hot_spot_040.png maps/hot_spot_060.png maps/hot_spot_080.png maps/hot_spot_100.png

Setup

Static (single-frame) Simulation

To run the static, single-frame simulation, perform the following steps:

  1. Run the DIRSIG demo.sim file

  2. Load the resulting demo-t0000-c0000.img file in the image viewer.

Dynamic (multi-frame) Simulation

To run the dynamic, multi-frame simulation, perform the following steps:

  1. Run the DIRSIG video.sim file

  2. Load the resulting demo-t0000-c0000.img, demo-t0000-c0001.img, etc. files in the image viewer.

This simulated collection spans 6 seconds, which is the entire duration of the temporal map sequence.

Results

Static (single-frame) Simulation

The static, single-frame simulation produces a single image frame.

images/demo.png
Figure 1. Output of the single-frame (static map) simulation.

Dynamic (multi-frame) Simulation

The imaging instrument is setup to use the "file per capture" output schedule. As a result, the simulation produces 6 separate image files for the 6 captures. The animation below was created from these 6 frames.

images/video.gif
Figure 2. Animation of the multi-frame (dynamic map) simulation.