Home > hfrc > matlab > @HFRC > griddata.m



GRIDDATA - Grid and interpolate spatial data.


function [h, XII, YII] = griddata( h, all, XI, YI, pc, varargin )


 GRIDDATA - Grid and interpolate spatial data.

 This function is basically a wrapper for the normal griddata.

 Usage: hfrc_obj = griddata( hfrc_obj, grid_all, XI, YI, pc, method )
        [hfrc_obj, XI, YI] = griddata( hfrc_obj, grid_all, XI, YI, pc, method )

 where grid_all is a boolean that states whether or not to apply
 griddata to all spatial variables - if false, griddata is only applied
 to U and V, and variables like NumRadials are simply set to all zeros 
 (sparse(m,n) where (m,n) are the dimensions of the new hfrc object

 grid_all can also be a string, in which case the function returns just the
 variable of interest and not a HFRC object.

 XI and YI are best explained in the griddata help - they
 should be longitude and latitude, respectively.  They can be matrices
 or vectors.  If one is a row and the other is a column, then the
 interpolation will be over a grid.  If both are rows or both are
 columns, then interpolation will be over the points given.

 pc is the minimum spatial percent coverage that is required for
 interpolation to be performed on a given map.  Defaults to 0.3.  For
 maps that have less than this percent, the corresponding interpolated
 map will be all NaN's.

 method is described in griddata.

 The function returns an HFRC object that has prod(size(XI)) grid
 points, where XI is X component of the grid used.  They are returned in
 the correct order so that reshape( U, [m n] ) will get back the grid if
 a grid was given.

 The actual gridding is all done in kms to avoid any problems with
 uneven dimensions.

 In the end, if the original object was sparse, all NaN's in the result
 will be replaced by 0's and the result will be sparsed.  If the
 original was full, nothing will be done.


     $Id: griddata.m,v 1.13 2003-05-15 03:35:51 dmk Exp $    

 Copyright (C) 2001 David M. Kaplan
 Licence: GPL



This function calls: This function is called by:
Generated on Mon 18-Dec-2006 07:26:46 by m2html © 2003