GRASS Programmer's Manual  6.4.2(2012)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gui_modules.profile.ProfileFrame Class Reference

Mainframe for displaying profile of raster map. More...

Public Member Functions

def __init__
def OnDrawTransect
 Draws transect to profile in map display.
def OnSelectRaster
 Select raster map(s) to profile.
def SetRaster
 Create coordinate string for profiling.
def SetGraphStyle
 Set plot and text options.
def CreateDatalist
 Build a list of distance, value pairs for points along transect.
def OnCreateProfile
 Main routine for creating a profile.
def DrawPlot
 Draw line and point plot from transect datalist and transect segment endpoint coordinates.
def OnZoom
 Enable zooming and disable dragging.
def OnDrag
 Enable dragging and disable zooming.
def OnRedraw
 Redraw the profile window.
def Update
 Update profile after changing options.
def OnErase
 Erase the profile window.
def SaveToFile
 Save profile to graphics file.
def SaveProfileToFile
 Save r.profile data to a csv file.
def DrawPointLabel
 This is the fuction that defines how the pointLabels are plotted dc - DC that will be passed mDataDict - Dictionary of data that you want to use for the pointLabel.
def OnMouseLeftDown
def OnMotion
def ProfileOptionsMenu
 Popup menu for profile and text options.
def NotFunctional
 Creates a 'not functional' message dialog.
def OnPText
 Use user's provided profile text settings.
def PText
 Set custom text values for profile title and axis labels.
def POptions
 Set various profile options, including: line width, color, style; marker size, color, fill, and style; grid and legend options.
def PrintMenu
 Print options and output menu.
def OnPageSetup
def OnPrintPreview
def OnDoPrint
def OnQuit
def OnCloseWindow

Data Fields

 parent
 mapwin
 Map
 pstyledict
 ptfilldict
 toolbar
 statusbar
 client
 raster
 coordstr
 seglist
 plotlist
 ppoints
 profile
 transect_length
 ptitle
 xlabel
 ylabel
 properties
 zoom
 drag

Detailed Description

Mainframe for displaying profile of raster map.

Uses wx.lib.plot.

Definition at line 53 of file profile.py.

Constructor & Destructor Documentation

def gui_modules.profile.ProfileFrame.__init__ (   self,
  parent = None,
  id = wx.ID_ANY,
  title = _("GRASS Profile Analysis Tool"),
  rasterList = [],
  pos = wx.DefaultPosition,
  size = wx.DefaultSize,
  style = wx.DEFAULT_FRAME_STYLE 
)

Definition at line 59 of file profile.py.

Member Function Documentation

def gui_modules.profile.ProfileFrame.CreateDatalist (   self,
  raster,
  coords 
)

Build a list of distance, value pairs for points along transect.

Definition at line 408 of file profile.py.

References min, and gui_modules.profile.ProfileFrame.transect_length.

Referenced by gui_modules.profile.ProfileFrame.SetRaster().

def gui_modules.profile.ProfileFrame.DrawPointLabel (   self,
  dc,
  mDataDict 
)

This is the fuction that defines how the pointLabels are plotted dc - DC that will be passed mDataDict - Dictionary of data that you want to use for the pointLabel.

As an example I have decided I want a box at the curve point with some text information about the curve plotted below. Any wxDC method can be used.

Definition at line 607 of file profile.py.

def gui_modules.profile.ProfileFrame.NotFunctional (   self)

Creates a 'not functional' message dialog.

Definition at line 670 of file profile.py.

def gui_modules.profile.ProfileFrame.OnCloseWindow (   self,
  event 
)
Close profile window and clean up

Definition at line 759 of file profile.py.

def gui_modules.profile.ProfileFrame.OnCreateProfile (   self,
  event 
)

Main routine for creating a profile.

Uses r.profile to create a list of distance,cell value pairs. This is passed to plot to create a line graph of the profile. If the profile transect is in multiple segments, these are drawn as points. Profile transect is drawn, using methods in mapdisp.py

Definition at line 445 of file profile.py.

References gui_modules.profile.ProfileFrame.DrawPlot(), gui_modules.colorrules.ColorTable.raster, gui_modules.profile.ProfileFrame.raster, gui_modules.profile.ProfileFrame.SetGraphStyle(), and gui_modules.profile.ProfileFrame.SetRaster().

Referenced by gui_modules.profile.ProfileFrame.OnSelectRaster().

def gui_modules.profile.ProfileFrame.OnDoPrint (   self,
  event 
)

Definition at line 753 of file profile.py.

Referenced by gui_modules.profile.ProfileFrame.PrintMenu().

def gui_modules.profile.ProfileFrame.OnDrag (   self,
  event 
)

Enable dragging and disable zooming.

Definition at line 533 of file profile.py.

References gui_modules.profile.ProfileFrame.drag, and gui_modules.profile.ProfileFrame.zoom.

def gui_modules.profile.ProfileFrame.OnDrawTransect (   self,
  event 
)

Draws transect to profile in map display.

Definition at line 213 of file profile.py.

References gui_modules.profile.ProfileFrame.ppoints, and gui_modules.profile.ProfileFrame.seglist.

def gui_modules.profile.ProfileFrame.OnErase (   self,
  event 
)

Erase the profile window.

Definition at line 553 of file profile.py.

def gui_modules.profile.ProfileFrame.OnMotion (   self,
  event 
)

Definition at line 634 of file profile.py.

def gui_modules.profile.ProfileFrame.OnMouseLeftDown (   self,
  event 
)

Definition at line 629 of file profile.py.

def gui_modules.profile.ProfileFrame.OnPageSetup (   self,
  event 
)

Definition at line 747 of file profile.py.

Referenced by gui_modules.profile.ProfileFrame.PrintMenu().

def gui_modules.profile.ProfileFrame.OnPrintPreview (   self,
  event 
)

Definition at line 750 of file profile.py.

Referenced by gui_modules.profile.ProfileFrame.PrintMenu().

def gui_modules.profile.ProfileFrame.OnQuit (   self,
  event 
)

Definition at line 756 of file profile.py.

def gui_modules.profile.ProfileFrame.OnRedraw (   self,
  event 
)

Redraw the profile window.

Unzoom to original size

Definition at line 541 of file profile.py.

Referenced by gui_modules.profile.ProfileFrame.OnPText().

def gui_modules.profile.ProfileFrame.OnSelectRaster (   self,
  event 
)
def gui_modules.profile.ProfileFrame.OnZoom (   self,
  event 
)

Enable zooming and disable dragging.

Definition at line 525 of file profile.py.

References gui_modules.profile.ProfileFrame.drag, and gui_modules.profile.ProfileFrame.zoom.

def gui_modules.profile.ProfileFrame.POptions (   self,
  event 
)

Set various profile options, including: line width, color, style; marker size, color, fill, and style; grid and legend options.

Calls OptDialog class.

Definition at line 709 of file profile.py.

References gui_modules.profile.ProfileFrame.SetGraphStyle().

Referenced by gui_modules.profile.ProfileFrame.ProfileOptionsMenu().

def gui_modules.profile.ProfileFrame.ProfileOptionsMenu (   self,
  event 
)

Popup menu for profile and text options.

Definition at line 651 of file profile.py.

References gui_modules.profile.ProfileFrame.POptions(), and gui_modules.profile.ProfileFrame.PText().

def gui_modules.profile.ProfileFrame.PText (   self,
  event 
)

Set custom text values for profile title and axis labels.

Definition at line 699 of file profile.py.

References gui_modules.profile.ProfileFrame.OnPText().

Referenced by gui_modules.profile.ProfileFrame.ProfileOptionsMenu().

def gui_modules.profile.ProfileFrame.SaveProfileToFile (   self,
  event 
)

Save r.profile data to a csv file.

Definition at line 573 of file profile.py.

def gui_modules.profile.ProfileFrame.SaveToFile (   self,
  event 
)

Save profile to graphics file.

Definition at line 568 of file profile.py.

Field Documentation

gui_modules.profile.ProfileFrame.client

Definition at line 102 of file profile.py.

gui_modules.profile.ProfileFrame.coordstr

Definition at line 136 of file profile.py.

Referenced by gui_modules.profile.ProfileFrame.SetRaster().

gui_modules.profile.ProfileFrame.Map

Definition at line 63 of file profile.py.

gui_modules.profile.ProfileFrame.mapwin

Definition at line 62 of file profile.py.

gui_modules.profile.ProfileFrame.plotlist

Definition at line 140 of file profile.py.

Referenced by gui_modules.profile.ProfileFrame.DrawPlot().

gui_modules.profile.ProfileFrame.ppoints
gui_modules.profile.ProfileFrame.profile
gui_modules.profile.ProfileFrame.pstyledict

Definition at line 65 of file profile.py.

Referenced by gui_modules.profile.ProfileFrame.DrawPlot().

gui_modules.profile.ProfileFrame.ptfilldict

Definition at line 71 of file profile.py.

Referenced by gui_modules.profile.ProfileFrame.DrawPlot().

gui_modules.profile.ProfileFrame.seglist
gui_modules.profile.ProfileFrame.statusbar

Definition at line 95 of file profile.py.

gui_modules.profile.ProfileFrame.toolbar

Definition at line 84 of file profile.py.

Referenced by gui_modules.mapdisp_window.BufferedWindow.OnDragging().

gui_modules.profile.ProfileFrame.transect_length
gui_modules.profile.ProfileFrame.xlabel

The documentation for this class was generated from the following file: