obspy / obspy

ObsPy: A Python Toolbox for seismology/seismological observatories.
https://www.obspy.org
Other
1.16k stars 532 forks source link

"print stream" with masked values #161

Closed trac2github closed 12 years ago

trac2github commented 12 years ago

after a merge that results in masked values doing a print sums up the number of samples in a trace also counting masked samples.[[BR]] maybe we should change the string representation of the stream in that case... {{{

!python

from obspy.core import read st = read() overlaptrace = st[0].copy() overlaptrace.stats.starttime += 1 st.append(overlaptrace) st.merge() print st print st[0].data.count() }}} The Z-trace only has 200 real samples (100 at the start, 100 at the end) but in the string representation everything looks fine... {{{

!python

3 Trace(s) in Stream: BW.RJOB..EHZ | 2009-08-24T00:20:03.000000Z - 2009-08-24T00:20:33.990000Z | 100.0 Hz, 3100 samples BW.RJOB..EHN | 2009-08-24T00:20:03.000000Z - 2009-08-24T00:20:32.990000Z | 100.0 Hz, 3000 samples BW.RJOB..EHE | 2009-08-24T00:20:03.000000Z - 2009-08-24T00:20:32.990000Z | 100.0 Hz, 3000 samples

200 }}} I think we should make it clear in the string representation how many real samples there are and explicitly mark masked traces (e.g. with "XXX" at the end)

trac2github commented 12 years ago

[barsch](In [1956]) - closes #161 - masked arrays fill be marked using str()/print method on Stream or Trace objects