基于RD模型的坐标转换
i,j,h->lat,lon
通过指定的斜距 和轨道位置矢量 , 计算出其对应的大地坐标 ,
代码涉及点和向量信息如下图所示,
代码实现
/// class llh{
/// double longitude, latitude, height;
/// xyz to_xyz(); // 转换到空间直角坐标系
/// //...
/// };
/// class xyz{
/// double x, y, z;
/// double norm(); // 取模
/// xyz cross(xyz sec); //外积, 叉乘
/// xyz operator-(xyz sec); //向量相减
/// xyz operator+(xyz sec); //向量相加
/// double operator*(xyz sec); //内积, 点乘
/// xyz operator*(double m); // 向量乘常数
/// llh to_llh(); // 转换到经纬度
/// //...
/// };
llh parameter_sar::get_target_loc(double az_row, double sr_col, double alt)
{
double C = 299792458; //光速
double rho = this->get_slant_range(sr_col); //计算斜距
double fc = radar_frequency;
int s_flag = (look_direction == Look_Diredction::right)?-1:1; //左右视
double state_t = this->get_azimuth_time(az_row); //根据简单比例关系估计方位向时间 state_t = az_start + azTimeSpacing * az_row
double fd = 0;
if (!azimuth_deskew) {
fd = get_fd(state_t, rho); // 计算多普勒频移
}
xyz s = this->get_state_pos(state_t );
xyz v = this->get_state_velo(state_t );
llh dst;
double a, b, c, r, r1, lam;
double s2, v2, t2, sv, det;
double lat1, lon1, alt1, c1, c2, c3;
double r_new;
xyz q, t;
int iter;
lam = C / fc;
s2 = s * s;
v2 = v * v;
sv = v * s;
llh temp = s.to_llh();
lon1 = temp.longitude;
lat1 = temp.latitude;
alt1 = temp.height;
r = sqrt(s2) - alt1;
t = s.cross(v);
t2 = t * t;
iter = 0;
while (iter < 17 )
{
iter++;
a = (s2 + SQR(r + alt) - SQR(rho)) / 2.0;
b = (lam * rho * fd + 2.0 * sv) / 2.0;
c = SQR(r + alt);
det = s2 * v2 - SQR(sv);
c1 = (a * v2 - b * sv) / det;
c2 = (b * s2 - a * sv) / det;
c3 = double(s_flag) * sqrt((c - pow(c1,2) * s2 - pow(c2,2) * v2 - 2.0 * c1 * c2 * sv)/t2);
/* radius vector to image point is q = c1*s + c2*v + c3*t */
q = s * c1 + v *c2 + t * c3;
llh temp2 = q.to_llh();
lon1 = temp2.longitude;
lat1 = temp2.latitude;
alt1 = temp2.height;
r1 = q.norm(); /* includes surface altitude of alt1, earth radius=r1-alt1 */
r_new = r1 - alt1;
if (fabs(r_new - r) < .001)
break;
r = r_new;
}
dst.latitude = lat1;
dst.longitude = lon1;
dst.height = alt;
return dst;
}
以无误差值推算公式
代码中的a
和b
和det
可以进一步推导得到:
这里将 等效为 ,但实际上两者存在一定误差,下一节在讨论该问题。
分别带入 和 ,得到: