SatDump 2.0.0-alpha-76a915210
Loading...
Searching...
No Matches
satdump::calibration::UnitConverter Class Reference

Universal UnitConverter class, handling all conversion logic between any calibration unit type to another. More...

#include <calibration_converter.h>

Public Member Functions

 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.

Public Attributes

projection::Projection proj
bool proj_valid = false
double wavenumber = -1

Detailed Description

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.

Constructor & Destructor Documentation

◆ UnitConverter()

satdump::calibration::UnitConverter::UnitConverter ( void * product,
std::string channel_name )

Setup from an ImageProduct.

Parameters
productImageProduct
channel_namename ID of the channel to use

Member Function Documentation

◆ 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
xposition in image
yposition in image
valinput 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
minmin of the range
maxmax 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
itypeinput type ID
otypeoutput 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: