Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
print(f"\tinlines: {len(spec.ilines)}")
print(f"\tcrosslines: {len(spec.xlines)}")
with segyio.create(filename, spec) as f:
# one inline consists of 50 traces
# which in turn consists of 2000 samples
step = 0.00001
start = step * len(spec.samples)
# fill a trace with predictable values: left-of-comma is the inline
# number. Immediately right of comma is the crossline number
# the rightmost digits is the index of the sample in that trace meaning
# looking up an inline's i's jth crosslines' k should be roughly equal
# to i.j0k
trace = np.linspace(-1, 1, len(spec.samples), True, dtype=np.single)
if sorting == segyio.TraceSortingFormat.INLINE_SORTING:
# Write the file trace-by-trace and update headers with iline, xline
# and offset
tr = 0
for il in spec.ilines:
for xl in spec.xlines:
if masklambda(il, xl):
f.header[tr] = {segyio.su.offset: 1, segyio.su.iline: il, segyio.su.xline: xl}
f.trace[tr] = trace * ((xl / 100.0) + il)
tr += 1
f.bin.update(tsort=segyio.TraceSortingFormat.CROSSLINE_SORTING)
else:
# Write the file trace-by-trace and update headers with iline, xline
# and offset
tr = 0
for il in spec.ilines:
def sorting(self):
return segyio.TraceSortingFormat.CROSSLINE_SORTING