get raw data

This commit is contained in:
nuknal
2024-05-17 21:46:38 +08:00
parent 58acd444d6
commit 0d59c8514b
11 changed files with 365 additions and 47 deletions

View File

@@ -17,16 +17,17 @@ var extractCmd = &cobra.Command{
Long: `Extract data from raw data files`,
Run: func(cmd *cobra.Command, args []string) {
params := extract.Params{
InputData: fmt.Sprintf("demo/%s.dat", dataId),
InputData: fmt.Sprintf("demo/data/%s.dat", dataId),
OutputPath: "demo/output",
TempPath: "demo/temp",
DataId: dataId,
Satellite: "SJY01",
}
p := extract.NewExtractor(&params)
p.ExtractAosData()
dats, _ := p.ExtractOriginalImageData()
for _, d := range dats {
p.SeprateAuxAndImgData(d)
aos, _ := p.ExtractAosData()
dats, _ := p.ExtractOriginalImageData(aos)
for i, d := range dats {
p.SeprateAuxAndImgData(d, i)
}
},
}
@@ -34,5 +35,5 @@ var extractCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(extractCmd)
extractCmd.Flags().StringVarP(&dataId, "data id", "d", "051513", "051513")
extractCmd.Flags().StringVarP(&dataId, "data-id", "d", "051513", "051513")
}

View File

@@ -14,15 +14,16 @@ var parseCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
params := extract.Params{
InputData: "demo/051513.dat",
InputData: "demo/data/051513.dat",
OutputPath: "demo/output",
TempPath: "demo/temp",
DataId: "051513",
Satellite: "SJY01",
}
p := extract.NewExtractor(&params)
// p.ParseAuxPlatform("demo/output/051513_S46_AUX1.dat")
p.ParseAuxPlatformWithHead("demo/ref/辅助数据.dat")
fmt.Println("Reference Time: 2000-01-01 12:00:00 UTC, seconds:", extract.Time2000UTCSec())
p.SeprateAuxAndImgData("demo/temp/051513_S46.dat")
// p.SeprateAuxAndImgData("demo/temp/051513_S46.dat", 1)
},
}