segpy icon indicating copy to clipboard operation
segpy copied to clipboard

how to get data

Open data-inversion opened this issue 7 years ago • 3 comments

hi,l want to get the 3D seismic data in python env.but l search for long time ,l don't find the method ,l have get the file. image

data-inversion avatar Dec 03 '18 03:12 data-inversion

The error message tells you that data is an array.array. This is a collection type from the Python Standard Library. You can read about it in the Python documentation. As the error says, the array type does not have a an attributes called type. You can get the type code using the typecode attribute

rob-smallshire avatar Dec 04 '18 21:12 rob-smallshire

Hi, You can find the number of traces and run a for loop to extract signal at each trace by finding out index at particular inline/xline. Then, use the index to extract data from the location.

total_inL=segy_reader.num_inlines() #total number of inlines total_xL=segy_reader.num_xlines() #total number of xlines inL_range = segy_reader.inline_numbers() #inline range xL_range = segy_reader.xline_numbers() #xline range inL = np.array(inL_range) # Inline numbers xL = np.array(xL_range) #xL numbers trace_num = segy_reader.num_traces() #Total number of traces

for loop start

    indx_temp = segy_reader.trace_index(inl_xl_tuple_temp)
    sample_temp = segy_reader.trace_samples(indx_temp)

for loop end

SoumiC avatar Jan 25 '19 11:01 SoumiC

You can also use the inline_xline_numbers() method to give an iterator which generates all the valid (inline, xline) tuples:

for inline_xline in segy_reader.inline_xline_numbers():
    index = segy_reader.trace_index(inline_xline)
    samples = segy_reader.trace_samples(index)
    # Do something with the samples array 

rob-smallshire avatar Jan 25 '19 11:01 rob-smallshire