Hi
Sorry for the late reply. Quick suggestion, would it perhaps be reasonable to update the code in line 1219 then read:
if len(tr.data) >= self.max_npts/len(self.stream)
(or better yet save len(self.stream) to a variable prior to iterating over the traces and use variable for scaling), and then removing lines 124-127?
The idea being that resampling would only be triggered if number of data samples is roughly 400,000, for an exact solution (including respecting the method
argument) an alternative could be:
have_points = sum([len(tr.data) for tr in self.stream])*len(self.stream)
for _i, tr in enumerate(self.stream):
if have_points > self.max_npts and self.plotting_method is None or self.plotting_method == "fast":
tmp_data = singal.resample(tr.data, self.max_npts)
else
tmp_data = tr.data
Regarding the scaling of plotting a single trace using type=section
I get the same results regardless if I use norm_method=trace
or norm_method=stream
which is a straight thin line. E.g. using this (240 KB) file and the code
from obspy import read
wf = read('wf1.mseed')
wf.stats.distance = 1000
wf.plot()
wf.plot(type='section')
wf.plot(type='section',norm_method='trace')
wf.plot(type='section,norm_method='stream'')
Displays the waveform nicely only in the first case, wf.plot()
, whereas in the cases where type='section'
is used the trace is just a straight line (presumably due to some issue with scaling algorithm when only one trace is in the stream object - and yes I read that norm_method
defaults to 'trace'
).
(while at it there seems to be a space missing between normalisations
and are
in the message returned if an invalid value is set on norm_method
- message at present is: ValueError: Define a normalisation method. Valid normalisationsare 'trace', 'stream'. See documentation.
)