reshaping array
Closed this issue · 3 comments
Dear Dr. Wu
thank you for your great effort
I tried to run the prediction code on my seismic data but i get this error :
> ---------------------------------------------------------------------------
> ValueError Traceback (most recent call last)
> <ipython-input-17-a6f9f679a0d0> in <module>()
> 15 p2 = (n2-os)*c2+os
> 16 p3 = (n3-os)*c3+os
> ---> 17 gx = np.reshape(gx,(m1,m2,m3))
> 18 gp = np.zeros((p1,p2,p3),dtype=np.single)
> 19 gy = np.zeros((p1,p2,p3),dtype=np.single)
>
> 1 frames
> /usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
> 54 def _wrapfunc(obj, method, *args, **kwds):
> 55 try:
> ---> 56 return getattr(obj, method)(*args, **kwds)
> 57
> 58 # An AttributeError occurs if the object does not have
>
> ValueError: cannot reshape array of size 259428618 into shape (621,1117,1570)
I'm sure that i have 621 inline , 1117 xline and 1570 time slice
so isn't that should represent [m1][m2][m3] ?
one more thing, I'm using SEGY format, as i read from your previous comment it should be fine, isn't it?
again thank you for your project.
Ahmad Bahaa.
Dear @ahmadbahaa ,
How you open your segy?
In my case I used the following snippet that works as expected:
import segyio
file_path ='../SFD-CNN-TL/gsb.sgy'
data = segyio.tools.cube(file_path)
...
gx,m1,m2,m3 = data,data.shape[0],data.shape[1],data.shape[2]
Another point of attention is the choice of k1,k2,k3 to visualize the results. This is the index of the slice that you want to see that should be computed in this way:
k1=(inline_number - inline_min)/inline_step
k2=(crossline_number - crossline_min)/crossline_step
k3=(z_number - z_min)/z_step
Where inline_number
, crossline_number
, and z_number
are the survey slice index that you want to see. Eg: If you want do see Inline 244 in F3 Block:
inline_number = 244
inline_min = 100
inline_step = 1
k1=(inline_number - inline_min)/inline_step
So k1
will be 144.
Best,
Dear @augustoicaro
Thanks a lot, that's solve the problem and made my day.
just another hero without cape.
hope you have have a merry Christmas.
Dear @ahmadbahaa,
You're welcome. I will organize a repository soon with all available fault detections implementations to quickly compare the results with other methods.
I hope you have a merry Christmas too.
Best,