Keywords:
Summary
This demo shows how to use the linear and non-linear gain models available with the data-driven focal plane array feature. The 2D array sensor looks at a scene containing 5 panels spanning a range of reflectances. The upper half of the array is assigned a linear gain model. The lower half of the array is assigned a non-linear gain model that maps the brightness of the two darkest and two brightest panels to the same value. Beyond the basic linear and non-linear effects shown here these gain models can be used to create transfer functions that convert the radiometric units normally output by the model into integer digital counts. Such transfer functions can account for the optical throughput of the optical system, the quantum efficency of the detectors, on-chip amplification, off-chip amplification, etc.
Note
|
This demo employs configuration manipulation that is not supported by the graphical user interface. |
Details
This demo includes two simulation scenarios. Both use the data-driven focal plane (array) mechanism to specify the location and response characeteristics of each pixel via an ASCII/Text file. Each line in the pixel database file describes a single pixel in the array, including it’s geometric properties (viewing direction and solid angle) and radiometric properties (spectral response, gain response, etc.). Although this example defines a uniform 320 x 240 2D array, the primary use of this data-driven array mechanism is for describing:
-
irregular arrays such as modular arrays commonly used in pushbroom instruments, or
-
regular arrays that pass through optics with specific/unique distortion
A pixel record in the pixel database file requires a minimum of 5 fields:
-
The X angle in radians,
-
The Y angle in radians,
-
The X IFOV in steradians,
-
The Y IFOV in steradians, and
-
The channel index.
The pixel description can also include a number of user-defined fields at the start of each line record and an optional gain model index at the end of the record.
Important Files
This section highlights key files important to the simulation.
The Scene
The scene is composed of a gray background onto which 5 panels of various reflectance have been placed.
Material | Description |
---|---|
Background |
2% Reflective Lambertian |
Panel #1 |
4% Reflective Lambertian |
Panel #2 |
8% Reflective Lambertian |
Panel #3 |
12% Reflective Lambertian |
Panel #4 |
16% Reflective Lambertian |
Panel #5 |
18% Reflective Lambertian |
Pixel Database
An excerpt of the pixel database file used in this demo (see
pixels.dat
) is shown below. The file was created by a simple C++
program (see pixels.cpp
). As was noted earlier, the array is a simple
2D array that is 320 x 240 pixels. The pixel angles are computed using
a simple geometric model based on the pixel size (pitch) and a focal
length.
0 0 -0.0639128 -0.0479632 0.0004 0.0004 0 0
1 0 -0.0635145 -0.0479632 0.0004 0.0004 0 0
2 0 -0.0631161 -0.0479632 0.0004 0.0004 0 0
...
[lines deleted for documentation purposes]
...
317 239 0.0627176 0.0475641 0.0004 0.0004 0 1
318 239 0.0631161 0.0475641 0.0004 0.0004 0 1
319 239 0.0635145 0.0475641 0.0004 0.0004 0 1
The data-driven array mechanism allows the user to include a number
of user-defined fields at the start of each record. These fields
can be used for external record keeping, record filtering, etc.
Each line in this example includes 2 optional (user-defined) fields
that indicate the XY index (coordinate) of the pixel in the 2D
array. The inclusion of two optional fields is indicated by setting
the fieldcount
element to 2
. The next 5 fields are the required
fields. In this focal plane, there is only one channel defined so
the 5th element (the channel index) is always 0
. The final field
is the gain model index. This demo includes a pair of gain model
setups, so this final field has a value of 0
or 1
. In this
demo, the top half of the array uses one gain model and the lower
half uses the other.
Platform File
The detector array
The <detectorarray>
description is where the data-driven array setup
begins. Rather than supplying the parametric array dimensions (e.g.
<xelementsize>
, <xelementspacing>
, etc.), the array element contains
the name of the pixel database file and some other optional elements:
<detectorarray spatialunits="microns">
<clock type="independent" temporalunits="hertz">
<rate>1000</rate>
</clock>
<filename>pixels.dat</filename>
<fieldcount>2</fieldcount>
<selectorlist/>
<xelementcount>320</xelementcount>
<yelementcount>240</yelementcount>
</detectorarray>
The <filename>
element specifies the name of the pixel database
file. The <fieldcount>
specifies the number of optional
(user-defined) fields at the start of each pixel record (see
discussion above). The <selectorlist>
allows a regular-expression
to be supplied that can select only certain pixel records.
Note
|
As a reminder the data-driven array mechanism does not assume a 2D
array layout. In fact most uses of this mechanism are for modular
array setups. The <xelementcount> and <yelementcount> elements
are only used to populate the corresponding XY dimensions of the
output. In this demo, we happen to be modeling a 2D array and have
set the array size (element counts) to reflect those dimensions. |
The gain response
The <gainresponse>
element in the corresponding focal plane
contains one or more <gainmodel>
elements, which correspond to the two
gain models indexed in the pixel records. Each gain model has a type
attribute that indicates the type of model described:
-
The linear gain model applies a single gain and bias to map all the input values to output values.
-
The non-linear gain model uses a look-up table (LUT) approach to map the input values to output values.
Note
|
The linear model provides an easy way to create "dead" pixels by having a gain model with zero gain assigned to those pixels. |
The pixel database file indexes one of two gain models that must be described in the corresponding platform file. This demo includes two platform files that differ only in the gain response descriptions:
-
The
wo_gain.platform
file has two linear gain models, with the gain and bias set to1
and0
, respectively. -
The
w_gain.platform
file has a linear gain and non-linear gain model. The respective gain models map the expected radiances to values that fall within the normal 8-bit (0 - 255) range.
Below is the <gainresponse>
for the wo_gain.platform
file. Note that
the gain of 1
effectively acts as a "pass through" for the radiance to
the output image file:
<gainresponse>
<gainmodel type="linear">
<gain>1.0</gain>
<bias>0.0</bias>
</gainmodel>
<gainmodel type="linear">
<gain>1.0</gain>
<bias>0.0</bias>
</gainmodel>
</gainresponse>
Below is the <gainresponse>
for the w_gain.platform
file. The linear
gain model used with the upper half of the array uses a scale that maps
the radiance from the brightest panel (panel #5) to the maximum 8-bit value
of 255. The non-linear gain setup describes a linear gain region that
spans the middle 3 panels (panels #2, #3 and #4) and
<gainresponse>
<gainmodel type="linear">
<gain>3.52e+04</gain>
<bias>-8.72</bias>
</gainmodel>
<gainmodel type="nonlinear">
<entry>
<input>3.464e-03</input>
<output>113.0</output>
</entry>
<entry>
<input>5.196e-03</input>
<output>170.0</output>
</entry>
<entry>
<input>6.927e-03</input>
<output>255.0</output>
</entry>
</lut>
</gainmodel>
</gainresponse>
The table below summarizes the unscaled (w/o gain) radiances and the resulting scaled (w/ gain) values using the linear and non-linear gain models. Note that the non-linear case maps all input radiances lower than the first LUT entry and all input radiances greater than the last LUT entry to the corresponding output value for the respective entry.
Material | Radiance | Linear | Non-Linear |
---|---|---|---|
Background |
8.659e-04 |
28.3 |
113.0 |
Panel #1 |
1.732e-04 |
56.6 |
113.0 |
Panel #2 |
3.464e-03 |
113.3 |
113.0 |
Panel #3 |
5.196e-03 |
170.0 |
170.0 |
Panel #4 |
6.927e-03 |
226.6 |
255.0 |
Panel #5 |
7.272e-03 |
254.9 |
255.0 |
Setup
This section includes any step-by-step instructions for running and
visualizing the simulations. There are two simulations: unscaled
(w/o gain) and scaled (w/ gain) that have corresponding platform
files (wo_gain.platform
and w_gain.platform
) and simulation
files (wo_gain.sim
and w_gain.sim
).
To run eith simulation, perform the following steps:
-
Run the DIRSIG corresponding
.sim
file -
Load the resulting
demo.img
radiance file in the image viewer.
Results
The image below is the result of the wo_gain.sim
, which results in
conventional DIRSIG radiance image.

The image below is the result of the w_gain.sim
, which results in
an output image that has values scaled to 0 → 255 and which features
unique scaling models for the upper and lower half of the focal plane.
