warnings.warn("CREATING TRACE HEADER") - Problems in creating trace header

Dear all,

I commonly work with some 2D SEG-Y seismic files that has some zero coordinates at the beginning and at the end of the file, this is a problem for some of the interpretation platforms I use, so I wrote a simple script to take these coordinates off.

So, I have this numpy array which I need to put into a stream in order to write a new SEG-Y file, but I’m receiving this message :

The lines I’m using to build the stream are the following:

st = Stream()

for i in 103_np_nozero:

defined_header = {‘delta’: 0.000125}

trace = Trace(i, header=defined_header)

st.append(trace)

the ‘103_np_nozero’ is my numpy array

Thank you all, cheers.

César

Hi Cesar,

the warning you are seeing is appearing because you did not specify a SEG-Y trace header. It would have to be set at tr.stats.segy.trace_header.

ObsPy will create a default header but that might not be the user’s intention and it thus raises this warning. If it works for you no need to worry about it. Note that you might want to copy over the SEG-Y headers from the original file to preserve the SEG-Y headers. The default header can onlyb be created by whatever is stored in tr.stats. (copy with e.g. new_trace.stats.segy.trace_header = old_trace.stats.segy.trace_header)

Cheers!

Lion