Exemple #1
0
    def __init__(self, providers=None):
        # Bit of a hack!
        URL_MAPPINGS["INGV"] =  "http://webservices.rm.ingv.it"
        
        if providers is None:
            providers = dict(URL_MAPPINGS.items())
            # In that case make sure IRIS is first, and ORFEUS second! The
            # remaining items will be sorted alphabetically.
            _p = []
          #  del providers["ORFEUS"]
            if "IRIS" in providers:
                _p.append("IRIS")
                del providers["IRIS"]
            #if "ORFEUS" in providers:
            #    _p.append("ORFEUS")
            #del providers["ODC"]
            del providers["ORFEUS"]
            _p.extend(sorted(providers))
            providers = _p
            
        self.providers = tuple(providers)

        # Initialize all clients.
        self._initialized_clients = OrderedDict()
        self.__initialize_clients()
# Testing ObsPy with FDSN web services
#
# see http://docs.obspy.org/packages/obspy.fdsn.html

# List all FDSN locations (example from link above) ----------------------------

from obspy import UTCDateTime

from obspy.fdsn import Client
client = Client("IRIS")

from obspy.fdsn.header import URL_MAPPINGS
for key in sorted(URL_MAPPINGS.keys()):
    print("{0:<7} {1}".format(key,  URL_MAPPINGS[key]))
    

# Inventory (from link above) --------------------------------------------------

starttime = UTCDateTime("2002-01-01")
endtime = UTCDateTime("2002-01-02")

inventory = client.get_stations(network="IU", station="A*",
                                starttime=starttime,
                                endtime=endtime)

print(inventory)


# NCEDC channels request -------------------------------------------------------

client = Client("NCEDC")
Exemple #3
0
# Testing ObsPy with FDSN web services
#
# see http://docs.obspy.org/packages/obspy.fdsn.html

# List all FDSN locations (example from link above) ----------------------------

from obspy import UTCDateTime

from obspy.fdsn import Client
client = Client("IRIS")

from obspy.fdsn.header import URL_MAPPINGS
for key in sorted(URL_MAPPINGS.keys()):
    print("{0:<7} {1}".format(key, URL_MAPPINGS[key]))

# Inventory (from link above) --------------------------------------------------

starttime = UTCDateTime("2002-01-01")
endtime = UTCDateTime("2002-01-02")

inventory = client.get_stations(network="IU",
                                station="A*",
                                starttime=starttime,
                                endtime=endtime)

print(inventory)

# NCEDC channels request -------------------------------------------------------

client = Client("NCEDC")