Changes between Version 3 and Version 4 of GSoC/2014/ImplementationOf3DRasterFlowLine


Ignore:
Timestamp:
06/06/14 14:24:01 (10 years ago)
Author:
annakrat
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GSoC/2014/ImplementationOf3DRasterFlowLine

    v3 v4  
    5454|| August 22 || Students can begin submitting required code samples to Google
    5555
    56 '''Week 1'''
     56== Reports ==
     57
     58=== Week 1 ===
    5759
    5860I discussed the implementation with mentors. Based on that I will use similar approach as implemented in VTK, which computes the flowlines by integrating the vector field. To have a first prototype quickly, I will implement it in Python using PyGRASS to write vector lines and Python scripting library (array.py). I will write the Python code in a way which would make it easy to port to C.
     
    6870I will probably keep the code in sandbox and once it is usable, I will put it in addons
    6971
    70 '''Week 2'''
     72=== Week 2 ===
    7173
    7274I started to implement the prototype in Python:
     
    7880 * Soeren suggests using interpolation approach by [http://www.isws.illinois.edu/pubdoc/b/iswsb-65.pdf Prickett, 1981] instead of trilinear interpolation from voxel centers.
    7981 * r3.flow should be able to compute the gradient so that the input can be also just one 3D raster map instead of 3 maps representing the vector field. For now I could probably use !NumPy's method `gradient` based on central differences. When porting to C, there is [http://grass.osgeo.org/programming7/gpdelib.html GPDE] library in GRASS.
     82
     83=== Week 3 ===
     84
     85I have a running prototype producing flowlines, I tested it on artificial data created from the first example in !r3.gwflow. Here are some results:
     86
     87[[Image(regular_flowlines.png, 300px)]] [[Image(random_flowlines.png, 300px)]]
     88
     89The flowlines can be generated with forward or backward integration (upstream or downstream).
     90The integration step can be defined:
     91 * as a time step - it is difficult to guess the right value
     92 * as a lenght step in map units or cells (voxels) - that's now the default. The drawback is that it doesn't behave so well around singular points (where velocity is close to zero) as the time step does.
     93
     94Another parameter is the maximum number of steps which prevents infinite loops I got around the singular point.
     95
     96I added another input - besides the vector field components, the input can be only one 3D raster (scalar field) and I compute gradient using NumPy's method `gradient`.
     97
     98For the next week, I would like to test it on more complicated data (space-time cube data of terrain evolution) and implement a flow accumulation analogue in 3D. I am still not sure how to proceed, I have to either ensure that the step is so small that I will have at least one point of the flowline in the intersected cell or I have to check between each two steps that I didn't skip any cells on the way.
     99
     100Also I will look at implementation of Runge Kutta method with adaptive step size  which might help with the flowlines near a singular point.