Esempio n. 1
0
    def __init__(self,
                 parent,
                 controller,
                 units,
                 size=wx.Size(700, 400),
                 rasterList=None,
                 **kwargs):
        BasePlotFrame.__init__(self, parent=parent, size=size, **kwargs)

        self.controller = controller
        self.controller.transectChanged.connect(self.SetTransect)
        self.transect = []
        self.toolbar = ProfileToolbar(parent=self)
        # workaround for http://trac.wxwidgets.org/ticket/13888
        if sys.platform != 'darwin':
            self.SetToolBar(self.toolbar)
        self.SetTitle(_("GRASS Profile Analysis Tool"))
        # in case of degrees, we want to use meters
        self._units = units if 'degree' not in units else 'meters'

        #
        # Init variables
        #
        if rasterList is None:
            self.rasterList = []
        else:
            self.rasterList = rasterList
        self.plottype = 'profile'
        self.coordstr = ''  # string of coordinates for r.profile
        self.seglist = []  # segment endpoint list
        self.ppoints = ''  # segment endpoints data
        self.transect_length = 0.0  # total transect length
        self.ptitle = _('Profile of')  # title of window
        self.colorList = [
            "blue", "red", "green", "yellow", "magenta", "cyan", "aqua",
            "black", "grey", "orange", "brown", "purple", "violet", "indigo"
        ]

        self._initOpts()

        if len(
                self.rasterList
        ) > 0:  # set raster name(s) from layer manager if a map is selected
            self.raster = self.InitRasterOpts(self.rasterList, self.plottype)
        else:
            self.raster = {}

        # determine units (axis labels)
        # maybe, we should not accept these invalid units
        # but ok, trying to handle it here
        if self._units is not None and self._units != '':
            self.xlabel = _('Distance (%s)') % self._units
        else:
            self.xlabel = _("Distance along transect")
        self.ylabel = _("Cell values")

        # Bind events
        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)

        self.SetGraphStyle()
Esempio n. 2
0
 def __init__(self, parent, id = wx.ID_ANY, style = wx.DEFAULT_FRAME_STYLE, 
              size = wx.Size(700, 400), rasterList = [], **kwargs):
     BasePlotFrame.__init__(self, parent, size = size, **kwargs)
     
     self.toolbar = HistogramPlotToolbar(parent = self)
     # workaround for http://trac.wxwidgets.org/ticket/13888
     if sys.platform != 'darwin':
         self.SetToolBar(self.toolbar)
     self.SetTitle(_("GRASS GIS Histogramming Tool"))
     
     #
     # Init variables
     #
     self.rasterList = rasterList
     self.plottype = 'histogram'
     self.group = '' 
     self.ptitle = _('Histogram of')         # title of window
     self.xlabel = _("Raster cell values")   # default X-axis label
     self.ylabel = _("Cell counts")          # default Y-axis label
     self.maptype = 'raster'                 # default type of histogram to plot
     self.histtype = 'count' 
     self.bins = 255
     self.colorList = ["blue", "green", "red", "yellow", "magenta", "cyan", 
                       "aqua", "black", "grey", "orange", "brown", "purple", "violet",
                       "indigo"]
     
     self._initOpts()
     
     if len(self.rasterList) > 0: # set raster name(s) from layer manager if a map is selected
         self.raster = self.InitRasterOpts(self.rasterList, self.plottype)
         wx.CallAfter(self.OnCreateHist, None)
     else:
         self.raster = {}
Esempio n. 3
0
    def __init__(self, parent, id = wx.ID_ANY, style = wx.DEFAULT_FRAME_STYLE, 
                 size = wx.Size(700, 400),
                 rasterList = [], **kwargs):
        BasePlotFrame.__init__(self, parent, size = size, **kwargs)
        
        self.toolbar = ScatterToolbar(parent = self)
        # workaround for http://trac.wxwidgets.org/ticket/13888
        if sys.platform != 'darwin':
            self.SetToolBar(self.toolbar)
        self.SetTitle(_("GRASS Bivariate Scatterplot Tool"))

        #
        # Init variables
        #
        self.rasterList = rasterList
        self.plottype = 'scatter'
        self.ptitle = _('Bivariate Scatterplot')     # title of window
        self.xlabel = _("Raster cell values")           # default X-axis label
        self.ylabel = _("Raster cell values")           # default Y-axis label
        self.maptype = 'raster'                         # default type of scatterplot
        self.scattertype = 'normal' 
        self.bins = 255
        self.colorList = ["blue", "red", "black", "green", "yellow", "magenta", "cyan", \
                    "aqua", "grey", "orange", "brown", "purple", "violet", \
                    "indigo"]
        
        self._initOpts()

        if len(self.rasterList) > 1: # set raster name(s) from layer manager if a map is selected
            self.InitRasterOpts(self.rasterList, 'scatter')
        else:
            self.raster = {}
Esempio n. 4
0
    def __init__(
            self,
            parent,
            giface,
            id=wx.ID_ANY,
            style=wx.DEFAULT_FRAME_STYLE,
            size=wx.Size(700, 400),
            rasterList=[],
            **kwargs,
    ):
        BasePlotFrame.__init__(self,
                               parent,
                               giface=giface,
                               size=size,
                               **kwargs)

        self.toolbar = HistogramPlotToolbar(parent=self)
        # workaround for http://trac.wxwidgets.org/ticket/13888
        if sys.platform != "darwin":
            self.SetToolBar(self.toolbar)
        self.SetTitle(_("Histogram Tool"))

        #
        # Init variables
        #
        self.rasterList = rasterList
        self.plottype = "histogram"
        self.group = ""
        self.ptitle = _("Histogram of")  # title of window
        self.xlabel = _("Raster cell values")  # default X-axis label
        self.ylabel = _("Cell counts")  # default Y-axis label
        self.maptype = "raster"  # default type of histogram to plot
        self.histtype = "count"
        self.bins = 255
        self.colorList = [
            "blue",
            "green",
            "red",
            "yellow",
            "magenta",
            "cyan",
            "aqua",
            "black",
            "grey",
            "orange",
            "brown",
            "purple",
            "violet",
            "indigo",
        ]

        self._initOpts()

        if (len(self.rasterList) > 0
            ):  # set raster name(s) from layer manager if a map is selected
            self.raster = self.InitRasterOpts(self.rasterList, self.plottype)
            wx.CallAfter(self.OnCreateHist, None)
        else:
            self.raster = {}
Esempio n. 5
0
    def __init__(self, parent, controller, units, size=wx.Size(700, 400),
                 rasterList = None, **kwargs):
        BasePlotFrame.__init__(self, parent=parent, size=size, **kwargs)

        self.controller = controller
        self.controller.transectChanged.connect(self.SetTransect)
        self.transect = []
        self.toolbar = ProfileToolbar(parent = self)
        # workaround for http://trac.wxwidgets.org/ticket/13888
        if sys.platform != 'darwin':
            self.SetToolBar(self.toolbar)
        self.SetTitle(_("GRASS Profile Analysis Tool"))
        # in case of degrees, we want to use meters
        self._units = units if 'degree' not in units else 'meters'

        #
        # Init variables
        #
        if rasterList is None:
            self.rasterList = []
        else:
            self.rasterList = rasterList
        self.plottype = 'profile'
        self.coordstr = ''              # string of coordinates for r.profile
        self.seglist = []               # segment endpoint list
        self.ppoints = ''               # segment endpoints data         
        self.transect_length = 0.0      # total transect length        
        self.ptitle = _('Profile of')   # title of window
        self.colorList =  ["blue", "red", "green", "yellow", "magenta", "cyan",
                           "aqua", "black", "grey", "orange", "brown", "purple", "violet",
                           "indigo"]
        
        self._initOpts()

        if len(self.rasterList) > 0: # set raster name(s) from layer manager if a map is selected
            self.raster = self.InitRasterOpts(self.rasterList, self.plottype)
        else:
            self.raster = {}
                
        # determine units (axis labels)
        # maybe, we should not accept these invalid units
        # but ok, trying to handle it here
        if self._units is not None and self._units != '':
            self.xlabel = _('Distance (%s)') % self._units
        else:
            self.xlabel = _("Distance along transect")
        self.ylabel = _("Cell values")

        # Bind events
        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
Esempio n. 6
0
    def __init__(self, parent, giface, id=wx.ID_ANY, style=wx.DEFAULT_FRAME_STYLE,
                 size=wx.Size(700, 400),
                 rasterList=[], **kwargs):
        BasePlotFrame.__init__(self, parent, giface=giface, size=size, **kwargs)

        self.toolbar = ScatterToolbar(parent=self)
        # workaround for http://trac.wxwidgets.org/ticket/13888
        if sys.platform != 'darwin':
            self.SetToolBar(self.toolbar)
        self.SetTitle(_("GRASS Bivariate Scatterplot Tool"))

        #
        # Init variables
        #
        self.rasterList = rasterList
        self.plottype = 'scatter'
        self.ptitle = _('Bivariate Scatterplot')     # title of window
        self.xlabel = _("Raster cell values")           # default X-axis label
        self.ylabel = _("Raster cell values")           # default Y-axis label
        self.maptype = 'raster'                         # default type of scatterplot
        self.scattertype = 'normal'
        self.bins = 255
        self.colorList = [
            "blue",
            "red",
            "black",
            "green",
            "yellow",
            "magenta",
            "cyan",
            "aqua",
            "grey",
            "orange",
            "brown",
            "purple",
            "violet",
            "indigo"]

        self._initOpts()

        if len(
                self.rasterList) > 1:  # set raster name(s) from layer manager if a map is selected
            self.InitRasterOpts(self.rasterList, 'scatter')
        else:
            self.raster = {}
Esempio n. 7
0
    def __init__(self, parent, id = wx.ID_ANY, style = wx.DEFAULT_FRAME_STYLE,
                 size = wx.Size(700, 400),
                 rasterList = [], **kwargs):
        BasePlotFrame.__init__(self, parent, size = size, **kwargs)

        self.toolbar = ProfileToolbar(parent = self)
        self.SetToolBar(self.toolbar)
        self.SetTitle(_("GRASS Profile Analysis Tool"))
        
        #
        # Init variables
        #
        self.rasterList = rasterList
        self.plottype = 'profile'
        self.coordstr = ''              # string of coordinates for r.profile
        self.seglist = []               # segment endpoint list
        self.ppoints = ''               # segment endpoints data         
        self.transect_length = 0.0      # total transect length        
        self.ptitle = _('Profile of')   # title of window
        self.colorList =  ["blue", "red", "green", "yellow", "magenta", "cyan",
                           "aqua", "black", "grey", "orange", "brown", "purple", "violet",
                           "indigo"]

        self._initOpts()
        
        if len(self.rasterList) > 0: # set raster name(s) from layer manager if a map is selected
            self.raster = self.InitRasterOpts(self.rasterList, self.plottype)
        else:
            self.raster = {}
                
        # determine units (axis labels)
        if self.parent.Map.projinfo['units'] != '':
            self.xlabel = _('Distance (%s)') % self.parent.Map.projinfo['units']
        else:
            self.xlabel = _("Distance along transect")
        self.ylabel = _("Cell values")