aux platform

This commit is contained in:
nuknal
2024-05-16 10:14:32 +08:00
parent 6a22735d78
commit 7e4efd83a1
8 changed files with 140 additions and 20 deletions

View File

@@ -4,6 +4,7 @@ import (
"encoding/binary"
"fmt"
"os"
"time"
"github.com/sirupsen/logrus"
)
@@ -13,8 +14,8 @@ const AuxPlatformFrmSize = 512 // 512 bytes
// 中心机辅助数据 512 字节 (每 16 行原始图像数据为一组)
type AuxPlatform struct {
// 结构中标注的字节序号从 1 开始计数
UTCTimeSec uint32 // [1-4] 卫星 UTC 时间戳(秒
Waveway uint8 // [5] 波道
UTCTimeSec uint32 // [1-4] 卫星 UTC 时间戳(秒
Waveway uint8 // [5] 波道 0x00波道1241.0~311.00x01波道2241.1~311.1
Microsecond uint32 // [6-8]卫星秒小数(微秒)
QuatAttstarQ0 float64 // [9-12]定姿四元数(J2000) 的 Q0 值,量纲 1/0x40000000
QuatAttstarQ1 float64 // [13-16]Q1 值
@@ -147,12 +148,14 @@ func (ap *AuxPlatform) Parse(data []byte) error {
func (ap AuxPlatform) Print() {
fmt.Println("--- aux frm ----")
fmt.Printf("UTCTimeSec: %d\n", ap.UTCTimeSec)
fmt.Println(time.Unix(int64(ap.UTCTimeSec), 0).String())
fmt.Printf("Microsecond: %d\n", ap.Microsecond)
fmt.Printf("DataTransLong: %f\n", ap.DataTransLong)
fmt.Printf("DataTransLat: %f\n", ap.DataTransLat)
fmt.Printf("DataTransH: %f\n", ap.DataTransH)
fmt.Println("--- ss1 ---")
fmt.Printf("SS1_UTCTime: %d\n", ap.SS1_UTCTime)
fmt.Println(time.Unix(int64(ap.SS1_UTCTime+uint32(ReferenceTime2000)), 0).String())
fmt.Printf("SS1_UTCTimeFrac: %f\n", ap.SS1_UTCTimeFrac)
fmt.Printf("SS1_ImgFrmNo: %d\n", ap.SS1_ImgFrmNo)
fmt.Println("--- ss2 ---")
@@ -188,3 +191,8 @@ func (e *Extractor) ParseAuxPlatform(auxfile string) ([]*AuxPlatform, error) {
}
return aps, nil
}
func Time2000UTCSec() int64 {
t, _ := time.ParseInLocation("2006-01-02 15:04:05", "2000-01-01 12:00:00", time.UTC)
return t.Unix()
}