@@ -442,6 +442,21 @@ def main(args=None):
442
442
file = correctpath / eventfile .stem
443
443
eventstream .save (str (file ) + '.day.pkl' )
444
444
445
+ # Now save as SAC files
446
+ for key , value in tfaverage .tf_list .items ():
447
+ if value and eventstream .ev_list [key ]:
448
+ nameZ = '.sta.' + key + '.'
449
+ nameZ += sta .channel + 'Z.SAC'
450
+ fileZ = correctpath / (eventfile .stem + nameZ )
451
+ trZ = eventstream .sth .select (component = 'Z' )[0 ].copy ()
452
+ trZ .data = eventstream .correct [key ]
453
+ trZ = utils .update_stats (trZ ,
454
+ sta .latitude , sta .longitude ,
455
+ sta .elevation , 'Z' )
456
+ trZ .write (str (fileZ ), format = 'SAC' )
457
+
458
+
459
+
445
460
# This case refers to the "daily" spectral averages
446
461
else :
447
462
if not args .skip_daily :
@@ -483,6 +498,20 @@ def main(args=None):
483
498
file = correctpath / eventfile .stem
484
499
eventstream .save (str (file ) + '.sta.pkl' )
485
500
501
+ # Now save as SAC files
502
+ for key , value in tfaverage .tf_list .items ():
503
+ if value and eventstream .ev_list [key ]:
504
+ nameZ = '.day.' + key + '.'
505
+ nameZ += sta .channel + 'Z.SAC'
506
+ fileZ = correctpath / (eventfile .stem + nameZ )
507
+ trZ = eventstream .sth .select (component = 'Z' )[0 ].copy ()
508
+ trZ .data = eventstream .correct [key ]
509
+ trZ = utils .update_stats (trZ ,
510
+ sta .latitude , sta .longitude ,
511
+ sta .elevation , 'Z' )
512
+ trZ .write (str (fileZ ), format = 'SAC' )
513
+
514
+
486
515
if __name__ == "__main__" :
487
516
488
517
# Run main program
0 commit comments