diff --git a/CHANGELOG.md b/CHANGELOG.md index 50a3aceb..6849dbb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ Starting from v2.2.5, all notable changes to this project will be documented in this file. +## v3.5.0 + +### New Features + +- Provide an option to disable MiniSEED compression. + ## v3.4.6 ### Bug Fixes diff --git a/VERSION b/VERSION index d0ec26c7..c0c4025d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v3.4.6 +v3.5.0 diff --git a/build/assets/config.json b/build/assets/config.json index 30ee5565..239c6ddd 100644 --- a/build/assets/config.json +++ b/build/assets/config.json @@ -20,8 +20,8 @@ "frequency": 4.5, "sensitivity": 28.8, "velocity": true, - "vref": 5.0, - "fullscale": 10.0, + "vref": 2.5, + "fullscale": 5.0, "resolution": 32 }, "stream_settings": { @@ -63,6 +63,7 @@ "miniseed": { "enable": true, "lifecycle": 10, + "nocompress": false, "path": "/home/user/miniseed" }, "archiver": { @@ -77,7 +78,8 @@ "seedlink": { "enable": true, "host": "0.0.0.0", - "port": 18000 + "port": 18000, + "nocompress": false }, "helicorder": { "enable": true, diff --git a/go.mod b/go.mod index dd5b5305..161a7e22 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/bclswl0827/heligo v0.0.12 github.com/bclswl0827/mseedio v1.0.10 github.com/bclswl0827/sacio v1.0.6 - github.com/bclswl0827/slgo v0.0.4 + github.com/bclswl0827/slgo v0.1.0 github.com/bclswl0827/sqlite v1.11.1-0.20240613172512-9e6ac9861470 github.com/beevik/ntp v1.4.3 github.com/bwmarrin/snowflake v0.3.0 diff --git a/go.sum b/go.sum index ca9b049c..cebfd8ed 100644 --- a/go.sum +++ b/go.sum @@ -55,8 +55,8 @@ github.com/bclswl0827/mseedio v1.0.10 h1:415K2mJCVqAUeuCfTxOuf5tnUVKfptGokroAlM7 github.com/bclswl0827/mseedio v1.0.10/go.mod h1:G9nOPR8epxb7ihX5pUpvs3HqYZMnMlXc1Ha1WSMWn7s= github.com/bclswl0827/sacio v1.0.6 h1:kR6ll6xjoQGO+YVEZvvvbAxKGUD3qUXsyIuQape1+vc= github.com/bclswl0827/sacio v1.0.6/go.mod h1:SuiIK7hBHCJvxUOC/rgbJRUO5IoFrEnuCY0xVJ7RyQk= -github.com/bclswl0827/slgo v0.0.4 h1:WJn0kkQTsGaVJYPnIdDwRgHyEN6FdkIbvBDPxCGk6nU= -github.com/bclswl0827/slgo v0.0.4/go.mod h1:HlY9zJp3ZxqeS66SoRcnwE/c92Mh4d9Jpeat/68yZhs= +github.com/bclswl0827/slgo v0.1.0 h1:ndEOFi/3sx56i5AKvex6hSmhvwG8wP2KnwhVFlbpzQ4= +github.com/bclswl0827/slgo v0.1.0/go.mod h1:HlY9zJp3ZxqeS66SoRcnwE/c92Mh4d9Jpeat/68yZhs= github.com/bclswl0827/sqlite v1.11.1-0.20240613172512-9e6ac9861470 h1:VYRieWhizTvSnQ3iJ9cVvB+4go+f/2mTp6CC2MSXnn4= github.com/bclswl0827/sqlite v1.11.1-0.20240613172512-9e6ac9861470/go.mod h1:/xElCFPGgTMHBhfSjGBlITMQ/qe6CLTinWdxSbc4oDE= github.com/beevik/ntp v1.4.3 h1:PlbTvE5NNy4QHmA4Mg57n7mcFTmr1W1j3gcK7L1lqho= diff --git a/services/miniseed/start.go b/services/miniseed/start.go index 888185b7..c2e93cc2 100644 --- a/services/miniseed/start.go +++ b/services/miniseed/start.go @@ -35,6 +35,12 @@ func (m *MiniSeedService) Start(options *services.Options, waitGroup *sync.WaitG } m.basePath = basePath.(string) + noCompress, err := options.Config.Services.GetValue(m.GetServiceName(), "nocompress", "bool") + if err != nil { + noCompress = false + } + m.noCompress = noCompress.(bool) + m.stationCode = options.Config.Stream.Station m.networkCode = options.Config.Stream.Network m.locationCode = options.Config.Stream.Location diff --git a/services/miniseed/types.go b/services/miniseed/types.go index 801efc1c..38705f30 100644 --- a/services/miniseed/types.go +++ b/services/miniseed/types.go @@ -7,7 +7,6 @@ import ( const ( MINISEED_BIT_ORDER = mseedio.MSBFIRST - MINISEED_ENCODE_TYPE = mseedio.STEIM2 MINISEED_WRITE_INTERVAL = 5 MINISEED_CLEANUP_INTERVAL = 3600 ) @@ -19,6 +18,7 @@ type MiniSeedService struct { writeBufferCountDown int cleanUpCountDown int lifeCycle int + noCompress bool basePath string stationCode string networkCode string diff --git a/services/miniseed/write.go b/services/miniseed/write.go index 907f1291..033f2bce 100644 --- a/services/miniseed/write.go +++ b/services/miniseed/write.go @@ -33,6 +33,10 @@ func (m *MiniSeedService) handleWrite() error { } // Write data to file by channels + encodeType := mseedio.STEIM2 + if m.noCompress { + encodeType = mseedio.INT32 + } for _, channelCode := range []string{ explorer.EXPLORER_CHANNEL_CODE_Z, explorer.EXPLORER_CHANNEL_CODE_E, @@ -50,7 +54,7 @@ func (m *MiniSeedService) handleWrite() error { } } var miniseed mseedio.MiniSeedData - err := miniseed.Init(MINISEED_ENCODE_TYPE, MINISEED_BIT_ORDER) + err := miniseed.Init(encodeType, MINISEED_BIT_ORDER) if err != nil { return err } diff --git a/services/seedlink/start.go b/services/seedlink/start.go index 5c16de67..c0638f43 100644 --- a/services/seedlink/start.go +++ b/services/seedlink/start.go @@ -34,6 +34,10 @@ func (s *SeedLinkService) Start(options *services.Options, waitGroup *sync.WaitG logger.GetLogger(s.GetServiceName()).Errorln(err) return } + noCompress, err := options.Config.Services.GetValue(s.GetServiceName(), "nocompress", "bool") + if err != nil { + noCompress = false + } currentTime := options.TimeSource.Get() messageBus := messagebus.New(65535) @@ -86,7 +90,7 @@ func (s *SeedLinkService) Start(options *services.Options, waitGroup *sync.WaitG serviceName: s.GetServiceName(), }, ) - go server.Start(serverHost.(string), serverPort.(int)) + go server.Start(serverHost.(string), serverPort.(int), !noCompress.(bool)) logger.GetLogger(s.GetServiceName()).Infof("seedlink is listening on %s:%d", serverHost, serverPort) logger.GetLogger(s.GetServiceName()).Infoln("service has been started")