# obspy-users Digest, Vol 58, Issue 16

**URL:** <https://discourse.obspy.org/t/obspy-users-digest-vol-58-issue-16/448>\
**Category:** Users Mailing List Archive\
**Tags:** archive\
**Created:** [September 22, 2015, 7:12am UTC](https://discourse.obspy.org/t/obspy-users-digest-vol-58-issue-16/448 "2015-09-22T07:12:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esteban\_Chaves](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/e/ea5d25/32.png) [@Esteban\_Chaves](https://discourse.obspy.org/u/Esteban_Chaves)\
**Post date:** [September 22, 2015, 7:12am UTC](https://discourse.obspy.org/t/obspy-users-digest-vol-58-issue-16/448/1 "2015-09-22T07:12:25Z")

</div>

Hi Martin;

My fault, I forgot to include the next part:

file = open(‘meca.dat’,‘r’)  
lines = file.readlines()  
file.close()

x1 =  
x2=  
x3=  
x4=  
x5=  
x6=

for line in lines:  
p=line.split()  
x1.append(float(p[0]))  
x2.append(float(p[1]))  
x3.append(float(p[2]))  
x4.append(float(p[3]))  
x5.append(float(p[4]))  
x6.append(float(p[5]))

strike=np.array(x1)  
dip=np.array(x2)  
rake=np.array(x3)  
dep=np.array(x4)  
vrd=np.array(x5)  
mag=np.array(x6)

What about the focal mechanism?

Thanks,

-Esteban

---

<div class="post-metadata">

**Author:** ![Martin\_Gal](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@Martin\_Gal](https://discourse.obspy.org/u/Martin_Gal)\
**Post date:** [September 22, 2015, 10:14am UTC](https://discourse.obspy.org/t/obspy-users-digest-vol-58-issue-16/448/2 "2015-09-22T10:14:17Z")

</div>

Hi Esteban,

a quick fix might be

for i in range(len(x1)):  
bball = Beach([strike[i], dip[i], rake[i]], xy=([dep[i],vrd[i]]), width=(0.80,0.45), linewidth=1, alpha=0.85)  
bball.set\_zorder(1)  
ax.add\_collection(bball)

This should work but isn’t very elegant. I have not worked with Beach before, so I have no idea what it is good for.  
Hope it works for you.

Cheers,  
Martin
