Files
simpeg/simpegDCIP/Dev/writeUBC_DC2Dobs.py
T
D Fournier 20585bad09 Advance the 2D to 3D interpolation.
Test SimPEG vs DCIP2D and DCIP3D
2015-12-07 16:44:15 -08:00

36 lines
895 B
Python

def writeUBC_DC2Dobs(fileName,Tx,Rx,d,wd):
from SimPEG import np, mkvc
"""
Read UBC GIF DCIP 3D observation file and generate arrays for tx-rx location
Input:
:param fileName, path to the UBC GIF 3D obs file
Output:
:param rx, tx, d, wd
:return
Created on Mon December 7th, 2015
@author: dominiquef
"""
fid = open(fileName,'w')
fid.write('GENERAL FORMAT\n')
for ii in range(len(Tx)):
tx = np.asarray(Tx[ii])
rx = np.asarray(Rx[ii])
nrx = rx.shape[0]
fid.write('\n')
fid.writelines("%e " % ii for ii in mkvc(tx))
fid.write('%i\n'% nrx)
np.savetxt(fid, np.c_[ rx ,np.asarray(d[ii]), np.asarray(wd[ii]) ], fmt='%e',delimiter=' ',newline='\n')
fid.close()