|
| 1 | +/** @file geometryfunc.h |
| 2 | + * A collection of antenna-related geometry functions. |
| 3 | + */ |
| 4 | +#pragma once |
| 5 | + |
| 6 | +#include <isce3/core/forward.h> |
| 7 | + |
| 8 | +#include <tuple> |
| 9 | +#include <vector> |
| 10 | + |
| 11 | +#include <Eigen/Dense> |
| 12 | + |
| 13 | +#include <isce3/antenna/Frame.h> |
| 14 | +#include <isce3/core/Ellipsoid.h> |
| 15 | +#include <isce3/geometry/DEMInterpolator.h> |
| 16 | + |
| 17 | +/** @namespace isce3::antenna */ |
| 18 | +namespace isce3 { namespace antenna { |
| 19 | + |
| 20 | +// Antenna to Radar |
| 21 | + |
| 22 | +/** |
| 23 | + * Estimate Radar products, Slant range and Doppler centroid, from |
| 24 | + * spherical angles in antenna body-fixed domain for a certain spacecraft |
| 25 | + * position, velocity,and attitude at a certain height w.r.t. an ellipsoid. |
| 26 | + * @param[in] el_theta : either elevation or theta angle in radians |
| 27 | + * depending on the "frame" object. |
| 28 | + * @param[in] az_phi : either azimuth or phi angle in radians depending |
| 29 | + * on the "frame" object. |
| 30 | + * @param[in] pos_ecef : antenna/spacecraft position in ECEF (m,m,m) |
| 31 | + * @param[in] vel_ecef : spacecraft velocity in ECEF (m/s,m/s,m/s) |
| 32 | + * @param[in] quat : isce3 quaternion object for transformation from antenna |
| 33 | + * body-fixed to ECEF |
| 34 | + * @param[in] wavelength : Radar wavelength in (m). |
| 35 | + * @param[in] dem_interp (optional): isce3 DEMInterpolator object |
| 36 | + * w.r.t ellipsoid. Default is zero height. |
| 37 | + * @param[in] abs_tol (optional): Abs error/tolerance in height estimation (m) |
| 38 | + * between desired input height and final output height. Default is 0.5. |
| 39 | + * @param[in] max_iter (optional): Max number of iterations in height |
| 40 | + * estimation. Default is 10. |
| 41 | + * @param[in] frame (optional): isce3 Frame object to define antenna spherical |
| 42 | + * coordinate system. Default is based on "EL_AND_AZ" spherical grid. |
| 43 | + * @param[in] ellips (optional): isce3 Ellipsoid object defining the |
| 44 | + * ellipsoidal planet. Default is WGS84 ellipsoid. |
| 45 | + * @return slantrange (m) |
| 46 | + * @return Doppler (Hz) |
| 47 | + * @return a bool which is true if height tolerance is met, false otherwise. |
| 48 | + * @exception InvalidArgument, RuntimeError |
| 49 | + * @cite ReeTechDesDoc |
| 50 | + */ |
| 51 | + |
| 52 | +std::tuple<double, double, bool> ant2rgdop(double el_theta, double az_phi, |
| 53 | + const isce3::core::Vec3& pos_ecef, const isce3::core::Vec3& vel_ecef, |
| 54 | + const isce3::core::Quaternion& quat, double wavelength, |
| 55 | + const isce3::geometry::DEMInterpolator& dem_interp = {}, |
| 56 | + double abs_tol = 0.5, int max_iter = 10, |
| 57 | + const isce3::antenna::Frame& frame = {}, |
| 58 | + const isce3::core::Ellipsoid& ellips = {}); |
| 59 | + |
| 60 | +/** |
| 61 | + * Overloaded function to estimate Radar products, Slant ranges and Doppler |
| 62 | + * centroids, from spherical angles in antenna body-fixed domain for a |
| 63 | + * certain spacecraft position, velocity,and attitude at a certain height |
| 64 | + * w.r.t. an ellipsoid. |
| 65 | + * @param[in] el_theta : a vector of either elevation or theta angle in |
| 66 | + * radians depending on the "frame" object. |
| 67 | + * @param[in] az_phi : either azimuth or phi angle in radians depending |
| 68 | + * on the "frame" object. |
| 69 | + * @param[in] pos_ecef : antenna/spacecraft position in ECEF (m,m,m) |
| 70 | + * @param[in] vel_ecef : spacecraft velocity in ECEF (m/s,m/s,m/s) |
| 71 | + * @param[in] quat : isce3 quaternion object for transformation from antenna |
| 72 | + * body-fixed to ECEF |
| 73 | + * @param[in] wavelength : Radar wavelength in (m). |
| 74 | + * @param[in] dem_interp (optional): isce3 DEMInterpolator object |
| 75 | + * w.r.t ellipsoid. Default is zero height. |
| 76 | + * @param[in] abs_tol (optional): Abs error/tolerance in height estimation (m) |
| 77 | + * between desired input height and final output height. Default is 0.5. |
| 78 | + * @param[in] max_iter (optional): Max number of iterations in height |
| 79 | + * estimation. Default is 10. |
| 80 | + * @param[in] frame (optional): isce3 Frame object to define antenna spherical |
| 81 | + * coordinate system. Default is based on "EL_AND_AZ" spherical grid. |
| 82 | + * @param[in] ellips (optional): isce3 Ellipsoid object defining the |
| 83 | + * ellipsoidal planet. Default is WGS84 ellipsoid. |
| 84 | + * @return an Eigen::VectorXd of slant ranges (m) |
| 85 | + * @return an Eigen::VectorXd of Doppler values (Hz) |
| 86 | + * @return a bool which is true if height tolerance is met, false otherwise. |
| 87 | + * @exception InvalidArgument, RuntimeError |
| 88 | + * @cite ReeTechDesDoc |
| 89 | + */ |
| 90 | +std::tuple<Eigen::VectorXd, Eigen::VectorXd, bool> ant2rgdop( |
| 91 | + const Eigen::Ref<const Eigen::VectorXd>& el_theta, double az_phi, |
| 92 | + const isce3::core::Vec3& pos_ecef, const isce3::core::Vec3& vel_ecef, |
| 93 | + const isce3::core::Quaternion& quat, double wavelength, |
| 94 | + const isce3::geometry::DEMInterpolator& dem_interp = {}, |
| 95 | + double abs_tol = 0.5, int max_iter = 10, |
| 96 | + const isce3::antenna::Frame& frame = {}, |
| 97 | + const isce3::core::Ellipsoid& ellips = {}); |
| 98 | + |
| 99 | +// Antenna to Geometry |
| 100 | + |
| 101 | +/** |
| 102 | + * Estimate geodetic geolocation (longitude, latitude, height) from |
| 103 | + * spherical angles in antenna body-fixed domain for a certain spacecraft |
| 104 | + * position and attitude at a certain height w.r.t. an ellipsoid. |
| 105 | + * @param[in] el_theta : either elevation or theta angle in radians |
| 106 | + * depending on the "frame" object. |
| 107 | + * @param[in] az_phi : either azimuth or phi angle in radians depending |
| 108 | + * on the "frame" object. |
| 109 | + * @param[in] pos_ecef : antenna/spacecraft position in ECEF (m,m,m) |
| 110 | + * @param[in] quat : isce3 quaternion object for transformation from antenna |
| 111 | + * body-fixed to ECEF |
| 112 | + * @param[in] dem_interp (optional): isce3 DEMInterpolator object |
| 113 | + * w.r.t ellipsoid. Default is zero height. |
| 114 | + * @param[in] abs_tol (optional): Abs error/tolerance in height estimation (m) |
| 115 | + * between desired input height and final output height. Default is 0.5. |
| 116 | + * @param[in] max_iter (optional): Max number of iterations in height |
| 117 | + * estimation. Default is 10. |
| 118 | + * @param[in] frame (optional): isce3 Frame object to define antenna spherical |
| 119 | + * coordinate system. Default is based on "EL_AND_AZ" spherical grid. |
| 120 | + * @param[in] ellips (optional): isce3 Ellipsoid object defining the |
| 121 | + * ellipsoidal planet. Default is WGS84 ellipsoid. |
| 122 | + * @return an isce3::core::Vec3 of geodetic LLH(longitude,latitude,height) |
| 123 | + * in (rad,rad,m) |
| 124 | + * @return a bool which is true if height tolerance is met, false otherwise. |
| 125 | + * @exception InvalidArgument, RuntimeError |
| 126 | + * @cite ReeTechDesDoc |
| 127 | + */ |
| 128 | +std::tuple<isce3::core::Vec3, bool> ant2geo(double el_theta, double az_phi, |
| 129 | + const isce3::core::Vec3& pos_ecef, const isce3::core::Quaternion& quat, |
| 130 | + const isce3::geometry::DEMInterpolator& dem_interp = {}, |
| 131 | + double abs_tol = 0.5, int max_iter = 10, |
| 132 | + const isce3::antenna::Frame& frame = {}, |
| 133 | + const isce3::core::Ellipsoid& ellips = {}); |
| 134 | + |
| 135 | +/** |
| 136 | + * Overloaded function to estimate geodetic geolocation |
| 137 | + * (longitude, latitude, height) from spherical angles in antenna |
| 138 | + * body-fixed domain for a certain spacecraft position and attitude |
| 139 | + * at a certain height w.r.t. an ellipsoid. |
| 140 | + * @param[in] el_theta : a vector of either elevation or theta angle |
| 141 | + * in radians depending on the "frame" object. |
| 142 | + * @param[in] az_phi : either azimuth or phi angle in radians depending |
| 143 | + * on the "frame" object. |
| 144 | + * @param[in] pos_ecef : antenna/spacecraft position in ECEF (m,m,m) |
| 145 | + * @param[in] quat : isce3 quaternion object for transformation from antenna |
| 146 | + * body-fixed to ECEF |
| 147 | + * @param[in] dem_interp (optional): isce3 DEMInterpolator object |
| 148 | + * w.r.t ellipsoid. Default is zero height. |
| 149 | + * @param[in] abs_tol (optional): Abs error/tolerance in height estimation (m) |
| 150 | + * between desired input height and final output height. Default is 0.5. |
| 151 | + * @param[in] max_iter (optional): Max number of iterations in height |
| 152 | + * estimation. Default is 10. |
| 153 | + * @param[in] frame (optional): isce3 Frame object to define antenna spherical |
| 154 | + * coordinate system. Default is based on "EL_AND_AZ" spherical grid. |
| 155 | + * @param[in] ellips (optional): isce3 Ellipsoid object defining the |
| 156 | + * ellipsoidal planet. Default is WGS84 ellipsoid. |
| 157 | + * @return a vector of isce3::core::Vec3 of geodetic |
| 158 | + * LLH(longitude,latitude,height) in (rad,rad,m) |
| 159 | + * @return a bool which is true if height tolerance is met, false otherwise. |
| 160 | + * @exception InvalidArgument, RuntimeError |
| 161 | + * @cite ReeTechDesDoc |
| 162 | + */ |
| 163 | +std::tuple<std::vector<isce3::core::Vec3>, bool> ant2geo( |
| 164 | + const Eigen::Ref<const Eigen::VectorXd>& el_theta, double az_phi, |
| 165 | + const isce3::core::Vec3& pos_ecef, const isce3::core::Quaternion& quat, |
| 166 | + const isce3::geometry::DEMInterpolator& dem_interp = {}, |
| 167 | + double abs_tol = 0.5, int max_iter = 10, |
| 168 | + const isce3::antenna::Frame& frame = {}, |
| 169 | + const isce3::core::Ellipsoid& ellips = {}); |
| 170 | + |
| 171 | +}} // namespace isce3::antenna |
0 commit comments