Skip to content

Commit

Permalink
Add comment lines removeal in UBCoctree read-in function (! comment s…
Browse files Browse the repository at this point in the history
…ymbol)
  • Loading branch information
grosenkj committed Jul 28, 2016
1 parent 51d82ee commit ef8f9ea
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions SimPEG/Mesh/MeshIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,21 @@ def readUBC(TreeMesh, meshFile):
:return list of ndarray's: models as a list of numpy array's
"""

## Read the file lines
fileLines = np.genfromtxt(meshFile,dtype=str,delimiter='\n')
# Read the file lines
fileLines = np.genfromtxt(meshFile, dtype=str,
delimiter='\n', comments='!')
# Extract the data
nCunderMesh = np.array(fileLines[0].split(),dtype=float)
nCunderMesh = np.array(fileLines[0].
plit('!')[0].split(), dtype=float)
# I think this is the case?
if np.unique(nCunderMesh).size >1:
raise Exception('SimPEG TreeMeshes have the same number of cell in all directions')
tswCorn = np.array(fileLines[1].split(),dtype=float)
smallCell = np.array(fileLines[2].split(),dtype=float)
nrCells = np.array(fileLines[3].split(),dtype=float)
tswCorn = np.array(fileLines[1].
split('!')[0].split(), dtype=float)
smallCell = np.array(fileLines[2].
split('!')[0].split(), dtype=float)
nrCells = np.array(fileLines[3].
split('!')[0].split(), dtype=float)
# Read the index array
indArr = np.genfromtxt(fileLines[4::],dtype=np.int)

Expand Down

0 comments on commit ef8f9ea

Please sign in to comment.