Skip to content
Joel Pitt edited this page Feb 6, 2014 · 1 revision

Table of Contents

Framework Improvements

Release

Model results packaging

  • Create python pickle for results, use .mdig extension.
    • Also contain model object and appropriate sub objects.
    • Make an XML parser that converts an initial definition to the .mdig format.
    • Store mapset name and map names.
    • Store analysis results.
    • Don't store actual maps, but provide "archive" function which zips .mdig pickle and relevant GRASS files into a mdig_package. Also provide function for archiving a DispersalInstance (with maps) into a mdig_instance and replicates (with maps) into a mdig_rep.

General

  • pause/bail on setRegion fail
  • allow raw analysis commands in xml (involves refactoring DispersalModel.runCommandOnMaps into Instance/Replicate)
  • create separate mapsets for each instance.
  • check to remove mdig.survival before running survival module
  • Bugs on launchpad
  • fix localspread for population models
  • output - change population map color scheme to cyan->blue, potential cover from yellow to red.
  • Implement Unit tests using unittest
    • test model files
  • Make list of exit codes and implement
  • Check and allow timesteps different from a year
  • Update random seed changes in environment variable GRASS_RND_SEED
  • allow modules actions that are executed only at the beginning and end of simulation
  • do nothing switch for testing (don't run modules)
  • record date of last change for replicates (to check if envelopes are up to date, r.info can check date of maps)
  • separate name and command for analysis
  • allow analyses to be run from commands in a file (xml or txt?)
  • built in command to apply particular analysis to all completed simulations in model xml file or to the probability envelope.
  • set directory for output of analysis data: add dir to xml
  • specify output of xml when complete (can't remember what this means)
  • estimate remaining time, record time elapsed
  • create option for generating a pyramid raster file and using with modules. make controller deal with modules that don't handle a pyramid raster - alternatively use new raster formats API?
  • mapping between event names and GIS commands: separate schemas for mdig, events, and analysis. Event names needs to be interpreted into GIS commands by MDiG. Schemas should also define which parameters are optional for MDiG systems to implement.
  • Add location, mapset parameters to region - also allow location and mapset to be defined in <regions></regions> to affect all regions. location can be a name, or specify a datum and projection information (which creates a location...)

Web controller

  • Use inbuilt python webserver, that way it can run locally or on a server
  • stages of developing a model
    • module ordering
    • module configuration (fitting to data)
    • analysis config
    • replication management
    • saving data
    • email user once complete
  • details to configure via websystem: GRASS details, GIS database, R setup, multiple simulation servers (or run as a server)
  • graphing via matplotlib
  • http://www.maptiler.org/ to generate maps to view using google maps API.

Desktop GUI

  • Use python bindings to wxwidgets
  • convert tk map viewer (-m option when running mdig) to wxwidgets
    • Example code
import wx
 
class Panel1(wx.Panel)&#58;
    &quot;&quot;&quot;class Panel1 creates a panel with an image on it, inherits wx.Panel&quot;&quot;&quot;
    def &#95;&#95;init&#95;&#95;(self, parent, id)&#58;
        &#35; create the panel
        wx.Panel.&#95;&#95;init&#95;&#95;(self, parent, id)
        try&#58;
            &#35; pick an image file you have in the working folder
            &#35; you can load .jpg  .png  .bmp  or .gif files
            image_file &#61; &#39;roses.jpg&#39;
            bmp1 &#61; wx.Image(image_file, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
            &#35; image&#39;s upper left corner anchors at panel coordinates (0, 0)
            self.bitmap1 &#61; wx.StaticBitmap(self, &#45;1, bmp1, (0, 0))
            &#35; show some image details
            str1 &#61; &quot;%s  %dx%d&quot; % (image_file, bmp1.GetWidth(), bmp1.GetHeight()) 
            parent.SetTitle(str1)
        except IOError&#58;
            print &quot;Image file %s not found&quot; % imageFile
            raise SystemExit
        
        &#35; button goes on the image &#45;&#45;&gt; self.bitmap1 is the parent
        self.button1 &#61; wx.Button(self.bitmap1, id&#61;&#45;1, label&#61;&#39;Button1&#39;, pos&#61;(8, 8))

app &#61; wx.PySimpleApp()
&#35; create a window/frame, no parent, &#45;1 is default ID
&#35; change the size of the frame to fit the backgound images
frame1 &#61; wx.Frame(None, &#45;1, &quot;An image on a panel&quot;, size&#61;(350, 400))
&#35; create the class instance
panel1 &#61; Panel1(frame1, &#45;1)
frame1.Show(True)
app.MainLoop()
  • ability to configure web server
  • allow easy viewing of sequential maps
    • creation of new simulations
    • graphing via R

More explicit support for population models

  • Waiting for Steve's suggestions.

Module Improvements

Kernel

  • kernel distributions to implement: tent, tophat, gamma-binomial Tufto et al. 2005
  • mechanistic spread e.g. ballistic models of Buller (fungi spores) vs. dispersal fitted to measured kernels (fitted to data).

Survival

  • change survival module to use equation for population dependence of survival: P(survival)=1-\frac{1-s}{N^x}
  • Gardner04 has a method for creating fractal landscapes that could be good as a null model generator.

Growth

  • allow excess population in a cell (arrising from dispersal) to be kept or discarded.
  • alter to ignore 0 population sites for r.null

Local

  • Allow neighbourhood greater than 2, bitmask needs to be a string rather than an integer.

Analysis







  • v.sample.buffer looks at raster cells with a given buffer of vector points - might be useful because aa occurence data is rounded to nearest 100m, so use 100m buffer.
  • r.distance can be used to find distance to the nearest occurrence point

r.mdig.ros

  • support region/windows with different north-south and east-west resolution
  • alter to ignore 0 population sites for r.null
  • Output vector of boundaries
  • Allow selection of direction to calculate spread

r.mdig.stats

  • calculate distance stats using resolution. currently only uses raster cell distance.

Lifestages

  • prevent a lifestage from running twice on an area (separate maps), but allow it to be recruited into the next stage and disperse in that next stage (combine lifestage map and temp map first).

Output

  • 3d map with transparent standard deviation layers
  • mean of maps and s.d., save sums and sum of squares with replications.
  • allow movies to be exported
  • volumes in cellular automata http://bambi.otago.ac.nz/hamish/grass/r.game_of_life