Commit e30e3dd1 authored by Sebastian Heimann's avatar Sebastian Heimann
Browse files

add whitelist and distance_max config options

parent 3d8bb885
......@@ -41,6 +41,14 @@ class Config(Object):
String.T(),
help='codes in the form NET.STA.LOC of receivers to be excluded')
whitelist = List.T(
String.T(),
help='codes in the form NET.STA.LOC of receivers to be included')
distance_max = Float.T(
optional=True,
help='receiver maximum distance from grid')
tmin = Timestamp.T(
optional=True,
help='beginning of time interval to be processed')
......
......@@ -152,10 +152,17 @@ def scan(
'available: %g s\n' % (2.*tpad, tavail))
blacklist = set(tuple(s.split('.')) for s in config.blacklist)
whitelist = set(tuple(s.split('.')) for s in config.whitelist)
distances = grid.distances(receivers)
distances_to_grid = num.min(distances, axis=0)
station_index = dict(
(rec.codes, i) for (i, rec) in enumerate(receivers)
if rec.codes not in blacklist)
if rec.codes not in blacklist and (
not whitelist or rec.codes in whitelist) and (
config.distance_max is None or
distances_to_grid[i] <= config.distance_max))
for data_path in config.data_paths:
if not op.exists(data_path):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment