# http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg----------
if len(args) == 0: return True elif len(args) == 1: return ((self.tmin is None or self.tmin <= args[0]) and (self.tmax is None or args[0] <= self.tmax))
elif len(args) == 2: return ((self.tmin is None or args[1] >= self.tmin) and (self.tmax is None or self.tmax >= args[0]))
presponse, input_unit, output_unit, 1.0)
except util.TimeStrError: year = int(s[:4]) if year > this_year + 100: return None # StationXML contained a dummy end date
raise
get_comments=True) 'end', 'latitude', 'longitude', 'depth', 'elevation', 'dip', 'azimuth', 'input unit', 'output unit'):
codes=(d['network'], d['station'], d['location'], d['channel']), tmin=util.str_to_time(d['start'], format=time_format), tmax=dummy_aware_str_to_time(d['end']), lat=float(d['latitude']), lon=float(d['longitude']), elevation=float(d['elevation']), depth=float(d['depth']), dip=float(d['dip']), azimuth=float(d['azimuth']), input_unit=d['input unit'], output_unit=d['output unit'], response=response) except KeyError as e: raise EnhancedSacPzError( 'cannot get all required information "%s"' % e.args[0])
iload_fh, 'SACPZ', ':py:class:`EnhancedSacPzResponse`')
''' Create stationxml from "enhanced" SACPZ information.
:param responses: iterable yielding :py:class:`EnhancedSacPzResponse` objects :returns: :py:class:`pyrocko.fdsn.station.FDSNStationXML` object '''
(cr.codes, cr.lat, cr.lon, cr.elevation))
code=cha, location_code=loc, start_date=cr.tmin, end_date=cr.tmax, latitude=sxml.Latitude(cr.lat), longitude=sxml.Longitude(cr.lon), elevation=sxml.Distance(cr.elevation), depth=sxml.Distance(cr.depth), response=make_stationxml_response( cr.response, cr.input_unit, cr.output_unit)))
v, message='channel lat/lon/elevation values differ', error=inconsistencies)
code=sta, latitude=sxml.Latitude(lat), longitude=sxml.Longitude(lon), elevation=sxml.Distance(elevation), channel_list=sorted( station_channels[net, sta], key=lambda c: (c.location_code, c.code)))
source='Converted from "enhanced" SACPZ information', created=time.time(), network_list=[networks[net_] for net_ in sorted(networks.keys())])
if __name__ == '__main__':
import sys
util.setup_logging(__name__)
if len(sys.argv) < 2: sys.exit('usage: python -m pyrocko.station.enhanced_sacpz <sacpz> ...')
sxml_in = make_stationxml(iload(sys.argv[1:])) print(sxml_in.dump_xml()) |