SatDump 2.0.0-alpha-76a915210
Loading...
Searching...
No Matches
ref_rad_to_sun_cor_ref_rad.h
Go to the documentation of this file.
1#pragma once
2
6
8#include <exception>
9
10namespace satdump
11{
12 namespace calibration
13 {
14 namespace conv
15 {
27 {
28 public:
29 double convert(const UnitConverter *c, double x, double y, double val)
30 {
31 if (val == CALIBRATION_INVALID_VALUE)
32 return val; // Special case
33
34 geodetic::geodetic_coords_t pos;
35 double timestamp = -1;
36 if (((UnitConverter *)c)->proj.inverse(x, y, pos, &timestamp, false))
37 return CALIBRATION_INVALID_VALUE;
38
39 if (timestamp == -1)
40 return CALIBRATION_INVALID_VALUE;
41
42 return compensate_radiance_for_sun(val, timestamp, pos.lat, pos.lon);
43 }
44
45 bool convert_range(const UnitConverter *, double &, double &) { return true; }
46 };
47 } // namespace conv
48 } // namespace calibration
49} // 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
Reflective Radiance to Sun Corrected Reflective Radiance converter.
Definition ref_rad_to_sun_cor_ref_rad.h:27
double convert(const UnitConverter *c, double x, double y, double val)
Core function (for images!) implementing conversion between calibration unit types.
Definition ref_rad_to_sun_cor_ref_rad.h:29
bool convert_range(const UnitConverter *, double &, double &)
Convert unit ranges. This does the same as convert, except it's optimized for converting a range.
Definition ref_rad_to_sun_cor_ref_rad.h:45