Comments (9)
What have you typed to get the output above?
Is the formatting I have applied correct (see mastering markdown for how to format markdown)?
Is traces
a list of streams as required here?
from eqcorrscan.
- linstack = stacking.linstack(traces) called from multi_trace_plot
- I do not understand the question
- Yes list with 16 <obspy.core.stream.Stream objects
from eqcorrscan.
- I meant the print statements, how did you get this:
1 Trace(s) in Stream:
AF.WHYM.03.SHZ | 2009-03-16T17:32:26.770000Z - 2009-03-16T17:32:26.770000Z | 200.0 Hz, 0 samples
0
matchtr []
/usr/local/lib/python2.7/dist-packages/numpy/core/_methods.py:59: RuntimeWarning: Mean of empty slice.
warnings.warn("Mean of empty slice.", RuntimeWarning)
/usr/local/lib/python2.7/dist-packages/numpy/core/_methods.py:70: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
norm []
norm_nantonum []
[] 180000
?
2. I edited your comment so that the code output is formatted, does this look correct to you (as in is it what you saw in your terminal), if not, please format it - in general a working (or failing in this case, but reproducible) example is most helpful.
3. Golden, do all traces of all streams have data in them?
from eqcorrscan.
- I added print commands after every line where the problem occurs:
for i in range(1, len(streams)):
for tr in stack:
tr.plot()
matchtr = streams[i].select(station=tr.stats.station,
channel=tr.stats.channel)
print(matchtr)
print(len(matchtr[0].data))
if matchtr:
# Normalize the data before stacking
if normalize:
print('matchtr',matchtr[0].data)
norm = matchtr[0].data /\
np.sqrt(np.mean(np.square(matchtr[0].data)))
print('norm',norm)
norm = np.nan_to_num(norm)
print('norm_nantonum',norm)
else:
norm = matchtr[0].data
print(norm,len(tr.data))
tr.data = np.sum((norm, tr.data), axis=0)
return stack
- tr.plot() in 3.rd line shows me the data, so I don't know if it is the streams[i].select part or something else, if I change the order of the streams or remove the last stream, it's the same problem with whatever stream is last in the list, output for second last from same print commands is:
1 Trace(s) in Stream:
AF.WHYM.03.SHZ | 2009-03-15T04:59:58.295000Z - 2009-03-15T05:14:58.290000Z | 200.0 Hz, 180000 samples
180000
matchtr [ 0.00777793 0.05530805 0.18358414 ..., -1.03355332 -1.84595387
0.00971802]
norm [ 0.00015242 0.00108381 0.00359751 ..., -0.02025346 -0.03617322
0.00019043]
norm_nantonum [ 0.00015242 0.00108381 0.00359751 ..., -0.02025346 -0.03617322
0.00019043]
[ 0.00015242 0.00108381 0.00359751 ..., -0.02025346 -0.03617322
0.00019043] 180000
from eqcorrscan.
It looks like you have a stream with an empty trace in it?
Please try to format code, it makes it much easier to read, it's really easy to do...
from eqcorrscan.
I get the same problem with 2 other completely different datasets, and I already spent many hours on this. It is not as simple as one empty trace, I can assure you that
from eqcorrscan.
Can you email me the streams?
from eqcorrscan.
The streams are not empty but there is something weird about them, I think the first one might be a collection of traces rather than individual traces
from eqcorrscan.
I have now been able to narrow down the problem with the data in traces disappearing: In if realign:
in plotting.multi_trace_plot the line _pick.time -= shifts[i]
resulted in an error because shifts[i] is a tuple and not a float, so I changed it to _pick.time -= shifts[i][1]
which solved the problem but may have caused my problem. If you add the line print("Len Traces data", [len(traces[i].data) for i in range(0,len(traces))])
before and after the if loop it results in the first value for the traces[0].data to be empty (but the stream not being empty because the header info is there) resulting in the problem in linstack. So I may have caused the problem myself through the correction I made, but I don't understand why this hadn't been an issue before.
from eqcorrscan.
Related Issues (20)
- Correlation time series HOT 1
- Template write / read merges traces in rare case where traces from same channel align exactly HOT 2
- Cannot find compiled libtuils on Windows HOT 1
- original template pick time and time after lag_calc is not same HOT 6
- Release 0.4.4 HOT 5
- [PACKAGING BUG] Template Creation - ValueError: Unknown window type (hanning) HOT 2
- Problem with low sample rates HOT 5
- Plotting return_figure docs do not match default
- Party.lag_calc unclear what happens if stream does not cover all detections
- WIP: Speed up a few slowdowns when handling large datasets HOT 11
- [HELP] Can't install EQcorrscan on Apple M1 from conda-forge HOT 3
- pre-processing GPU support
- pytest fixtures in correlate_test alter omp threads
- Int overflow error in decluster unreported HOT 1
- Suppressed self-detection correlations if resampled samples do not align
- [HELP] - I can't install in minicoda packages are not available HOT 5
- Version 0.5.0
- [HELP] - Installation of EQcorrscan HOT 3
- [HELP] - create template through FDSN client HOT 3
- [HELP] write_correlations has a too many values to unpack error. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eqcorrscan.