Skip to content

Instantly share code, notes, and snippets.

@aadm
Created August 4, 2016 09:29
Show Gist options
  • Save aadm/e4fc4f74eae1f51dbc6dc7230e09a031 to your computer and use it in GitHub Desktop.
Save aadm/e4fc4f74eae1f51dbc6dc7230e09a031 to your computer and use it in GitHub Desktop.
Little Python script to create seismic polarity cartoons.
import numpy as np
import matplotlib.pyplot as plt
import bruges as b
def disegna_schemino(z, ai, wavelet,titolo):
f, ax = plt.subplots(nrows=1,ncols=2, figsize=(2,2),facecolor='w')
ax[0].plot(ai,z, '-k', lw=4)
ax[1].plot(wavelet, z, '-k', lw=2)
if colori:
ax[1].fill_betweenx(z,wavelet,0, where=wavelet>0, facecolor=[0.6,0.6,1.0], linewidth=0)
ax[1].fill_betweenx(z,wavelet,0, where=wavelet<0, facecolor=[1.0,0.7,0.7], linewidth=0)
else:
ax[1].fill_betweenx(z,wavelet,0, where=wavelet>0, facecolor='black', linewidth=0)
ax[0].set_title('AI', fontsize=8)
ax[1].set_title(titolo, fontsize=8)
ax[0].set_xlim(-1.4,1.4)
ax[1].set_xlim(-1.2,1.2)
for aa in ax:
aa.set_ylim(50,200)
aa.invert_yaxis()
aa.set_yticklabels([])
aa.set_xticklabels([])
aa.xaxis.set_ticks_position('none')
aa.yaxis.set_ticks_position('none')
wavelet=b.filters.ricker(0.25, 0.001, 25)
ai=np.zeros(wavelet.size)
z=np.arange(wavelet.size)
ai[int(wavelet.size/2):]=1
disegna_schemino(z, ai, wavelet, titolo='SEG-normal')
plt.savefig('SEG-normal.png', dpi=300, bbox_inches='tight')
wavelet=b.filters.rotate_phase(wavelet, np.radians(180))
disegna_schemino(z, ai, wavelet, titolo='SEG-reverse')
plt.savefig('SEG-reverse.png', dpi=300, bbox_inches='tight')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment