Closed Ruaa93 closed 4 years ago
Hi,
It's pretty much right there in the message - for it to be a cube, all inlines must be unique and regular, which they're not for your file. Open the file with ignore_geometry = True to make segyio not try to understand the survey as a cube, and instead just a bunch of traces. From there you can inspect header words and figure out what's going on.
https://segyio.readthedocs.io/en/latest/segyio.html#segyio.open
hi @jokva
thank you for your reply. how about for the other question, if i have 10 time slices in my segy when i run the below it displays the first time slide. how can i plot the 10 time slices(loop)? fig = plt.figure(figsize=(10,6)) ax = fig.add_subplot(121) sim = ax.imshow(fault[:,:,0]); fig.colorbar(sim, ax=ax) ax.set_xticks([]) ax.set_yticks([]) ax.invert_xaxis()
How do you obtain the value fault? There's not enough information in your snippet. You're on to something though, you need to loop over the individual time slices, and run pretty much what you have there for each iteration of the loop.
the below shows what i run, i'm a bit confused in how to run thru each time slice, can you please explain?
import segyio import numpy as np import matplotlib.pyplot as plt from scipy import ndimage as ndi from shutil import copyfile from skimage import exposure
filename = './3D_Seismic_fault.sgy' fault = segyio.tools.cube(filename)
with segyio.open(filename2, "r") as f: print(f.samples) output: [1400. 1404. 1408. 1412. 1416. 1420. 1424. 1428. 1432. 1436. 1440. 1444.
len(f.depth_slice) output: 51
fig = plt.figure(figsize=(10,6)) ax = fig.add_subplot(121) sim = ax.imshow(fault[:,:,0]); fig.colorbar(sim, ax=ax) ax.set_xticks([]) ax.set_yticks([]) ax.invert_xaxis()
@jokva, what does the error means?? fig = plt.figure(figsize=(30,20)) for n in f.samples: ax = fig.add_subplot() sim[n] = ax.imshow(fault[:,:,n], cmap='gray_r'); fig.colorbar(sim[n], ax=ax) ax.set_xticks([]) ax.set_yticks([]) ax.invert_xaxis()
IndexError Traceback (most recent call last)
Your time slices are the last dimension, so you could grab them like this:
for t in range(len(fault.shape[-1])):
ax.imshow(fault([:, :, t]))
Remember, the array you obtain with cube has lost all connection with the samples in the original files, and are now just zero-indexed.
Hi, I'm trying to load my volume as a cube using (fault = segyio.tools.cube(filename)) and I'm getting the below error, please assist. Also I would like to read and view the time slices one by one to run some operations, how this can be done?
ValueError Traceback (most recent call last)