Skip to content

Commit

Permalink
scattering: disable plotting of spectra for sample data within SC.bui…
Browse files Browse the repository at this point in the history
…ld_channel_list
  • Loading branch information
zerafachris committed May 29, 2024
1 parent fd52d6b commit efcbb28
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scatcluster/processing/scattering.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def build_day_list(self) -> None:

def build_channel_list(self) -> None:
if self.sample_stream is None:
self.process_sample_data()
self.process_sample_data(plot_spectra=False)
self.channel_list = [trace.stats.channel for trace in self.sample_stream]

def stream_process(self, stream: Stream) -> Stream:
Expand Down Expand Up @@ -254,7 +254,7 @@ def plot_sample_spectra(self) -> None:
f'{self.network_name}_sample_transform.png')
plt.show()

def process_sample_data(self) -> None:
def process_sample_data(self, plot_spectra: bool = True) -> None:
"""Process the sample data range. This involes:
(1) load the data and process,
(2) define the sample_times and sample_data,
Expand All @@ -272,7 +272,8 @@ def process_sample_data(self) -> None:
self.sample_times_scatterings = segmentize(self.sample_times, self.network_samples_per_segment,
self.network_samples_per_step)[:, 0]
self.sample_scattering_coefficients = self.net.transform(self.sample_data_segments, self.reduce_type())
self.plot_sample_spectra()
if plot_spectra:
self.plot_sample_spectra()

def plot_seismic(self, sample: bool = False):
"""
Expand Down

0 comments on commit efcbb28

Please sign in to comment.