暂时使用星下点坐标作为图像左上角坐标

This commit is contained in:
nuknal
2024-05-30 18:11:42 +08:00
parent e4d6b35702
commit 8f2b297a02
25 changed files with 1710 additions and 84 deletions

View File

@@ -1,7 +1,10 @@
package config
import "github.com/sirupsen/logrus"
type Config struct {
CRConfig CoRegistrationConfig `yaml:"cr_config" mapstructure:"cr_config"`
LogLevel logrus.Level `yaml:"log_level" mapstructure:"log_level"`
}
type CoRegistrationConfig struct {
@@ -20,6 +23,7 @@ var GCONFIG Config
func init() {
GCONFIG = Config{
LogLevel: logrus.DebugLevel,
CRConfig: CoRegistrationConfig{
MssBands: 4,
PixelBytes: 2,

View File

@@ -10,7 +10,7 @@ import (
"github.com/spf13/viper"
)
var viperInst *viper.Viper
var GViper *viper.Viper
func InitViper(cfg string) *viper.Viper {
v := viper.New()
@@ -22,7 +22,7 @@ func InitViper(cfg string) *viper.Viper {
v.SetConfigType("yaml")
err := v.ReadInConfig()
if err != nil {
log.Println(fmt.Errorf("fatal error config file: %s", err.Error()))
log.Println(fmt.Errorf("cannot read config file: %s, use default config", err.Error()))
return nil
}