diff options
-rwxr-xr-x | makeBoundary.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/makeBoundary.py b/makeBoundary.py index 3876e1e..730f96d 100755 --- a/makeBoundary.py +++ b/makeBoundary.py @@ -54,6 +54,28 @@ print('dX =', dX) #print(ncols, nrows) +# extract slices from height data array. Note: xyz format uses ncols +# blocks, with nrows lines per block. +if location == 'top': + xin = xtp[nrows-1:len(xtp):nrows] + yin = ytp[nrows-1:len(xtp):nrows] + zin = ztp[nrows-1:len(xtp):nrows] +elif location == 'bottom': + xin = xtp[0:len(xtp):nrows] + yin = ytp[0:len(xtp):nrows] + zin = ztp[0:len(xtp):nrows] +elif location == 'left': + xin = xtp[:nrows] + yin = ytp[:nrows] + zin = ztp[:nrows] +elif location == 'right': + xin = xtp[nrows*(ncols-1):] + yin = ytp[nrows*(ncols-1):] + zin = ztp[nrows*(ncols-1):] + + +print(xin) + # array index and co-ordinates are related by: # index = (co-ord - 0.25)*2 xregion = xin[280:301] |