Changes between Version 3 and Version 4 of GSoC/2014/ImplementationOf3DRasterFlowLine
- Timestamp:
- 06/06/14 14:24:01 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GSoC/2014/ImplementationOf3DRasterFlowLine
v3 v4 54 54 || August 22 || Students can begin submitting required code samples to Google 55 55 56 '''Week 1''' 56 == Reports == 57 58 === Week 1 === 57 59 58 60 I 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. … … 68 70 I will probably keep the code in sandbox and once it is usable, I will put it in addons 69 71 70 '''Week 2''' 72 === Week 2 === 71 73 72 74 I started to implement the prototype in Python: … … 78 80 * 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. 79 81 * 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 85 I 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 89 The flowlines can be generated with forward or backward integration (upstream or downstream). 90 The 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 94 Another parameter is the maximum number of steps which prevents infinite loops I got around the singular point. 95 96 I 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 98 For 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 100 Also I will look at implementation of Runge Kutta method with adaptive step size which might help with the flowlines near a singular point.