4 double el_theta,
double az_phi)
const
8 case SphGridType::EL_AND_AZ: {
9 double theta {std::sqrt(el_theta * el_theta + az_phi * az_phi)};
10 double phi {std::atan2(az_phi, el_theta)};
11 double sin_theta {std::sin(theta)};
12 vec << sin_theta * std::cos(phi), sin_theta * std::sin(phi),
17 case SphGridType::EL_OVER_AZ: {
18 double cos_az {std::cos(az_phi)};
19 vec << std::sin(el_theta) * cos_az, std::sin(az_phi),
20 std::cos(el_theta) * cos_az;
24 case SphGridType::AZ_OVER_EL: {
25 double cos_el {std::cos(el_theta)};
26 vec << std::sin(el_theta), cos_el * std::sin(az_phi),
27 cos_el * std::cos(az_phi);
31 case SphGridType::THETA_PHI: {
32 double sin_el {std::sin(el_theta)};
33 vec << sin_el * std::cos(az_phi), sin_el * std::sin(az_phi),
38 throw isce3::except::RuntimeError(
39 ISCE_SRCINFO(),
"Unknown Spherical Grid Type!");
43 const std::vector<double>& el_theta,
44 const std::vector<double>& az_phi)
const
46 auto size {el_theta.size()};
47 if (size != az_phi.size())
48 throw isce3::except::LengthError(
49 ISCE_SRCINFO(),
"Size mismatch between two angle containers!");
50 std::vector<Vec3_t> vec;
52 for (
decltype(size) idx = 0; idx < size; ++idx)
53 vec.push_back(
sphToCart(el_theta[idx], az_phi[idx]));
84 case SphGridType::EL_AND_AZ:
86 theta = std::acos(vec(2));
87 phi = std::atan2(vec(1), vec(0));
88 v_elaz << theta * std::cos(phi), theta * std::sin(phi);
91 case SphGridType::EL_OVER_AZ:
92 v_elaz << std::atan2(vec(0), vec(2)), std::asin(vec(1));
95 case SphGridType::AZ_OVER_EL:
96 v_elaz << std::asin(vec(0)), std::atan2(vec(1), vec(2));
99 case SphGridType::THETA_PHI:
100 v_elaz << std::acos(vec(2)), std::atan2(vec(1), vec(0));
103 throw isce3::except::RuntimeError(
104 ISCE_SRCINFO(),
"Unknown Spherical Grid Type!");