Data Processing Flows with SCons Jim Jennings Houston, Texas July, 2010 Outline • • • Introduction to data processing flows with SCons two simple examples Random Fields with Madagascar what is stochastic simulation? how to make random field with FFTs implementation in Madagascar examples Variograms with Madagascar what is a variogram? how to compute a variogram with FFTs implementation in Madagascar examples 2 Stochastic Simulation • Unconditional stochastic simulation in geostatistics is • the process of generating a random field with a specified variogram model. Conditional stochastic simulation makes random fields that have a specified variogram and have specified values at given control points. 3 Stochastic Gaussian Simulation v x rxhwh h moving average method V RW C VV * RWR *W * RR *WW * WW * W2 symmetric weight function 4 Stochastic Simulation with FFTs w x F1 C v x rxhwh moving average method h v x F1 R C FFT moving average 5 Implementation in Madagascar • A recipe for stochastic simulation of unconditional • Gaussian random fields in 1, 2, & 3 dimensions is in $RSFSRC/book/Recipes/rfield.py An example SConstruct using the recipe is in $RSFSRC/book/geostats/simulate/rfield 6 Deep-Water Channels with Background Noise 7 8 9 10 11 12 Variogram Array 13 Variogram Computation with FFTs The trick is to think of an FFT not as an approximation to the Fourier integral transform, but as a tool for exact and efficient computation of the discrete product sum: AB 1 a b F F(a)F(b) x xh x F1 … for all possible values of the discrete lag vector h. 14 Variogram Computation with FFTs Then, expand the variogram definition into a collection of product sums: 2 1 (h) v x v xh 2N(h) x 1 2 2 v v v x v xh x xh 2 x x N(h) 15 16 Variogram Computation with FFTs Then, expand the variogram definition into a collection of product sums: 2 1 (h) v x v xh 2N(h) x 1 2 2 v v v x v xh x xh 2 x x N(h) 1 2 2 v x i xh i x v xh v x v xh x 2 x x i x i xh x 17 Variogram Computation with FFTs … that can be computed efficiently with FFTs: (h) V 2 I* IV 2* F1 VV * 2 F1 II* 18 Variogram Computation with FFTs … that can be computed efficiently with FFTs: (h) V 2 I* IV 2* F1 VV * 2 F1 II* Marcotte, D., 1996, Fast variogram computation with FFT, Computers & Geosciences, v 22, n 10, pp. 1175–1186. 19 Implementation in Madagascar • A recipe for computation of variograms and other • spatial statistics from array data is in $RSFSRC/book/Recipes/spatial_stats.py An example SConstruct using the recipe is in $RSFSRC/book/geostats/spatial_stats/variogram 20