提交 151214e8 编辑于 作者: Mijian Xu's avatar Mijian Xu 😷
浏览文件

bqmail 1.2.0

上级 3ec055ce
......@@ -11,13 +11,13 @@
def Usage():
print('Usage:')
print('python bqmail.py -Nnetwork -Sstation -Yyear1/month1/day1/year2/month2/day2 -Bsec_begin/sec_end -Cdatetimefile -s head.cfg')
print('python bqmail.py -Nnetwork -Sstation -Yyear1/month1/day1/year2/month2/day2 -Bsec_begin/sec_end -Cdatetimefile -shour head.cfg')
print('-N -- Network.')
print('-S -- Station.')
print('-Y -- Date range.')
print('-B -- Time fefore/after origal time of events in seconds.')
print('-C -- Directory date time file. formaat:2015,01,04,1,0,0 2015,01,04,10,0,0')
print('-s -- Dequest continuous wave by one day.')
print('-C -- Directory of date time file. formaat: "2015,01,04,1,0,0 2015,01,04,10,0,0"')
print('-s -- Dequest continuous wave by hour.')
print('head.cfg -- Config file.')
......@@ -34,7 +34,7 @@ except:
try:
opts,args = getopt.getopt(sys.argv[1:], "hN:S:C:Y:B:s")
opts,args = getopt.getopt(sys.argv[1:], "hN:S:C:Y:B:s:")
except:
print('Arguments are not found!')
Usage()
......@@ -62,6 +62,7 @@ for op, value in opts:
timerange = value
elif op == "-s":
iscontinue = 1
timeval = float(value)
elif op == "-h":
Usage()
sys.exit(1)
......@@ -112,16 +113,16 @@ if iscustom:
EVENT = open(datetimefile,'r')
for evenum in EVENT:
evenum = evenum.strip('\n')
evenum_sp = re.split(',|\s',evenum)
evenum_sp = re.split('\W|\s',evenum)
event.append(evenum_sp)
elif iscontinue:
nowtime = datemin - datetime.timedelta(days=1)
nowtime = datemin - datetime.timedelta(hours=timeval)
while 1:
if nowtime >= datemax:
break
nowtime = nowtime + datetime.timedelta(days=1)
endtime = nowtime + datetime.timedelta(days=1)
nowtime = nowtime + datetime.timedelta(hours=timeval)
endtime = nowtime + datetime.timedelta(hours=timeval)
event.append([nowtime.strftime('%Y'),nowtime.strftime('%m'),nowtime.strftime('%d'),nowtime.strftime('%H'),nowtime.strftime('%M'),endtime.strftime('%Y'),endtime.strftime('%m'),endtime.strftime('%d'),endtime.strftime('%H'),endtime.strftime('%M')])
else:
......
......@@ -21,8 +21,8 @@ import glob
def Usage():
print('Usage: python searchlalo.py -NNetwork -Sstation -Rlon1/lon2/lat1/lat2 -Dlon/lat/dis1/dis2 -Yyear1/mon1/day1/year2/mon2/day2 -Cchannel -K')
print('-N -- Network')
print('-S -- Station')
print('-N -- Network.')
print('-S -- Station.')
print('-R -- Search range.')
print('-D -- Search by distance.')
print('-Y -- Date range')
......@@ -87,10 +87,6 @@ if lat_lon != '':
lat = lat_lon_split[1]
dis1 = float(lat_lon_split[2])
dis2 = float(lat_lon_split[3])
# print(lon,lat,dis)
# [lat1,lon1] = distaz.latlon_from(float(lat),float(lon),225,dis*math.sqrt(2))
# [lat2,lon2] = distaz.latlon_from(float(lat),float(lon),45,dis*math.sqrt(2))
# print(lon1,lon2,lat1,lat2)
lon1 = str(0)
lat1 = str(-90)
lon2 = str(0)
......@@ -111,15 +107,6 @@ if isyrange:
url += network+station+lalo_label+yrange+chan
url = url[0:-1]
# if ischan:
# url = 'http://ds.iris.edu/cgi-bin/xmlstationinfo?minlat='+lat1+'&maxlat='+lat2+'&minlon='+lon1+'&maxlon='+lon2+'&timewindow='+year1+'/'+mon1+'/'+day1+'-'+year2+'/'+mon2+'/'+day2+'&chan='+chan
# else:
# url = 'http://ds.iris.edu/cgi-bin/xmlstationinfo?minlat='+lat1+'&maxlat='+lat2+'&minlon='+lon1+'&maxlon='+lon2+'&timewindow='+year1+'/'+mon1+'/'+day1+'-'+year2+'/'+mon2+'/'+day2
#elif ischan:
# url = 'http://ds.iris.edu/cgi-bin/xmlstationinfo?minlat='+lat1+'&maxlat='+lat2+'&minlon='+lon1+'&maxlon='+lon2+'&chan='+chan
#else:
# url = 'http://ds.iris.edu/cgi-bin/xmlstationinfo?minlat='+lat1+'&maxlat='+lat2+'&minlon='+lon1+'&maxlon='+lon2
response = rq.urlopen(url)
html = str(response.read())
find_re = re.compile(r'<station\s.+?"\s/>',re.DOTALL)
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册