@@ -88,6 +88,13 @@ def get_daylong_arguments(argv=None):
88
88
"for tilt correction. Specifying 'P' allows for compliance " +
89
89
"correction. [Default '12,P' looks for both horizontal and " +
90
90
"pressure and allows for both tilt AND compliance corrections]" )
91
+ parser .add_argument (
92
+ "--zcomp" ,
93
+ dest = "zcomp" ,
94
+ type = str ,
95
+ default = "Z" ,
96
+ help = "Specify the Vertical Component Channel Identifier. " +
97
+ "[Default Z]." )
91
98
parser .add_argument (
92
99
"-O" , "--overwrite" ,
93
100
action = "store_true" ,
@@ -102,23 +109,32 @@ def get_daylong_arguments(argv=None):
102
109
description = "Settings associated with which "
103
110
"datacenter to log into." )
104
111
ServerGroup .add_argument (
105
- "-S" , "--Server " ,
112
+ "-S" , "--server " ,
106
113
action = "store" ,
107
114
type = str ,
108
- dest = "Server " ,
115
+ dest = "server " ,
109
116
default = "IRIS" ,
110
117
help = "Specify the server to connect to. Options include: " +
111
118
"BGR, ETH, GEONET, GFZ, INGV, IPGP, IRIS, KOERI, LMU, NCEDC, " +
112
119
"NEIP, NERIES, ODC, ORFEUS, RESIF, SCEDC, USGS, USP. " +
113
120
"[Default IRIS]" )
114
121
ServerGroup .add_argument (
115
- "-U" , "--User-Auth" ,
122
+ "--server-url" ,
123
+ action = "store" ,
124
+ type = str ,
125
+ dest = "server_url" ,
126
+ default = None ,
127
+ help = "Specify the obspy base_url server address (and port if needed) " +
128
+ "to open for the fdsn client. Overrides any settings to '--server'. " +
129
+ "[Default None]" )
130
+ ServerGroup .add_argument (
131
+ "-U" , "--user-auth" ,
116
132
action = "store" ,
117
133
type = str ,
118
- dest = "UserAuth " ,
134
+ dest = "userauth " ,
119
135
default = "" ,
120
- help = "Enter your IRIS Authentification Username and Password " +
121
- "(--User-Auth ='username:authpassword') to access and download " +
136
+ help = "Enter your Authentification Username and Password " +
137
+ "(--user-auth ='username:authpassword') to access and download " +
122
138
"restricted data. [Default no user and password]" )
123
139
124
140
"""
@@ -243,16 +259,16 @@ def get_daylong_arguments(argv=None):
243
259
args .endT = None
244
260
245
261
# Parse User Authentification
246
- if not len (args .UserAuth ) == 0 :
247
- tt = args .UserAuth .split (':' )
262
+ if not len (args .userauth ) == 0 :
263
+ tt = args .userauth .split (':' )
248
264
if not len (tt ) == 2 :
249
265
parser .error (
250
266
"Error: Incorrect Username and Password Strings for " +
251
267
"User Authentification" )
252
268
else :
253
- args .UserAuth = tt
269
+ args .userauth = tt
254
270
else :
255
- args .UserAuth = []
271
+ args .userauth = []
256
272
257
273
# # Parse Local Data directories
258
274
# if args.localdata is not None:
@@ -323,11 +339,24 @@ def main(args=None):
323
339
datapath .mkdir (parents = True )
324
340
325
341
# Establish client
326
- if len (args .UserAuth ) == 0 :
327
- client = Client (args .Server )
342
+ if len (args .userauth ) == 0 :
343
+ if args .server_url is not None :
344
+ client = Client (
345
+ base_url = args .server_url )
346
+ else :
347
+ client = Client (
348
+ args .server )
328
349
else :
329
- client = Client (
330
- args .Server , user = args .UserAuth [0 ], password = args .UserAuth [1 ])
350
+ if args .server_url is not None :
351
+ client = Client (
352
+ base_url = args .server_url ,
353
+ user = args .userauth [0 ],
354
+ password = args .userauth [1 ])
355
+ else :
356
+ client = Client (
357
+ args .server ,
358
+ user = args .userauth [0 ],
359
+ password = args .userauth [1 ])
331
360
332
361
# Get catalogue search start time
333
362
if args .startT is None :
@@ -420,7 +449,7 @@ def main(args=None):
420
449
continue
421
450
422
451
channels = sta .channel .upper ()+ '1,' + sta .channel .upper () + \
423
- '2,' + sta .channel .upper ()+ 'Z'
452
+ '2,' + sta .channel .upper ()+ args . zcomp
424
453
425
454
# Get waveforms from client
426
455
try :
@@ -455,7 +484,7 @@ def main(args=None):
455
484
t2 += dt
456
485
continue
457
486
458
- channels = sta .channel .upper () + 'Z'
487
+ channels = sta .channel .upper () + args . zcomp
459
488
460
489
# Get waveforms from client
461
490
try :
@@ -517,7 +546,7 @@ def main(args=None):
517
546
continue
518
547
519
548
channels = sta .channel .upper ()+ '1,' + sta .channel .upper () + \
520
- '2,' + sta .channel .upper ()+ 'Z'
549
+ '2,' + sta .channel .upper ()+ args . zcomp
521
550
522
551
# Get waveforms from client
523
552
try :
@@ -580,14 +609,14 @@ def main(args=None):
580
609
continue
581
610
582
611
sth = st .select (component = '1' ) + st .select (component = '2' ) + \
583
- st .select (component = 'Z' )
612
+ st .select (component = args . zcomp )
584
613
585
614
# Remove responses
586
615
print ("* -> Removing responses - Seismic data" )
587
616
sth .remove_response (pre_filt = args .pre_filt , output = args .units )
588
617
589
- # Extract traces - Z
590
- trZ = sth .select (component = 'Z' )[0 ]
618
+ # Extract traces - Z
619
+ trZ = sth .select (component = args . zcomp )[0 ]
591
620
trZ = utils .update_stats (
592
621
trZ , sta .latitude , sta .longitude , sta .elevation ,
593
622
sta .channel + 'Z' )
0 commit comments