SatDump 2.0.0-alpha-76a915210
Loading...
Searching...
No Matches
em_rad_to_bright_temp.h
Go to the documentation of this file.
1#pragma once
2
6
8
9namespace satdump
10{
11 namespace calibration
12 {
13 namespace conv
14 {
23 class EmRadToBrightTempConverter : public ConverterBase
24 {
25 private:
26 const bool celsius = false;
27
28 public:
29 EmRadToBrightTempConverter(bool celsius) : celsius(celsius) {}
30
31 double convert(const UnitConverter *c, double x, double y, double val)
32 {
33 if (val == CALIBRATION_INVALID_VALUE)
34 return val; // Special case
35
36 if (c->wavenumber == -1)
37 return CALIBRATION_INVALID_VALUE;
38 return radiance_to_temperature(val, c->wavenumber) - (celsius ? 273.15 : 0.0);
39 }
40
41 bool convert_range(const UnitConverter *c, double &min, double &max)
42 {
43 min = convert(c, 0, 0, min);
44 max = convert(c, 0, 0, max);
45 return true;
46 }
47 };
48 } // namespace conv
49 } // namespace calibration
50} // namespace satdump
Base class for unit converters. This is meant to implement conversions between calibration unit types...
Definition calibration_converter.h:26
Universal UnitConverter class, handling all conversion logic between any calibration unit type to ano...
Definition calibration_converter.h:115
double convert(const UnitConverter *c, double x, double y, double val)
Core function (for images!) implementing conversion between calibration unit types.
Definition em_rad_to_bright_temp.h:31
bool convert_range(const UnitConverter *c, double &min, double &max)
Convert unit ranges. This does the same as convert, except it's optimized for converting a range.
Definition em_rad_to_bright_temp.h:41