zoukankan      html  css  js  c++  java
  • 下载EU台网(欧洲台网)的地震波数据

    retrievedata.py

    ### here first to check the existence of the focal mechanism event file in the NDK directory,
    ###  if existence, mostly useful for the waveforms inversion,if not,download the event quakeml from
    ###  iris without focal mechanism. Then download the data from IRIS and GFZ, and before run, should 
    ###  update the username and password for the restricted data.
    ###  http://geofon.gfz-potsdam.de/waveform/archive/auth/auth-example.php
    ###  wget --post-file /data2/yjgao/token.asc https://geofon.gfz-potsdam.de/fdsnws/dataselect/1/auth -O cred.txt
    ###  Yajian Gao, 2017,12,26,GFZ
    
    from obspy import read_events
    from obspy.clients.fdsn import Client
    from obspy import UTCDateTime
    import os
    import sys
    import datetime
    import obspy
    from pathlib import Path
    import os.path
    from obspy.clients.fdsn.mass_downloader import CircularDomain, 
        Restrictions, MassDownloader
    from obspy.clients.seedlink.easyseedlink import create_client
    #def handle_data(trace):
        #print('Received the following trace:')
        #print(trace)
        #print()
    #client = create_client('geofon.gfz-potsdam.de', on_data=handle_data)
    client = Client("IRIS")
    if len(sys.argv) != 8:
        sys.exit("Usage: python %s year month day hour:minute:seconds eventid evla evlo"% sys.argv[0])
    year,month,day,origin,eventid,evla,evlo = sys.argv[1:]
    hour,minute,second=origin.split(':')
    #############################################download quakeml from IRIS without FOCAL MECHANISM
    
    EVENTFILENAME='C'+str(year)+str(month)+str(day)+str(hour)+str(minute)+'A.ndk'
    PATH="../NDK/"+str(EVENTFILENAME)
    print(PATH)
    ts=os.path.exists(PATH)
    if ts== True:
        print(ts)
        cat = obspy.read_events("../NDK/"+str(EVENTFILENAME))
        print(cat)

    cmd,并进入桌面(取决于下载数据的脚本在哪里) ,例:cd C:UsersDesktop

    输入下载命令:python retrievedata.py 2018 09 28 10:02:45 eventid  evla evlo

  • 相关阅读:
    20200209 ZooKeeper 3. Zookeeper内部原理
    20200209 ZooKeeper 2. Zookeeper本地模式安装
    20200209 Zookeeper 1. Zookeeper入门
    20200206 尚硅谷Docker【归档】
    20200206 Docker 8. 本地镜像发布到阿里云
    20200206 Docker 7. Docker常用安装
    20200206 Docker 6. DockerFile解析
    20200206 Docker 5. Docker容器数据卷
    20200206 Docker 4. Docker 镜像
    Combining STDP and Reward-Modulated STDP in Deep Convolutional Spiking Neural Networks for Digit Recognition
  • 原文地址:https://www.cnblogs.com/seisjun/p/10061344.html
Copyright © 2011-2022 走看看