This commit is contained in:
nuknal
2024-09-10 15:17:59 +08:00
parent 2fcbc389c6
commit e44bd318ae
5 changed files with 6 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ rpc:
grid_size: 3
altitude_layer: 5
altitude_range: 1000
method: 2 # 1-最小二乘法 2-NelderMead
dem:
dem_1km: "dem/gdlebm.tif"

View File

@@ -16,7 +16,7 @@ const (
MSSPixels = float64(payload.MSS_PIXEL_WIDTH)
MSSCellSize = 12.8 // µm
CameraRoll = -0.010 // 相机与卫星本体X轴的安装角度, degree FIXME: 安装矩阵应该由卫星方提供
CameraPitch = 0.183 // 相机与卫星本体Y轴的安装角度, degree
CameraPitch = 0.213 // 相机与卫星本体Y轴的安装角度, degree
CameraYaw = 0.012 // 相机与卫星本体Z轴的安装角度, degree
)

View File

@@ -57,6 +57,7 @@ type RPCConfig struct {
GridSize int `yaml:"grid_size" mapstructure:"grid_size"`
AltitudeRange int `yaml:"altitude_range" mapstructure:"altitude_range"`
AltitudeLayer int `yaml:"altitude_layer" mapstructure:"altitude_layer"`
Method int `yaml:"method" mapstructure:"method"`
}
var GCONFIG Config
@@ -105,6 +106,7 @@ func init() {
GridSize: 3,
AltitudeRange: 1000,
AltitudeLayer: 5,
Method: 2,
},
}
}

View File

@@ -161,7 +161,7 @@ func (rpc *RPC) RPC() error {
rowVec, colVec, latVec, lonVec, heightVec)
// 设计矩阵 B = [ 20个分子系数 19个分母系数 ] W = 权矩阵 R = 观测结果
method := SolveMethodNelderMead
method := SolveMethod(config.GCONFIG.RPC.Method)
// x = (B^T * W^2 * B)^-1 * (B^T * W^2 * R), 其中 x = [a1..a20 b2..b20]^T
// 行参数

View File

@@ -18,8 +18,8 @@ type SolveMethod int
const (
SolveMethodOptimize SolveMethod = iota
SolveMethodNelderMead
SolveMethodLeastSquare
SolveMethodNelderMead
)
const epsilon = 1e-4