sergiventosa / ts-PWS

Time-scale phase-weighted stack software for seismic signal denoising
GNU Lesser General Public License v3.0
37 stars 18 forks source link

Error reading header #1

Closed omrivolk closed 6 years ago

omrivolk commented 6 years ago

Hi,

I'm trying to stack some cross-correlations which I computed in Python. I wrote the cross-correlations to SAC files and tried stacking them and I get this error:

gcc -Wall -O3 -march=native -fopenmp -o ts_pws ts_pws1e.o ts_pws1e_lib.o wavelet_v7.o wavelet_def_v7.o wavelet_mem_v7.o cdotx.o myallocs.o prnmsg.o /usr/local/sac/lib/sacio.a -lm
gcc -Wall -O3 -march=native -fopenmp -o sac2bin sac2bin.o /usr/local/sac/lib/sacio.a -lm
 tspws_main: Error reading HOT2728/00.sac header (nerr=1336)

But if I just try to read the files with SAC it reads them perfectly. Any idea how can I deal with that?

Thanks Omry

omrivolk commented 6 years ago

Found it. The problem was in the name of the file. It should be named with the format given in the examples

omrivolk commented 6 years ago

So apparently I didn't find the solution...

Just to clarify, I have files that I want to stack. I can read them with SAC but ts-PWS gives the above error.

sergiventosa commented 6 years ago

Hi Omry,

This error means that a required sac header field is undefined. Can you check that npts, stla, stlo, evla, evlo, delta and b are defined (call lh in sac)? For the stacking only npts, delta and b are needed, you may use dummy values for the others. I should probably give more informative errors.

Thanks to you, Sergi

omrivolk commented 6 years ago

The problem was that stla, stlo, evla and evlo were missing from the header. I put in dummy values and now it works great.

Thanks!