isce3 0.25.0
Loading...
Searching...
No Matches
RadarGeometry.icc
1#include <limits>
2
3#include <isce3/except/Error.h>
4
5namespace isce3 { namespace cuda { namespace container {
6
7namespace detail {
8
9template<typename To, typename From>
10constexpr bool checkOverflow(From x)
11{
12 return x > static_cast<From>(std::numeric_limits<To>::max());
13}
14
15} // namespace detail
16
17inline RadarGeometry::RadarGeometry(const RadarGridParameters& radar_grid,
18 const DeviceOrbit& orbit,
19 const DeviceLUT2d<double>& doppler)
20 : _radar_grid(radar_grid), _orbit(orbit), _doppler(doppler)
21{
22 if (_radar_grid.refEpoch() != _orbit.referenceEpoch()) {
23 auto old_refepoch = _radar_grid.refEpoch();
24 auto new_refepoch = _orbit.referenceEpoch();
25
26 auto old_sensing_start = _radar_grid.sensingStart();
27 auto dt = (old_refepoch - new_refepoch).getTotalSeconds();
28 auto new_sensing_start = old_sensing_start + dt;
29
30 _radar_grid.refEpoch(new_refepoch);
31 _radar_grid.sensingStart(new_sensing_start);
32 }
33}
34
36{
37 auto t0 = radarGrid().sensingStart();
38 auto dt = radarGrid().azimuthTimeInterval();
39 auto lines = gridLength();
40
41 if (detail::checkOverflow<int>(lines)) {
42 throw isce3::except::OverflowError(ISCE_SRCINFO(),
43 "grid length exceeds max int");
44 }
45
46 return {t0, dt, static_cast<int>(lines)};
47}
48
50{
51 auto r0 = radarGrid().startingRange();
52 auto dr = radarGrid().rangePixelSpacing();
53 auto samples = gridWidth();
54
55 if (detail::checkOverflow<int>(samples)) {
56 throw isce3::except::OverflowError(ISCE_SRCINFO(),
57 "grid width exceeds max int");
58 }
59
60 return {r0, dr, static_cast<int>(samples)};
61}
62
63}}} // namespace isce3::cuda::container
A uniformly-spaced sequence of values over some interval.
Definition Linspace.h:9
RadarGeometry(const RadarGridParameters &radar_grid, const DeviceOrbit &orbit, const DeviceLUT2d< double > &doppler)
Construct a new RadarGeometry object.
Definition RadarGeometry.icc:17
Linspace< double > sensingTime() const
Get radar grid azimuth time samples relative to reference epoch (s)
Definition RadarGeometry.icc:35
const RadarGridParameters & radarGrid() const
Get radar grid.
Definition RadarGeometry.h:50
const DeviceOrbit & orbit() const
Get orbit.
Definition RadarGeometry.h:53
size_t gridWidth() const
Get radar grid width (number of range samples)
Definition RadarGeometry.h:65
const DeviceLUT2d< double > & doppler() const
Get Doppler.
Definition RadarGeometry.h:56
Linspace< double > slantRange() const
Get radar grid slant range samples (m)
Definition RadarGeometry.icc:49
size_t gridLength() const
Get radar grid length (number of azimuth lines)
Definition RadarGeometry.h:62
double sensingStart() const
Get sensing start time in seconds since reference epoch.
Definition RadarGridParameters.h:78
double startingRange() const
Get starting slant range in meters.
Definition RadarGridParameters.h:99
double rangePixelSpacing() const
Get slant range pixel spacing in meters.
Definition RadarGridParameters.h:105
double azimuthTimeInterval() const
Get azimuth time interval in seconds.
Definition RadarGridParameters.h:96
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5

Generated for ISCE3.0 by doxygen 1.13.2.