Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read a large segy file #9

Open
FJGEODEV opened this issue Aug 14, 2024 · 3 comments
Open

Read a large segy file #9

FJGEODEV opened this issue Aug 14, 2024 · 3 comments

Comments

@FJGEODEV
Copy link

Hi, thanks for your work, really appreciated!

One question: when I'm reading a large segy file, using this line:

from cigsegy import SegyNP
d = SegyNP('3Dpoststack.sgy')
d.shape # (ni, nx, nt), use as a numpy array, 3D geometry

In this case, is "d" already in RAM or not yet? since you can calculate d.min() and d.max(), I assume d is already read into RAM.

However, in the main page, you mentioned "Access the SEG-Y file as a 3D numpy array, without reading the whole file into memory", kind of confused to me.

I'm looking for a solution that could read unstructured data but not into memory yet, I will pick specific inline_number and crossline_number to read into RAM.

Thanks.

@JintaoLee-Roger
Copy link
Owner

Hi,
I just scan the SEG-Y file, and obtain some geometric information. So, in your case, d is not in RAM.

Why can use d.min() and d.max()?

See this: segynp

sx.min(), sx.max()
# get the min and max value, but they are evaluated from a part of data,
# so they may not be the real min and max value

The minimum and maximum values are not the real values. When d is instantiated, I read 12000 traces (4000 in the front, 4000 in the middle, and 4000 in the last) to calculate min() and max(). You can see here:

def _eval_range(self):

@JintaoLee-Roger
Copy link
Owner

Since we're not reading the data into memory, reading the time slices will be slower.

>>> d[30] # fast 
>>> d[:, 30, :]
>>> d[:, :, 30] # slow

@FJGEODEV
Copy link
Author

Thanks for your reply. You are right, I missed the eval_range part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants