[seiscomp, scanloc] Install, add .gitignore

This commit is contained in:
2025-10-09 15:07:02 +02:00
commit 20f5301bb1
2848 changed files with 1315858 additions and 0 deletions

View File

@ -0,0 +1,34 @@
* Generated at $date - Do not edit!
* template: $template
[$seedlink.source.id]
* Settings for the RefTek plugin
* Hostname and TCP port of RTPD server
host = $sources.reftek.address
port = $sources.reftek.port
* Connection retry control:
* never => no retry
* transient => retry on transient errors
* nonfatal => retry on non-fatal errors
*
* Note that when reftek_plugin exits, it will be automatically restarted
* by seedlink, depending on the "start_retry" parameter in seedlink.ini
retry = nonfatal
* Timeout length in seconds. If no data is received from a Reftek unit
* during this period, the plugin assumes that the unit is disconnected.
timeout = $sources.reftek.timeout
* Default timing quality in percents. This value will be used when no
* timing quality information is available. Can be -1 to omit the blockette
* 1001 altogether.
default_tq = $sources.reftek.default_tq
* Timing quality to use when GPS is out of lock
unlock_tq = $sources.reftek.unlock_tq
* Send Reftek state-of-health data as Mini-SEED LOG stream
log_soh = $sources.reftek.log_soh

View File

@ -0,0 +1,7 @@
* template: $template
plugin $seedlink.source.id cmd="$seedlink.plugin_dir/reftek_plugin$seedlink._daemon_opt -v -f '$seedlink.config_dir/plugins.ini' -m '$sources.reftek.mapFlag'"
timeout = 0
start_retry = 60
shutdown_wait = 60
proc = "$sources.reftek.proc"

View File

@ -0,0 +1,102 @@
import os, time
'''
Plugin handler for the Reftek export plugin.
'''
class SeedlinkPluginHandler:
# Create defaults
def __init__(self):
self.instances = {}
self.unitMap = {}
self.idMap = {}
def push(self, seedlink):
# Check and set defaults
address = "127.0.0.1"
try: address = seedlink.param('sources.reftek.address')
except: seedlink.setParam('sources.reftek.address', address)
port = 2543
try: port = int(seedlink.param('sources.reftek.port'))
except: seedlink.setParam('sources.reftek.port', port)
proc = "reftek"
try: proc = seedlink.param('sources.reftek.proc')
except: seedlink.setParam('sources.reftek.proc', proc)
key = (address + ":" + str(port), proc)
try:
reftekId = self.instances[key]
except KeyError:
reftekId = len(self.instances)
self.instances[key] = reftekId
self.unitMap[reftekId] = []
try:
unit = seedlink.param('sources.reftek.unit')
map = os.path.join(seedlink.config_dir, "reftek2sl%d.map" % reftekId)
seedlink.setParam('sources.reftek.mapFlag', map)
mapping = (unit, seedlink._get('seedlink.station.id'))
if not mapping in self.unitMap[reftekId]:
self.unitMap[reftekId].append(mapping)
try:
if not mapping[1] in self.idMap[mapping[0]]:
self.idMap[mapping[0]].append(mapping[1])
except KeyError:
self.idMap[mapping[0]] = [mapping[1]]
except KeyError:
try:
map = seedlink.param('sources.reftek.map')
if not os.path.isabs(map):
map = os.path.join(seedlink.config_dir, map)
except: map = os.path.join(seedlink.config_dir, 'reftek2sl.map')
seedlink.setParam('sources.reftek.mapFlag', map)
timeout = 60
try: timeout = int(seedlink.param('sources.reftek.timeout'))
except: seedlink.setParam('sources.reftek.timeout', timeout)
default_tq = 40
try: default_tq = int(seedlink.param('sources.reftek.default_tq'))
except: seedlink.setParam('sources.reftek.default_tq', default_tq)
unlock_tq = 10
try: unlock_tq = int(seedlink.param('sources.reftek.unlock_tq'))
except: seedlink.setParam('sources.reftek.unlock_tq', unlock_tq)
log_soh = "true"
try:
if seedlink.param('sources.reftek.log_soh').lower() in ("yes", "true", "1"):
log_soh = "true"
else:
log_soh = "false"
except: seedlink.setParam('sources.reftek.log_soh', log_soh)
# Key is address (one instance per address)
return (key, map)
# Flush generates the map file(s)
def flush(self, seedlink):
for x in self.idMap.keys():
if len(self.idMap[x]) > 1:
raise Exception("Error: Reftek plugin has multiple mappings for unit %s" % x)
for x in self.unitMap.keys():
mappings = self.unitMap[x]
if len(mappings) == 0: continue
reftek2slmap = os.path.join(seedlink.config_dir, "reftek2sl%d.map" % x)
fd = open(reftek2slmap, "w")
fd.write("# Generated at %s - Do not edit!\n" % time.strftime("%Y-%m-%d %H:%M:%S UTC", time.gmtime()))
for c in mappings:
fd.write("%s %s\n" % (c[0], c[1]))
fd.close()

View File

@ -0,0 +1,51 @@
<!-- High bandwidth version; use original streams when possible
Reftek streams #1..4 (if configured) must be set to 100, 40,
20, and 1 Hz
Stream# Rate Deci Gain Ch# 1 2 3 4 5 6
1 100 1 1 HHZ HHN HHE HNZ HNN HNE
2 40 1 1 SHZ SHN SHE SNZ SNN SNE
3 20 1 1 BHZ BHN BHE
4 1 1 1 LHZ LHN LHE
10 4 VHZ VHN VHE -->
<proc name="reftek">
<tree>
<input name="0.0" channel="Z" location="" rate="100"/>
<input name="0.1" channel="N" location="" rate="100"/>
<input name="0.2" channel="E" location="" rate="100"/>
<node stream="HH"/>
</tree>
<tree>
<input name="0.3" channel="Z" location="" rate="100"/>
<input name="0.4" channel="N" location="" rate="100"/>
<input name="0.5" channel="E" location="" rate="100"/>
<node stream="HN"/>
</tree>
<tree>
<input name="1.0" channel="Z" location="" rate="40"/>
<input name="1.1" channel="N" location="" rate="40"/>
<input name="1.2" channel="E" location="" rate="40"/>
<node stream="SH"/>
</tree>
<tree>
<input name="1.3" channel="Z" location="" rate="40"/>
<input name="1.4" channel="N" location="" rate="40"/>
<input name="1.5" channel="E" location="" rate="40"/>
<node stream="SN"/>
</tree>
<tree>
<input name="2.0" channel="Z" location="" rate="20"/>
<input name="2.1" channel="N" location="" rate="20"/>
<input name="2.2" channel="E" location="" rate="20"/>
<node stream="BH"/>
</tree>
<tree>
<input name="3.0" channel="Z" location="" rate="1"/>
<input name="3.1" channel="N" location="" rate="1"/>
<input name="3.2" channel="E" location="" rate="1"/>
<node stream="LH">
<node filter="VLP" stream="VH"/>
</node>
</tree>
</proc>

View File

@ -0,0 +1,32 @@
<!-- Reftek stream setup
Low bandwidth version; derive everything from 40 Hz
Reftek stream #2 must be set to 40 Hz
Stream# Rate Deci Gain Ch# 1 2 3 4 5 6
2 40 1 1 SHZ SHN SHE SNZ SNN SNE
2 1 BHZ BHN BHE
40 1 LHZ LHN LHE
400 4 VHZ VHN VHE -->
<proc name="reftek_6x40">
<tree>
<input name="1.0" channel="Z" location="" rate="40"/>
<input name="1.1" channel="N" location="" rate="40"/>
<input name="1.2" channel="E" location="" rate="40"/>
<node stream="SH"/>
<node filter="F96C" stream="BH">
<node filter="F96C">
<node filter="ULP" stream="LH">
<node filter="VLP" stream="VH"/>
</node>
</node>
</node>
</tree>
<tree>
<input name="1.3" channel="Z" location="" rate="40"/>
<input name="1.4" channel="N" location="" rate="40"/>
<input name="1.5" channel="E" location="" rate="40"/>
<node stream="SN"/>
</tree>
</proc>