From f061204f8009171a80e54bf541874070186edd21 Mon Sep 17 00:00:00 2001 From: John Truckenbrodt Date: Fri, 27 Sep 2019 13:59:11 +0200 Subject: [PATCH] [explorer.RasterViewer] extended documentation --- spatialist/explorer.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spatialist/explorer.py b/spatialist/explorer.py index 4b153577..8be4eb10 100644 --- a/spatialist/explorer.py +++ b/spatialist/explorer.py @@ -164,9 +164,9 @@ def __init__(self, filename, cmap='jet', band_indices=None, band_names=None, pmi self.fig = plt.figure(num=title) - # display of SLC amplitude + # left display (image) self.ax1 = self.fig.add_subplot(121) - # display of topographical phase + # right display (time series) self.ax2 = self.fig.add_subplot(122) # self.ax1 = plt.gca() @@ -179,6 +179,7 @@ def __init__(self, filename, cmap='jet', band_indices=None, band_names=None, pmi self.ax1.tick_params(axis='both', which='major', labelsize=self.fontsize) self.ax2.tick_params(axis='both', which='major', labelsize=self.fontsize) + # format the values displayed for the mouse pointer text_pointer = self.ylab + '={0:.2f}, ' + self.xlab + '={1:.2f}, value=' self.ax1.format_coord = lambda x, y: text_pointer.format(y, x) @@ -190,7 +191,7 @@ def __init__(self, filename, cmap='jet', band_indices=None, band_names=None, pmi # set up the vertical profile plot self.__init_vertical_plot() - # make the figure respond to mouse clicks by executing method __onclick + # make the figure responds to mouse clicks by executing method __onclick self.cid1 = self.fig.canvas.mpl_connect('button_press_event', self.__onclick) # enable interaction with the slider @@ -297,7 +298,9 @@ def __onclick(self, event): # redraw the cross-hair self.__reset_crosshair() + # convert the map coordinates collected at the click to image pixel coordinates x, y = self.__map2img(self.x_coord, self.y_coord) + # read the time series at the image coordinates subset_vertical = self.__read_timeseries(x, y) # redraw/clear the vertical profile plot in case stacking is disabled