slimgroup / SegyIO.jl

SegyIO.jl provides methods to read, write, and scan SEGY datasets.
MIT License
16 stars 5 forks source link

The number of read traces is fewer by one than the actual nTrc #8

Closed kerim371 closed 2 years ago

kerim371 commented 2 years ago

Hi,

My segy contains 64860 traces and 1501 nsamp. I noticed if I read the the whole data at once I get the correct info:

block = segy_read("filt_mig.sgy");
size(block.data)
# (1501, 64860)

But if I read the same data in SeisCon I get the number of traces 64859 that is one less:

s = scan_file("filt_mig.sgy", ["GroupX"])
size(s.blocks)
# (64859,)

and I don't know why but when I extract header for say GroupX I get two columns (again wrong number of traces i.e. rows):

gx = get_header(s, "GroupX")
# gives 64859×2 Matrix{Int32}:

Cant understand why there are two columns

SegyIO v0.7.5

kerim371 commented 2 years ago

Oh, that is my fault. The library is interesting and it works differently from what I was expecting.

mloubout commented 2 years ago

Hi

Sorry for the delayed response. Yes this may be a little unexpected behavior. The scan function spkits the result into blocks based on the chunks it reads. If you wanna get the actually header you would need to call get_header on each block separately, I. e gx1 = get_header(s.blocks[1], "GroupX")

Hope this package can provide what you need and we'll be happy to improve on any issues

kerim371 commented 2 years ago

@mloubout thank you for explanation Yes the library is very attractive