Hi Evan,
before going into the xml format, I'd like to mention that you do not necessarily need an xml file (or any file) to define a microphone geometry in Acoular.
You also could just define a MicGeom object an directly add the coordinates you want. Say you have an array with five microphones. You then can define the positions via:
--------------
my_mics = acoular.MicGeom()
my_mics.mpos_tot = numpy.array([[x1,x2,x3,x4,x5], [y1,y2,y3,y4,y5], [z1,z2,z3,z4,z5]])
--------------
- and you're good to go. Just remember that Acoular uses a left-oriented coordinate system, so you might have to invert your z-values if they are non-zero.
Exporting Acoular-readable xml mic geometries is not (yet) part of the package, so I'm just going to copy-paste some code I usually use for generating microphone geometry files:
--------------
from pylab import *
x = ...some 1D array with x coords...
y = ...some 1D array with y coords...
z = ...some 1D array with z coords...
name = 'my_mics'
filename = name+'.xml'
f = open(filename,'a')
f.write('<?xml version="1.0" encoding="utf-8"?>\n<MicArray name="%s">\n'%name)
for i in range(len(x)):
f.write(' <pos Name="Point %s' % str(i+1))
f.write('" x=" %1.9f' %x[i])
f.write('" y=" %1.9f' %y[i])
f.write('" z=" %1.9f" />\n' %z[i])
f.write('</MicArray>\n')
f.close()
--------------
Best regards,
Gert