Closed aleran84 closed 4 years ago
What is the problem, exactly?
I need to get the entire list of coordinates CDP_X and CDP_Y from the segy file. The method CDP_X = f.attributes(segyio.TraceField.CDP_X)[:] specified in the script gives only the first and last three coordinates. While in the file (trace) there are 1300
Have you tried manually extracting the same fields from f.header
, or verified your CDPX/Y from other sources? Your code looks fine, and should give you all different CDPX/Y. Can you post the output?
In the middle column, the selection of the same file by a third-party geophysical program on CDP_X CDP_Y
Try np.unique(CDP_Y)
, it looks like a print-abbreviation issue. Or increase the print limit in numpy.
CDP_X = f.attributes(segyio.TraceField.CDP_X)[:] np.unique(print(CDP_X)) CDP_Y = f.attributes(segyio.TraceField.CDP_Y)[:] np.unique(print(CDP_Y)) ========================= RESTART: D:\Pyhton\import.py ========================= [46387610 46387620 46387630 ... 46381910 46381940 46381970] [824465030 824464870 824464720 ... 824222190 824222040 824221880] The result is the same (((
print(np.unique(CDP_X))
CDP_X = f.attributes(segyio.TraceField.CDP_X)[:] print(np.unique(CDP_X)) CDP_Y = f.attributes(segyio.TraceField.CDP_Y)[:] print(np.unique(CDP_Y)) [46380728 46380732 46380739 ... 46388308 46388309 46388310] [824221880 824222040 824222190 ... 824464720 824464870 824465030
import sys
np.set_printoptions(threshold=sys.maxsize)
The problem is that the print is truncated.
WORKING !!! A little later I will check the correspondence between the headers and the actual data. I am very grateful to you!
Splendid.
import segyio import numpy as np import os directory = 'G:\segy' files = os.listdir(directory) i = 0 while (i < len(files)): if (files[i].endswith('.sgy')): with segyio.open(directory + '/' + files[i],"r") as f: CDP_X = f.attributes(segyio.TraceField.CDP_X)[:] print(CDP_X) CDP_Y = f.attributes(segyio.TraceField.CDP_Y)[:] print(CDP_Y)