@@ -89,11 +89,11 @@ def get_daylong_arguments(argv=None):
89
89
"correction. [Default '12,P' looks for both horizontal and " +
90
90
"pressure and allows for both tilt AND compliance corrections]" )
91
91
parser .add_argument (
92
- "--zcomp" ,
92
+ "--zcomp" ,
93
93
dest = "zcomp" ,
94
94
type = str ,
95
95
default = "Z" ,
96
- help = "Specify the Vertical Component Channel Identifier. " +
96
+ help = "Specify the Vertical Component Channel Identifier. " +
97
97
"[Default Z]." )
98
98
parser .add_argument (
99
99
"-O" , "--overwrite" ,
@@ -131,17 +131,17 @@ def get_daylong_arguments(argv=None):
131
131
"waveform server (--user-auth='username:authpassword') to access " +
132
132
"and download restricted data. [Default no user and password]" )
133
133
ServerGroup .add_argument (
134
- "--eida-token" ,
135
- action = "store" ,
134
+ "--eida-token" ,
135
+ action = "store" ,
136
136
type = str ,
137
- dest = "tokenfile" ,
138
- default = None ,
137
+ dest = "tokenfile" ,
138
+ default = None ,
139
139
help = "Token for EIDA authentication mechanism, see " +
140
140
"http://geofon.gfz-potsdam.de/waveform/archive/auth/index.php. "
141
141
"If a token is provided, argument --user-auth will be ignored. "
142
142
"This mechanism is only available on select EIDA nodes. The token can "
143
- "be provided in form of the PGP message as a string, or the filename of "
144
- "a local file with the PGP message in it. [Default None]" )
143
+ "be provided in form of the PGP message as a string, or the filename "
144
+ "of a local file with the PGP message in it. [Default None]" )
145
145
146
146
"""
147
147
# Database Settings
@@ -271,8 +271,8 @@ def get_daylong_arguments(argv=None):
271
271
if args .userauth is not None :
272
272
tt = args .userauth .split (':' )
273
273
if not len (tt ) == 2 :
274
- msg = ("Error: Incorrect Username and Password Strings for User "
275
- "Authentification" )
274
+ msg = ("Error: Incorrect Username and Password Strings for " +
275
+ "User Authentification" )
276
276
parser .error (msg )
277
277
else :
278
278
args .userauth = tt
@@ -292,8 +292,8 @@ def get_daylong_arguments(argv=None):
292
292
# args.ndval = nan
293
293
294
294
if args .units not in ['DISP' , 'VEL' , 'ACC' ]:
295
- msg = ("Error: invalid --units argument. Choose among "
296
- "'DISP', 'VEL', or 'ACC'" )
295
+ msg = ("Error: invalid --units argument. Choose among " +
296
+ "'DISP', 'VEL', or 'ACC'" )
297
297
parser .error (msg )
298
298
299
299
if args .pre_filt is None :
@@ -302,8 +302,8 @@ def get_daylong_arguments(argv=None):
302
302
args .pre_filt = [float (val ) for val in args .pre_filt .split (',' )]
303
303
args .pre_filt = sorted (args .pre_filt )
304
304
if (len (args .pre_filt )) != 4 :
305
- msg = ("Error: --pre-filt should contain 4 "
306
- "comma-separated floats" )
305
+ msg = ("Error: --pre-filt should contain 4 " +
306
+ "comma-separated floats" )
307
307
parser .error (msg )
308
308
309
309
return args
@@ -416,8 +416,8 @@ def main(args=None):
416
416
tstamp = str (t1 .year ).zfill (4 )+ '.' + str (t1 .julday ).zfill (3 )+ '.'
417
417
418
418
print ("\n " + "*" * 60 )
419
- print ("* Downloading day-long data for key " + stkey +
420
- " and day " + str ( t1 .year ) + "." + str ( t1 .julday ))
419
+ print ("* Downloading day-long data for key {0} " +
420
+ " and day {1}.{2:03d}" . format ( stkey , t1 .year , t1 .julday ))
421
421
print ("*" )
422
422
print ("* Channels selected: " + str (args .channels )+ ' and vertical' )
423
423
@@ -455,9 +455,13 @@ def main(args=None):
455
455
"*SAC " )
456
456
print ("* -> Downloading Seismic data... " )
457
457
sth = client .get_waveforms (
458
- network = sta .network , station = sta .station ,
459
- location = sta .location [0 ], channel = channels ,
460
- starttime = t1 , endtime = t2 , attach_response = True )
458
+ network = sta .network ,
459
+ station = sta .station ,
460
+ location = sta .location [0 ],
461
+ channel = channels ,
462
+ starttime = t1 ,
463
+ endtime = t2 ,
464
+ attach_response = True )
461
465
print ("* ...done" )
462
466
463
467
except Exception :
@@ -467,7 +471,7 @@ def main(args=None):
467
471
t2 += dt
468
472
continue
469
473
470
- st = sth
474
+ st = sth . merge ()
471
475
472
476
elif "12" not in args .channels :
473
477
@@ -490,9 +494,13 @@ def main(args=None):
490
494
"*SAC " )
491
495
print ("* -> Downloading Seismic data... " )
492
496
sth = client .get_waveforms (
493
- network = sta .network , station = sta .station ,
494
- location = sta .location [0 ], channel = channels ,
495
- starttime = t1 , endtime = t2 , attach_response = True )
497
+ network = sta .network ,
498
+ station = sta .station ,
499
+ location = sta .location [0 ],
500
+ channel = channels ,
501
+ starttime = t1 ,
502
+ endtime = t2 ,
503
+ attach_response = True )
496
504
print ("* ...done" )
497
505
498
506
except Exception :
@@ -504,9 +512,13 @@ def main(args=None):
504
512
try :
505
513
print ("* -> Downloading Pressure data..." )
506
514
stp = client .get_waveforms (
507
- network = sta .network , station = sta .station ,
508
- location = sta .location [0 ], channel = '?DH' ,
509
- starttime = t1 , endtime = t2 , attach_response = True )
515
+ network = sta .network ,
516
+ station = sta .station ,
517
+ location = sta .location [0 ],
518
+ channel = '?DH' ,
519
+ starttime = t1 ,
520
+ endtime = t2 ,
521
+ attach_response = True )
510
522
print ("* ...done" )
511
523
if len (stp ) > 1 :
512
524
print ("WARNING: There are more than one ?DH trace" )
@@ -527,7 +539,7 @@ def main(args=None):
527
539
t2 += dt
528
540
continue
529
541
530
- st = sth + stp
542
+ st = sth . merge () + stp . merge ()
531
543
532
544
else :
533
545
@@ -552,9 +564,13 @@ def main(args=None):
552
564
"*SAC " )
553
565
print ("* -> Downloading Seismic data... " )
554
566
sth = client .get_waveforms (
555
- network = sta .network , station = sta .station ,
556
- location = sta .location [0 ], channel = channels ,
557
- starttime = t1 , endtime = t2 , attach_response = True )
567
+ network = sta .network ,
568
+ station = sta .station ,
569
+ location = sta .location [0 ],
570
+ channel = channels ,
571
+ starttime = t1 ,
572
+ endtime = t2 ,
573
+ attach_response = True )
558
574
print ("* ...done" )
559
575
560
576
except Exception :
@@ -566,9 +582,13 @@ def main(args=None):
566
582
try :
567
583
print ("* -> Downloading Pressure data..." )
568
584
stp = client .get_waveforms (
569
- network = sta .network , station = sta .station ,
570
- location = sta .location [0 ], channel = '?DH' ,
571
- starttime = t1 , endtime = t2 , attach_response = True )
585
+ network = sta .network ,
586
+ station = sta .station ,
587
+ location = sta .location [0 ],
588
+ channel = '?DH' ,
589
+ starttime = t1 ,
590
+ endtime = t2 ,
591
+ attach_response = True )
572
592
print ("* ...done" )
573
593
if len (stp ) > 1 :
574
594
print ("WARNING: There are more than one ?DH trace" )
@@ -589,7 +609,7 @@ def main(args=None):
589
609
t2 += dt
590
610
continue
591
611
592
- st = sth + stp
612
+ st = sth . merge () + stp . merge ()
593
613
594
614
# Detrend, filter
595
615
st .detrend ('demean' )
@@ -613,7 +633,7 @@ def main(args=None):
613
633
print ("* -> Removing responses - Seismic data" )
614
634
sth .remove_response (pre_filt = args .pre_filt , output = args .units )
615
635
616
- # Extract traces - Z
636
+ # Extract traces - Z
617
637
trZ = sth .select (component = args .zcomp )[0 ]
618
638
trZ = utils .update_stats (
619
639
trZ , sta .latitude , sta .longitude , sta .elevation ,
0 commit comments