24
24
from pyrocko .trace import Trace
25
25
from scipy import signal
26
26
27
+ from lightguide .utils import PathStr
28
+
27
29
from .filters import afk_filter
28
30
from .signal import decimation_coefficients
29
31
@@ -417,12 +419,17 @@ def copy(self) -> Blast:
417
419
"""
418
420
return deepcopy (self )
419
421
420
- def save_mseed (self , filename : Path | str ) -> None :
422
+ def save_mseed (self , filename : PathStr ) -> None :
423
+ """Save as miniSeed.
424
+
425
+ Args:
426
+ filename (PathStr):
427
+ """
421
428
filename = Path (filename )
422
429
traces = self .as_traces ()
423
430
io .save (traces , filename_template = str (filename ), format = "mseed" )
424
431
425
- def as_traces (self ):
432
+ def as_traces (self ) -> list [ Trace ] :
426
433
traces = []
427
434
for icha in range (self .n_channels ):
428
435
channel = icha + self .start_channel
@@ -438,6 +445,19 @@ def as_traces(self):
438
445
439
446
@classmethod
440
447
def from_pyrocko (cls , traces : list [Trace ], channel_spacing : float = 0.0 ) -> Blast :
448
+ """Create Blast from a list of Pyrocko traces.
449
+
450
+ Args:
451
+ traces (list[Trace]): List of input traces
452
+ channel_spacing (float, optional): Spatial channel spacing in meter.
453
+ Defaults to 0.0.
454
+
455
+ Raises:
456
+ ValueError: If input is odd.
457
+
458
+ Returns:
459
+ Blast: Assembled Blast.
460
+ """
441
461
if not traces :
442
462
raise ValueError ("Empty list of traces" )
443
463
@@ -547,62 +567,3 @@ def __len__(self) -> int:
547
567
548
568
trim_time = shared_function (Blast .trim_time )
549
569
trim_channels = shared_function (Blast .trim_channels )
550
-
551
- mute_median = shared_function (Blast .mute_median )
552
- one_bit_normalization = shared_function (Blast .one_bit_normalization )
553
- afk_filter = shared_function (Blast .afk_filter )
554
- decimate = shared_function (Blast .decimate )
555
-
556
- trim_time = shared_function (Blast .trim_time )
557
- trim_channels = shared_function (Blast .trim_channels )
558
-
559
- mute_median = shared_function (Blast .mute_median )
560
- one_bit_normalization = shared_function (Blast .one_bit_normalization )
561
- afk_filter = shared_function (Blast .afk_filter )
562
- decimate = shared_function (Blast .decimate )
563
-
564
- trim_time = shared_function (Blast .trim_time )
565
- trim_channels = shared_function (Blast .trim_channels )
566
-
567
- mute_median = shared_function (Blast .mute_median )
568
- one_bit_normalization = shared_function (Blast .one_bit_normalization )
569
- afk_filter = shared_function (Blast .afk_filter )
570
- decimate = shared_function (Blast .decimate )
571
-
572
- trim_time = shared_function (Blast .trim_time )
573
- trim_channels = shared_function (Blast .trim_channels )
574
-
575
- mute_median = shared_function (Blast .mute_median )
576
- one_bit_normalization = shared_function (Blast .one_bit_normalization )
577
- afk_filter = shared_function (Blast .afk_filter )
578
- decimate = shared_function (Blast .decimate )
579
-
580
- trim_time = shared_function (Blast .trim_time )
581
- trim_channels = shared_function (Blast .trim_channels )
582
-
583
- mute_median = shared_function (Blast .mute_median )
584
- one_bit_normalization = shared_function (Blast .one_bit_normalization )
585
- afk_filter = shared_function (Blast .afk_filter )
586
- decimate = shared_function (Blast .decimate )
587
-
588
- trim_time = shared_function (Blast .trim_time )
589
- trim_channels = shared_function (Blast .trim_channels )
590
-
591
- mute_median = shared_function (Blast .mute_median )
592
- one_bit_normalization = shared_function (Blast .one_bit_normalization )
593
- afk_filter = shared_function (Blast .afk_filter )
594
- decimate = shared_function (Blast .decimate )
595
-
596
- trim_time = shared_function (Blast .trim_time )
597
- trim_channels = shared_function (Blast .trim_channels )
598
-
599
- mute_median = shared_function (Blast .mute_median )
600
- one_bit_normalization = shared_function (Blast .one_bit_normalization )
601
- afk_filter = shared_function (Blast .afk_filter )
602
- decimate = shared_function (Blast .decimate )
603
-
604
- trim_time = shared_function (Blast .trim_time )
605
- trim_channels = shared_function (Blast .trim_channels )
606
-
607
- mute_median = shared_function (Blast .mute_median )
608
- one_bit_normalization = shared_function (Blast .one_bit_normalization )
0 commit comments