equinor / segyio

Fast Python library for SEGY files.
Other
469 stars 213 forks source link

How segio working in open process? #551

Open bohan12 opened 1 year ago

bohan12 commented 1 year ago

Hi I am a beginner of earth science researcher, first thanks for your amazing open source packages, it really helpful in my research process. And tow of questions I want to ask.

First question, I got a problem of segio.open(), what segio doing in open step, it scan part of segy data?

Second question, I use the data in Cloud service and the normal download speed is around 70m/s(by monitor system report), but when I use segyio to open the data only have 20m/s. This cause the bytes read each time?

Thanks for your reply.

ErlendHaa commented 1 year ago

Hi! Sorry for the late answer.

In the simplest case, where segyio ignores geometry segyio.open("file.segy", ignore_geometry=True) all it does it to parse the binary header to get the trace count and trace lengths and verify that it matches up with file size.

If geometry is infered, which is the default behavior, segyio will scan trace headers of a full line (inline if inline sorted, crossline if crossline sorted) to establish the inline/crossline/offset counts.

I'm unsure what's going on there. Segyio lazily reads traces when you access them. There might be some overhead if yuo have a slow network disk and do a lot of small reads, but it's hard to jugde