方位角和高度角
This commit is contained in:
@@ -78,7 +78,7 @@ func (r *Registrator) SceneImageTime(scene *Scene) (start, center, end time.Time
|
||||
}
|
||||
|
||||
// FIXME: This function is not accurate enough. 四元数、成像时刻、GPS 等需要修改为插值获取
|
||||
func (r *Registrator) SetSceneBoundary(scene *Scene) (topLeft, bottomRight orb.Point) {
|
||||
func (r *Registrator) ComputeMetaAndRPC(scene *Scene) (topLeft, bottomRight orb.Point) {
|
||||
log.Info("using attitude quaternion to calculate image boundary...")
|
||||
line0Start := r.calculateLatLonH(scene, 0, 0, 0)
|
||||
line0End := r.calculateLatLonH(scene, 0, scene.Width, 0)
|
||||
@@ -94,12 +94,6 @@ func (r *Registrator) SetSceneBoundary(scene *Scene) (topLeft, bottomRight orb.P
|
||||
yResolution := H0 / float64(scene.Height)
|
||||
scene.Meta.Gsd = math.Min(xResolution, yResolution)
|
||||
|
||||
// FIXME: 临时设置分辨率
|
||||
if scene.Meta.Gsd < 2 {
|
||||
scene.Meta.Gsd = 1.3
|
||||
} else {
|
||||
scene.Meta.Gsd = 5.2
|
||||
}
|
||||
log.Debug("resolution x: ", xResolution)
|
||||
log.Debug("resolution y: ", yResolution)
|
||||
scene.Meta.Gsd = math.Max(xResolution, yResolution)
|
||||
|
||||
@@ -168,7 +168,7 @@ func (r *Registrator) OutputL1A(panScenes []*Scene, mssScenes []*Scene) error {
|
||||
filename := fmt.Sprintf("%s_L1A.tiff", scene.SceneId)
|
||||
scene.Tiff = filepath.Join(dir, filename)
|
||||
scene.Meta = r.makeProductMeta(scene)
|
||||
r.SetSceneBoundary(scene)
|
||||
r.ComputeMetaAndRPC(scene)
|
||||
|
||||
err := utils.SavePanToGDALGTiff(scene.Mat[0],
|
||||
scene.Meta.Corners.UpperLeft.Longitude,
|
||||
@@ -215,7 +215,7 @@ func (r *Registrator) OutputL1A(panScenes []*Scene, mssScenes []*Scene) error {
|
||||
filename := fmt.Sprintf("%s_L1A.tiff", scene.SceneId)
|
||||
scene.Tiff = filepath.Join(dir, filename)
|
||||
scene.Meta = r.makeProductMeta(scene)
|
||||
r.SetSceneBoundary(scene)
|
||||
r.ComputeMetaAndRPC(scene)
|
||||
|
||||
rgbirImage, _ := r.MergeMSSToBGRNIR(scene.Mat)
|
||||
defer rgbirImage.Close()
|
||||
|
||||
Reference in New Issue
Block a user