Skip to content

Commit

Permalink
adjusted how plot_topography works
Browse files Browse the repository at this point in the history
  • Loading branch information
kujaku11 committed May 8, 2019
1 parent e00483a commit 9ee4cd6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/scripts/plot_phase_tensor_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
font_size=5,
lw=0.5,
ellipse_dict = {'ellipse_colorby':'skew_seg',# option to colour by phimin, phimax, skew, skew_seg
'ellipse_range':[-6, 6, 3]} # set color limits - default 0,90 for phimin or max,
'ellipse_range':[-12, 12, 3]} # set color limits - default 0,90 for phimin or max,
# [-12,12] for skew. If plotting skew_seg need to provide
# 3 numbers, the 3rd indicates interval, e.g. [-12,12,3]
)
Expand Down
2 changes: 1 addition & 1 deletion mtpy/modeling/modem/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from mtpy.modeling.modem.model import Model

try:
from evtk.hl import pointsToVTK
from pyevtk.hl import pointsToVTK
except ImportError:
print('If you want to write a vtk file for 3d viewing, you need download '
'and install evtk from https://bitbucket.org/pauloh/pyevtk', file=sys.stderr)
Expand Down
28 changes: 17 additions & 11 deletions mtpy/modeling/modem/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ def plot_mesh_xz(self):

plt.show()

def plot_topograph(self):
def plot_topography(self):
"""
display topography elevation data together with station locations on a cell-index N-E map
:return:
Expand Down Expand Up @@ -1000,8 +1000,8 @@ def plot_topograph(self):
# topography data image
# plt.imshow(elev_mg) # this upside down
# plt.imshow(elev_mg[::-1]) # this will be correct - water shadow flip of the image
imgplot = plt.imshow(self.surface_dict['topography'],
origin='lower') # the orgin is in the lower left corner SW.
x, y = np.meshgrid(self.grid_east, self.grid_north)
imgplot = plt.pcolormesh(x, y, self.surface_dict['topography']) # the orgin is in the lower left corner SW.
divider = make_axes_locatable(ax)
# pad = separation from figure to colorbar
cax = divider.append_axes("right", size="3%", pad=0.2)
Expand All @@ -1022,14 +1022,20 @@ def plot_topograph(self):

# plot station locations in grid

sgindex_x = self.station_grid_index[0]
sgindex_y = self.station_grid_index[1]

self._logger.debug("station grid index x: %s" % sgindex_x)
self._logger.debug("station grid index y: %s" % sgindex_y)

ax.scatter(sgindex_x, sgindex_y, marker='v', c='b', s=2)

# sgindex_x = self.station_grid_index[0]
# sgindex_y = self.station_grid_index[1]
#
# self._logger.debug("station grid index x: %s" % sgindex_x)
# self._logger.debug("station grid index y: %s" % sgindex_y)

#ax.scatter(sgindex_x, sgindex_y, marker='v', c='b', s=2)
ax.scatter(self.station_locations.rel_east,
self.station_locations.rel_north,
marker='v', c='b', s=2)
ax.set_xlim((np.floor(self.station_locations.rel_east.min()),
np.ceil(self.station_locations.rel_east.max())))
ax.set_ylim((np.floor(self.station_locations.rel_north.min()),
np.ceil(self.station_locations.rel_north.max())))
ax.set_xlabel('Easting Cell Index', fontdict={'size': 9, 'weight': 'bold'})
ax.set_ylabel('Northing Cell Index', fontdict={'size': 9, 'weight': 'bold'})
ax.set_title("Elevation and Stations in N-E Map (Cells)")
Expand Down

0 comments on commit 9ee4cd6

Please sign in to comment.