[seiscomp, scanloc] Install, add .gitignore
This commit is contained in:
56
share/templates/seedlink/fs_mseed/plugins.ini.tpl
Normal file
56
share/templates/seedlink/fs_mseed/plugins.ini.tpl
Normal file
@ -0,0 +1,56 @@
|
||||
* Generated at $date - Do not edit!
|
||||
* template: $template
|
||||
|
||||
[$seedlink.source.id]
|
||||
|
||||
input_type = $sources.fs_mseed.input_type
|
||||
data_format = $sources.fs_mseed.data_format
|
||||
location = $sources.fs_mseed.location
|
||||
|
||||
* Stations to process, separated by a comma. Default is all stations.
|
||||
$sources.fs_mseed.station_list_def
|
||||
|
||||
* "pattern" is a POSIX extended regular expression that must match
|
||||
* input file names (useful for filtering out non-data files). For
|
||||
* example "BH[NEZ]" would match any files that contained "BHE",
|
||||
* "BHN" or "BHZ". If no pattern is specified all files will be
|
||||
* processed.
|
||||
$sources.fs_mseed.pattern_def
|
||||
|
||||
* Look for data files at the 1st or 2nd directory level
|
||||
scan_level = $sources.fs_mseed.scan_level
|
||||
|
||||
* Move file to subdirectory "processed" before starting to read it
|
||||
move_files = $sources.fs_mseed.move_files_yesno
|
||||
|
||||
* Delete processed files
|
||||
delete_files = $sources.fs_mseed.delete_files_yesno
|
||||
|
||||
* Look only for files that are newer than the last file processed
|
||||
use_timestamp = $sources.fs_mseed.use_timestamp_yesno
|
||||
|
||||
* Timestamp file is used to save the modification time of the last file
|
||||
* processed
|
||||
timestamp_file = "$sources.fs_mseed.timestamp_file"
|
||||
|
||||
* New files are searched for every "polltime" seconds
|
||||
polltime = $sources.fs_mseed.polltime
|
||||
|
||||
* Wait until the file is at least 30 seconds old, before trying to read it
|
||||
delay = $sources.fs_mseed.delay
|
||||
|
||||
* "verbosity" tells how many debugging messages are printed
|
||||
verbosity = $sources.fs_mseed.verbosity
|
||||
|
||||
* Maximum number of consecutive zeros in datastream before data gap will be
|
||||
* declared (-1 = disabled)
|
||||
zero_sample_limit = $sources.fs_mseed.zero_sample_limit
|
||||
|
||||
* If timing quality is not available, use this value as default
|
||||
* (-1 = disabled)
|
||||
default_timing_quality = $sources.fs_mseed.default_timing_quality
|
||||
|
||||
* Channel definitions (Mini-SEED streams are defined in streams.xml,
|
||||
* look for <proc name="generic_3x50">)
|
||||
|
||||
$sources.fs_mseed.channel_map
|
7
share/templates/seedlink/fs_mseed/seedlink_plugin.tpl
Normal file
7
share/templates/seedlink/fs_mseed/seedlink_plugin.tpl
Normal file
@ -0,0 +1,7 @@
|
||||
* template: $template
|
||||
plugin ${seedlink.source.id} cmd = "$seedlink.plugin_dir/fs_plugin$seedlink._daemon_opt -v -f $seedlink.config_dir/plugins.ini"
|
||||
timeout = 1200
|
||||
start_retry = 60
|
||||
shutdown_wait = 10
|
||||
proc = "$sources.fs_mseed.proc"
|
||||
|
105
share/templates/seedlink/fs_mseed/setup.py
Normal file
105
share/templates/seedlink/fs_mseed/setup.py
Normal file
@ -0,0 +1,105 @@
|
||||
import os
|
||||
|
||||
|
||||
def updateKey(key, seedlink, name):
|
||||
key[0] += name + ":" + str(seedlink.param(name)) + ";"
|
||||
|
||||
|
||||
def updateSwitch(key, seedlink, name, var):
|
||||
try:
|
||||
if seedlink.param(name).lower() in ("yes", "true", "1"):
|
||||
var = True
|
||||
else:
|
||||
var = False
|
||||
except: pass
|
||||
|
||||
if var == True:
|
||||
seedlink.setParam(name + '_yesno', 'yes')
|
||||
else:
|
||||
seedlink.setParam(name + '_yesno', 'no')
|
||||
updateKey(key, seedlink, name + '_yesno')
|
||||
|
||||
|
||||
def updateString(key, seedlink, name, var):
|
||||
try: var = seedlink.param(name)
|
||||
except: pass
|
||||
seedlink.setParam(name, var)
|
||||
updateKey(key, seedlink, name)
|
||||
|
||||
|
||||
def updateInt(key, seedlink, name, var):
|
||||
try: var = int(seedlink.param(name))
|
||||
except: pass
|
||||
seedlink.setParam(name, var)
|
||||
updateKey(key, seedlink, name)
|
||||
|
||||
|
||||
def updatePath(key, seedlink, name, var):
|
||||
try: var = seedlink.param(name)
|
||||
except: pass
|
||||
var = var.replace("@ROOTDIR@", seedlink.pkgroot)
|
||||
seedlink.setParam(name, var)
|
||||
updateKey(key, seedlink, name)
|
||||
|
||||
|
||||
'''
|
||||
Plugin handler for the FS plugin.
|
||||
'''
|
||||
class SeedlinkPluginHandler:
|
||||
# Create defaults
|
||||
def __init__(self):
|
||||
self.station_list = {}
|
||||
|
||||
def push(self, seedlink):
|
||||
key = [""]
|
||||
|
||||
# Check and set defaults
|
||||
updateString(key, seedlink, 'sources.fs_mseed.input_type', 'ddb')
|
||||
updateString(key, seedlink, 'sources.fs_mseed.data_format', 'mseed')
|
||||
updatePath(key, seedlink, 'sources.fs_mseed.location', os.path.join("@ROOTDIR@", "var", "lib", "seedlink", "indata"))
|
||||
|
||||
try:
|
||||
pattern = seedlink.param('sources.fs_mseed.pattern')
|
||||
seedlink.setParam('sources.fs_mseed.pattern_def', 'pattern=' + pattern)
|
||||
except:
|
||||
seedlink.setParam('sources.fs_mseed.pattern_def', '*pattern = BH[NEZ]')
|
||||
updateKey(key, seedlink, 'sources.fs_mseed.pattern_def')
|
||||
|
||||
updateInt(key, seedlink, 'sources.fs_mseed.scan_level', 2)
|
||||
updateSwitch(key, seedlink, 'sources.fs_mseed.move_files', True)
|
||||
updateSwitch(key, seedlink, 'sources.fs_mseed.delete_files', False)
|
||||
updateSwitch(key, seedlink, 'sources.fs_mseed.use_timestamp', False)
|
||||
|
||||
updatePath(key, seedlink, 'sources.fs_mseed.timestamp_file', os.path.join("@ROOTDIR@", "var", "run", "seedlink", "fs_mseed.tim"))
|
||||
|
||||
updateInt(key, seedlink, 'sources.fs_mseed.polltime', 10)
|
||||
updateInt(key, seedlink, 'sources.fs_mseed.delay', 30)
|
||||
updateInt(key, seedlink, 'sources.fs_mseed.verbosity', 1)
|
||||
updateInt(key, seedlink, 'sources.fs_mseed.zero_sample_limit', 10)
|
||||
updateInt(key, seedlink, 'sources.fs_mseed.default_timing_quality', -1)
|
||||
|
||||
channel_map = ""
|
||||
|
||||
for (name, value) in seedlink.station_params.items():
|
||||
if name.startswith("sources.fs_mseed.channels."):
|
||||
toks = name[len("sources.fs_mseed.channels."):].split('.')
|
||||
if len(toks) != 2: continue
|
||||
if toks[1] != "source_id": continue
|
||||
channel_map += "channel %s source_id = \"%s\"\n" % (toks[0], value)
|
||||
|
||||
seedlink.setParam('sources.fs_mseed.channel_map', channel_map)
|
||||
key[0] += "sources.fs_mseed.channel_map:" + channel_map + ";"
|
||||
|
||||
try: station_list = self.station_list[key[0]] + ','
|
||||
except: station_list = ''
|
||||
|
||||
station_list += seedlink.sta
|
||||
self.station_list[key[0]] = station_list
|
||||
seedlink.setParam('sources.fs_mseed.station_list_def', 'station_list=' + station_list)
|
||||
|
||||
# Key is per config
|
||||
return key[0]
|
||||
|
||||
# Flush does nothing
|
||||
def flush(self, seedlink):
|
||||
pass
|
15
share/templates/seedlink/fs_mseed/streams_generic_3x50.tpl
Normal file
15
share/templates/seedlink/fs_mseed/streams_generic_3x50.tpl
Normal file
@ -0,0 +1,15 @@
|
||||
<proc name="generic_3x50">
|
||||
<tree>
|
||||
<input name="Z" channel="Z" location="" rate="50"/>
|
||||
<input name="N" channel="N" location="" rate="50"/>
|
||||
<input name="E" channel="E" location="" rate="50"/>
|
||||
<node stream="SH"/>
|
||||
<node filter="F96C" stream="BH">
|
||||
<node filter="FS2D5">
|
||||
<node filter="FS2D5" stream="LH">
|
||||
<node filter="VLP" stream="VH"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</tree>
|
||||
</proc>
|
Reference in New Issue
Block a user