Open alpapapo opened 4 years ago
Hi, what are you planning to cut? Time axis or also restrict IL and XL?
Hi Matteo, only time axis. We need the header for each trace though.
Hi Dimitrios, then I don't think you can't do anything better than what this notebooks suggests. Make an empty file and fill all header words. As the length of your traces is changed you can't copy the original file and work on a copy, but since you don't want to shrink IL or XL you can't be smarter and try to just to copy a subset of ILs/XLs.
@jokva do you see any other way to make the process faster?
Thanks Matteo,
Is it possible to loop over the headers and copy them faster one by one?
What we see is that segyio when executing dst.header = segy.header
tries to read the complete segy and since the segy is huge the process fails by trying to create a huge swap file.
@alpapapo do you agree on the behavior we notice?
Hi,
have you tried dst.header.iline = segy.header.iline
as in
https://github.com/equinor/segyio/blob/master/python/examples/copy-sub-cube.py
If the behavior you notice is real (@jokva ?) this may do the copy line by line. Another way is to do it trace by trace
for i in range(segy.tracecount):
dst.header[i] = segy.header[i]
dst.trace[i] = segy.trace[i]
but this one is much slower than dst.header= segy.header
.
Hi Matteo, Thanks for the suggestion, we will check it tomorrow. Can this be related to issue https://github.com/equinor/segyio/issues/423
According to segyio-notebooks/03_basic_segy_editing.ipynb -> Cut all traces, I am creating a minimum size empty segy from a "source" segy file with
spec.samples = spec.samples[:1]
.The thing is that copying
dst.header = src.header
takes too long as the "source" segy is huge. Is there any way to create faster the minimal base segy?