SatDump 2.0.0-alpha-76a915210
Loading...
Searching...
No Matches
sun_angle.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 {
24 public:
25 double convert(const UnitConverter *c, double x, double y, double val)
26 {
27 if (!((UnitConverter *)c)->proj_valid)
28 return CALIBRATION_INVALID_VALUE;
29
30 geodetic::geodetic_coords_t pos;
31 double timestamp = -1;
32 if (((UnitConverter *)c)->proj.inverse(x, y, pos, &timestamp, false))
33 return CALIBRATION_INVALID_VALUE;
34
35 if (timestamp == -1)
36 return CALIBRATION_INVALID_VALUE;
37
38 return get_sun_angle(timestamp, pos.lat, pos.lon);
39 }
40
41 bool convert_range(const UnitConverter *c, double &min, double &max)
42 {
43 min = 0;
44 max = 90;
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
Sun angle converter.
Definition sun_angle.h:23
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 sun_angle.h:41
double convert(const UnitConverter *c, double x, double y, double val)
Core function (for images!) implementing conversion between calibration unit types.
Definition sun_angle.h:25