SatDump 2.0.0-alpha-76a915210
|
The image product expression system is specifically used to generate (more or less complex) RGB composites from an ImageProduct.
An expression is split into 2 parts, one of them optional. The first part is the actual pixel expression, where you can express the desired output value for each channel via a mathematical expression based on the raw channel values. Possible combinations are summarized in this table :
Expression | Output |
---|---|
ch1 | Grayscale |
ch1, ch2 | Grayscale Alpha |
ch1, ch2, ch3 | RGB |
ch1, ch2, ch3, ch4 | RGB Alpha |
The only variables available by default are raw channel values, named chCHNAME, with CHNAME being the instrument channel name, as displayed in the explorer under "Channels" (eg, Channel 3a becomes ch3a).
Those channel variables will be scaled from 0 to 1, with 0 being the minimum possible pixel value, and 1 the maximum. The expected output range is the same.
In many situations it will be desirable to utilize more than just raw instrument channels. To this effect, it is possible to define many other types of variables.
Those definitions must be present in the expression because pixel values, and separated by ; instead of a normal coma. For example :
This allows getting calibrated channels values as a variable.
If CALIBRATION_UNIT is set to equalized, this will return the raw channel equalized (useful to stretch it on uncalibrated instruments for example).
This lets you loading and utilizing a Look-Up Table in the expression.
The lut can then be used as follow in an expression :
Example to generate RGB with a LUT from a single channel :
Loads an equirectangular image (such as a NASA Blue Marble) and (given the instrument has projection information) will return its pixel value so it can be used just like any other channel.
Example to generate a RGB "MCIR" composite :
Since some equations can become relatively complex, this allows having a simple concept of macros to simplify them. Do note that macros cannot be nested!
For several instruments, channels are not actually aligned with one or the other, or may be of different resolutions. SatDump will automatically deal with this.
The output alignment and size will be dictated by the first channel found in the equation. Therefore ch2, ch2, ch1 will lead to ch2 being used as the output size/offset, while ch1 * 0 + ch2, ch2, ch1 will generate the same output but using ch1 as an output reference. This behaviour can be overwritten by explicitely specifying ref_channel=1 if necessary. Do note said channel must be part of the expression still.
A lot of composites are common between several instruments, and re-writing them for each can be cumbersome. Instead, it is possible to automatically select a channel by specifying a wavelength or frequency.
Using {10.4um} will select the channel closest to 10.4um in the loaded instrument, and effectively will be getting replaced by 4 or whatever the actual channel number is. If you had ch{10.4um}, this would become ch4.
This works the same with calibrated channels :