In [7]:
using Seismic, PyPlot

# Shows patching and unpatching untility. It breaks data into windows (Patches) and then puts them
# back without altering the orignal data. It is used for window-based processing such as FX deconv, SSA denoising
# and presstack interpolation/reconstriction.

In [8]:
param2 = Dict(:style=>"mxmyhaz", :min_imx=>10,:max_imx=>100, :min_imy=>35, :max_imy=>45,
               :min_ih=>1, :max_ih=>6, :min_iaz=>0, :max_iaz=>7);

param3 = Dict( :ix1_WL=>30,:ix1_WO=>5);

In [22]:
# *******
file_bin="section_bin"           # Run first Demo_Utils_1_Binning.ipynb
patch_out="patch"                # will make files patch1, patch2,....
file_final ="section_bin_final"  # file put back from patches via code SeisUnPatch
# *******

patch_out,npatch=SeisPatch(file_bin,"patch"; param2...,param3... );


Patches in each dimension 1 4 1 1 1
Number of patches=4
processing patch patch_1
processing patch patch_2
processing patch patch_3
processing patch patch_4

In [14]:
SeisUnPatch(patch_out,file_final; param2...,param3...,nt=251);


creating headers
ipatch= 1 patch_1
1 251 251 15840 1 (251, 15840)
ipatch= 2 patch_2
1 251 251 15840 2 (251, 15840)
ipatch= 3 patch_3
1 251 251 15840 3 (251, 15840)
ipatch= 4 patch_4
1 251 251 8448 4 (251, 8448)

In [19]:
#Plot for QC

db,hb,eb=SeisRead(file_bin);

In [18]:
SeisPlot(db[:,:,5,4,5],xlabel="Trace",ylabel="Time(s)", dy=0.002,oy=0.3,title="Binned data")


Out[18]:
PyObject <matplotlib.image.AxesImage object at 0x12a65c850>

In [20]:
df,hf,ef=SeisRead(file_final);

In [4]:
SeisPlot(df[:,:,5,4,5],xlabel="Trace",ylabel="Time(s)",title="Unpatched result",dy=0.002,oy=0.3)


Out[4]:
PyObject <matplotlib.image.AxesImage object at 0x7f51f71866d0>

In [21]:
dp1,h1,e1=SeisRead("patch_1");
dp2,h2,e2=SeisRead("patch_2");
dp3,h3,e3=SeisRead("patch_3");
dp4,h4,e4=SeisRead("patch_4");
size(dp1)


Out[21]:
(251, 30, 11, 6, 8)

In [4]:
SeisPlot(hcat(dp1[:,:,5,4,5],dp2[:,6:end,5,4,5],dp3[:,6:end,5,4,5],dp4[:,6:end,5,4,5]),xlabel="Trace",ylabel="Time(s)", dy=0.002,oy=0.3,title="Overlapping patches")


Out[4]:
PyObject <matplotlib.image.AxesImage object at 0x7f395cf73fd0>

In [ ]: