Universal UnitConverter class, handling all conversion logic between any calibration unit type to another.
More...
#include <calibration_converter.h>
|
| UnitConverter () |
| Simple constructor.
|
| UnitConverter (void *product, std::string channel_name) |
| Setup from an ImageProduct.
|
void | set_proj (nlohmann::json p) |
| Sets the projection to utilize for conversion if needed. This is optional, but some conversions will fail if not present. If available, this should be set.
|
void | set_wavenumber (double w) |
| Sets the wavenumber to utilize for conversion if needed. This is optional, but some conversions will fail if not present. If available, this should be set.
|
void | set_conversion (std::string itype, std::string otype) |
| Sets the conversion this UnitConverter should perform.
|
double | convert (double x, double y, double val) |
| Generic conversion function mostly aimed at converting data from images (TODOREWORK?).
|
bool | convert_range (double &min, double &max) |
| Convert unit ranges. This does the same as convert, except it's optimized for a range.
|
Universal UnitConverter class, handling all conversion logic between any calibration unit type to another.
This will automatically setup a conversion if available with the right backend ConverterBase depending on what metadata is available.
◆ UnitConverter()
satdump::calibration::UnitConverter::UnitConverter |
( |
void * | product, |
|
|
std::string | channel_name ) |
Setup from an ImageProduct.
- Parameters
-
product | ImageProduct |
channel_name | name ID of the channel to use |
◆ convert()
double satdump::calibration::UnitConverter::convert |
( |
double | x, |
|
|
double | y, |
|
|
double | val ) |
|
inline |
Generic conversion function mostly aimed at converting data from images (TODOREWORK?).
- Parameters
-
x | position in image |
y | position in image |
val | input value |
- Returns
- converted value, or CALIBRATION_INVALID_VALUE on error
◆ convert_range()
bool satdump::calibration::UnitConverter::convert_range |
( |
double & | min, |
|
|
double & | max ) |
|
inline |
Convert unit ranges. This does the same as convert, except it's optimized for a range.
- Parameters
-
min | min of the range |
max | max of the range |
- Returns
- true if the convertion was done
◆ set_conversion()
void satdump::calibration::UnitConverter::set_conversion |
( |
std::string | itype, |
|
|
std::string | otype ) |
Sets the conversion this UnitConverter should perform.
- Parameters
-
itype | input type ID |
otype | output type ID |
◆ set_proj()
void satdump::calibration::UnitConverter::set_proj |
( |
nlohmann::json | p | ) |
|
Sets the projection to utilize for conversion if needed. This is optional, but some conversions will fail if not present. If available, this should be set.
This may also be needed to obtain timestamps, if not just projection information.
The documentation for this class was generated from the following files: