Closed aleran84 closed 4 years ago
You want to stack them np.column_stack([CDP_X, CDP_Y])
, or a function called zip [1]. Like your previous issue, this is not really segyio related, but rather general python programming. Do you maybe need additional resources for learning details of python and numpy?
import segyio import numpy as np import sys np.set_printoptions(threshold=sys.maxsize) 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)[:] CDP_Y = f.attributes(segyio.TraceField.CDP_Y)[:] a=[[CDP_X],[CDP_Y]] for i in range(len(a)): print(CDP_X[:],CDP_Y[:])
else: i += 1