1 / 30

Laboratory in Oceanography: Data and Methods

Laboratory in Oceanography: Data and Methods. Gridding and Interpolation. MAR550, Spring 2013 Miles A. Sundermeyer Original by A.-M. Brunner-Suzuki.

moral
Download Presentation

Laboratory in Oceanography: Data and Methods

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Laboratory in Oceanography: Data and Methods Gridding and Interpolation MAR550, Spring 2013 Miles A. Sundermeyer Original by A.-M. Brunner-Suzuki

  2. The Problem: Certain analyses require regularly sampled series with equally space measurements in space or time. Yet, frequently we have gaps in our data, or else inherently irregular data. Gridding and Interpolation Filling Gaps

  3. Gridding and Interpolation Filling Gaps (cont’d) • Equipment failure • Weather conditions (ship, satellite) • Editing out errors • Inherent sampling limitations (cannot be everywhere all the time) • Use of historical data, which often had different goals (e.g., analyzing the mean state of the ocean) • Geographic distribution (moorings, buoys, ships) of monitoring stations is usually not uniformly spaced • Resolving smaller dynamics

  4. Gridding and Interpolation Basic Interpolation Theory Example: Linear Interpolation Fit a straight line between pairs of sequential data points, choosing interpolated values at the appropriate positions along the fitted line.

  5. Gridding and Interpolation Basic Interpolation Theory (cont’d) Example: Linear Interpolation Assume x is distance, x1 = 3 km, x2 = 6 km, wish to evaluate y(x) at x = 4.5 km. Assume y = y(x), with observations y(x1) = 22, y(x2) = 12. What is y @ x=4.5? Linear Interpolation = straight line = first order polynomial

  6. Polynomial interpolation more generally used to interpolate between more than two points simultaneously. Examples: Through 3 points we can find a unique polynomial of what order? Through 10 points we can find a unique polynomial of what order ? Methods to look for are Vandermonde, Lagrange and Newton. f(x) = a0 + a1x1 + a2x2 + … + amxm All coefficients, an, influence all of x. Can determine m by trial and error. Check by comparing the residuals. Gridding and Interpolation Polynomial Interpolation

  7. Vandermonde Matrix Consider data with underlying function: p(x) = 3.2 x7 - 4.1 x4 + 9.2 x2 + 1.2 (i.e., order 7 polynomial) Suppose we have 3 (x,y) points: (2, 5), (3, 6), (7, 4) and we want to fit a quadratic polynomial through these points. General form is p(x) = c1x2 + c2x + c3 Thus, if we were to simply evaluate p(x) at these 3 points, we get 3 equations: p(2) = c1 4 + c2 2 + c3 = 5p(3) = c1 9 + c2 3 + c3 = 6p(7) = c1 49 + c2 7 + c3 = 4 Gridding and Interpolation Polynomial Interpolation (cont’d)

  8. Vandermonde Matrix (cont’d) This, however, is a system of equations. To solve: Write down the general polynomial of degree n - 1 Evaluate the polynomial at the points x1, ..., xn Solve the resulting system of linear equations. Rather than performing all of these operations, simply write down the problem in the form: y = Vc where y is the vector of y values, c is the vector of coefficients (‘x’), and V is the Vandermonde matrix. (e.g., see Matlab function “vander.m”) Gridding and Interpolation Polynomial Interpolation (cont’d)

  9. Gridding and Interpolation Polynomial Interpolation (cont’d)

  10. Gridding and Interpolation (Cubic) Spline Interpolation • Piecewise polynomial, avoids the Runge phenomenon. • Is applied to a series of segments of the data record rather the entire series • Spline functions can overcome some discontinuities or sharp corners, where the segments join. • Good for fitting non-analytical distributions • No advantage to polynomial interpolation when applied to either well-behaved functions or dense data

  11. Gridding and Interpolation (Cubic) Spline Interpolation Approximate the interpolation function y(x) over the interval [a,b] by dividing [a,b] into sub-intervals with continuity at the joints: a = x0 < x1 < x2 … < xN = b For each sub-interval y(x) is a polynomial of order N or smaller. • At each “joint”, y(x) and its N-1 derivatives are continuous. • N=3: cubic spline, most common. Consider data (xi,yi) i=1...N, y'(x), y''(x) exist for all x, and y'''(x) is const. for all x. At all joints: • The spline function fi(xi) is continuous • Its slope y'(x) is continuous • Its curvature y''(x) is continuous • Because y'''(x) = const => y''(x) is also linear.

  12. Gridding and Interpolation (Cubic) Spline Interpolation (cont’d) Hint: To ensure positivity, can first log-transform the data, perform the interpolation, and then convert back by exponentiation to the original space.

  13. Gridding and Interpolation FFT Interpolation (cont’d) FFT Interpolation • Original vector, x, is transformed to Fourier domain using fft, and then transformed back with more points. • How? Matlab transforms to the Fourier domain, there Matlab pads the spectrum with zeros, and then transforms the function back with more points.

  14. Gridding and Interpolation 2-D Gridding and Interpolation Often do not have evenly spaced observations - need to grid unevenly spaced data (e.g., imagesc, pcolor, surf all need equally spaced data.) • Example: Fratantoni & Pickart (2007) • Plot 5o squares spatial coverage increases towards lower latitudes • Mix of historical data and different instruments (XBT vs MBT) • Seasonality in data coverage • Historical Observations often along meridians or parallel to longitudes • Main goal was to find the “mean state of the ocean” • Fratantoni & Pickart, 2007

  15. Numerical models – various ways of interpolating / assimilating data Direct Insertion: Model predictions are replaced with available observations Assumption: Perfect observations, imperfect model. Model dynamics spread information to nearby gridpoints. Blending uses a weighted average “Nudging” or Newtonian Damping Model is forced over several time steps towards the observation: F(a,t) is model forcing, G(t) is nudging coeff., wiis analysis weight, aiis observed value, a is interpolated model value Gridding and Interpolation 2-D Gridding and Interpolation

  16. Optimal Interpolation (a.k.a., Objective mapping, Objective analysis, BLUE (Best Linear Unbiased Estimator) or Gauss-Markov smoothing) Models are imperfect. Errors include: initial conditions imperfect parameterization inaccurate forcing … Observations are imperfect. Errors include: instrument errors sampling errors measurement noise … Gridding and Interpolation Optimal Interpolation

  17. Optimal Interpolation (a.k.a., Objective mapping, Objective analysis, BLUE (Best Linear Unbiased Estimator) or Gauss-Markov smoothing) (cont’d) Compared to direct insertion / nudging: model adjustment only at grid point of observation vs. all points within de-correlation distance of the observation OI estimates fields at any location through linear combination of available data Weights are such that expected error of estimate is minimized and estimate itself unbiased natural covariance length and time scales of data and true field enter into the computation of linear weights. Gridding and Interpolation OptimalInterpolation (cont’d)

  18. r,s:where the observations are made x: where to interpolate to x: is the distance from x. q: is the true or target value covariance: represented by F(x) Gridding and Interpolation OptimalInterpolation (cont’d)

  19. The observations are: The measurement errors and the observed values are not correlated: Error is uncorrelated with itself E is the error variance. Gridding and Interpolation OptimalInterpolation (cont’d)

  20. How to estimate the true value, qx, from (imperfect) observations: From previous slide, have covariance matrix of observations: Gridding and Interpolation OptimalInterpolation (cont’d)

  21. Ars and Cxr are constant for given observation points! The error in the estimation is: it can be used to construct error maps in the estimation (derivation follows) Cxx is the natural variation without data present The second term shows data influence a are weights still to be determined: Gridding and Interpolation OptimalInterpolation (cont’d)

  22. The error variance of the estimation: If we minimize this error variance we get the previous equation: Gridding and Interpolation OptimalInterpolation (cont’d) > or = to 0

  23. Once we know Ars and Cxr We can determine the estimate of the true value: Let’s assume there are M grid locations x and N data locations r: Gridding and Interpolation OptimalInterpolation (cont’d)

  24. Gridding and Interpolation OptimalInterpolation (cont’d) Example: Dye mapping during Coastal Mixing & Optics Experiment (CMO)

  25. Gridding and Interpolation OptimalInterpolation (cont’d) Example: CMO

  26. Gridding and Interpolation OptimalInterpolation (cont’d) • Example: CMO • Start with large-scale interpolation

  27. Gridding and Interpolation OptimalInterpolation (cont’d) • Example: CMO • Start with large-scale interpolation (b=6 km, a=2) • “interpolate” smoothed map onto observation points as spatially varying mean.

  28. Gridding and Interpolation (Cubic) Spline Interpolation (cont’d)

  29. Gridding and Interpolation Useful Tidbits • Useful Tidbits: • interp, interp2, interp3 - 1-,2-, and 3-D interpolation • spline toolbox - more spline tools for other splines but cubic • (limited licenses at SMAST) • delauny - triangulation by finding “natural” neighbors • voronoi - 2-d fitting via polygons • trimesh - for plotting mesh with triangles • dsearch - point search for use with Delauny triangulation • tsearch - triangle indexing for use w/ Delauny triangulation • Some References: • Data Analysis Methods in Physical Oceanography by W.J. Emery and R.E. Thomson, 1993. • Bretherton, F. P., R. E. Davis, and C. B. Fandry, 1976: A technique for objective analysis and design of oceanographic experiments applied to MODE-73. Deep Sea Res.,23, 559-582.

  30. Additional Topics – Other Cool Stuff • Notable Points Re: Functions: • Use nargin to allow variable number of inputs • Sometimes useful to pass a function reference to another function, e.g., lsqnonlin • Other Miscellaneous Stuff … • guide - GUI development environment • beep.m - beep • sound.m - play sounds

More Related