def filterStations(StationList, Config, Origin, network): F = [] cfg = ConfigObj(dict=Config) minDist, maxDist = cfg.FloatRange('mindist', 'maxdist') origin = Location(Origin['lat'], Origin['lon']) Logfile.red('Filter stations with configured parameters...') print 'nr networks = ', len(network) print 'nr stations = ', len(StationList) for j in network: #print j for i in StationList: if fnmatch.fnmatch(i.getcmpName(), j): pos = Location(i.lat, i.lon) sdelta = loc2degrees(origin, pos) if sdelta > minDist and sdelta < maxDist: s = Station(i.net, i.sta, i.loc, i.comp, i.lat, i.lon, i.ele, i.dip, i.azi, i.gain) if s not in F: F.append(s) Logfile.red('%d STATIONS LEFT IN LIST' % len(F)) return F
def filterStations(StationList, Config, Origin): F = [] cfg = ConfigObj(dict=Config) minDist, maxDist = cfg.FloatRange('mindist', 'maxdist') origin = DataTypes.dictToLocation(Origin) Logfile.red('Filter stations with configured parameters') for i in StationList: sdelta = loc2degrees(origin, i) if sdelta > minDist and sdelta < maxDist: F.append( Station(i.net, i.sta, i.loc, i.comp, i.lat, i.lon, i.ele, i.dip, i.azi, i.gain)) Logfile.red('%d STATIONS LEFT IN LIST' % len(F)) return F
for name, value in parser.items(section_name): cDict[name] = value return cDict options,args = main(sys.argv) Basic.checkExistsDir(options.eventpath, isAbort=True) Globals.setEventDir(options.eventpath) C = config.Config(options.eventpath) Origin = C.parseConfig('origin') Conf = globalConf() Config = C.parseConfig('config') filter = FilterCfg(Config) cfg = ConfigObj(dict=Config) minDist, maxDist = cfg.FloatRange('mindist', 'maxdist') ev = Event(Origin['lat'],Origin['lon'],Origin['depth'],Origin['time'] ) event = model.Event(lat=float(ev.lat), lon=float(ev.lon), depth=float(ev.depth)*1000., time=util.str_to_time(ev.time)) newFreq = float(filter.newFrequency()) options.time = Origin ['time'] options.duration = int(Conf['duration']) sdspath = os.path.join(options.eventpath,'data') model.dump_events([event], sdspath+'event.pf') tmin = util.str_to_time(ev.time)-600. tmax = util.str_to_time(ev.time)+1800. def get_stations(site, lat, lon, rmin, rmax, tmin, tmax, channel_pattern='BH*'): extra = {} if site == 'iris':