microproduct-s-sar/Ortho/test/DeLevelingEffect.py

47 lines
1.6 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

''' 去地平效应功能代码
因为去地平效应是需要像元的成像时间作为的输入参数量因此需要原始影像的SLC作为输出项或者原始的SLC中保留了影像的成像时刻。
作为模型约定:
1.模型的输入需要已经经过了正射校正否则没有办法与已有的DEM进行匹配。
2.开发示例使用的高分三号注意高分三号的正射模型为rpc因此需要需要计算的对应的时间。
'''
import os
import numpy as np
# import gdal
import math
class DeLevelingEffect:
''' 去地平效应
计算公式:
Phi=(4*pi/lambda_)*(r1-r2)
lambda_ 波长
pi=3.14159265358979323846264338327950288
r1:主
r2:辅
'''
def LevelingEffect(lamda_,r1,r2,pi=3.14159265358979323846264338327950288):
'''计算地平效应的相位
agrs:
lamda_: double, 波长
r1:shape nx1 ,主影像的斜距
r2:shape nx1 ,辅影像的斜距
pi:double,圆周率
return
Phi:shape nx1
'''
Phi=(4*pi/lamda_)*(r1-r2)
return Phi
def CalSlantDistance(Rs_Salatellite,Rs_SeaLevel):
'''计算斜率
agrs:
Rs_Salatellite:nx3 x,y,z 地面对应时刻的 卫星位置和速度
Rs_SeaLevel:nx3 x,y,z 地面的坐标
return:
SlantDistance:nx1 斜距
'''
SlantDistance=np.sqrt(np.sum((Rs_Salatellite-Rs_SeaLevel)**2,axis=1)).reshape(-1,1)
return SlantDistance
# 根据根据卫星轨道数据,构建合适的影像信息
pass