The SPH_SCAT function performs spherical gridding. Scattered samples on the surface of a sphere are interpolated to a regular grid. This routine is a convenient interface to the spherical gridding and interpolation provided by TRIANGULATE and TRIGRID. The returned value of the function is a regularly-interpolated grid.
This routine is written in the IDL language. Its source code can be found in the file
sph_scat.pro
in the
lib
subdirectory of the IDL distribution.
Set this keyword to a four-element vector containing the grid limits in longitude and latitude of the output grid. The four elements are: [ Lon min , Lat min , Lon max , Lat max ]. If this keyword is not set, the grid limits are set to the extent of Lon and Lat . Note that, to cover all longitudes, you must explicitly specify the values for the BOUNDS keyword.
Set this keyword to a named variable that, on return, contains a four-element vector (similar to BOUNDS) that describes the actual extent of the regular grid.
Set this keyword to a named variable that, on return, contains a two-element vector (similar to GS) that describes the actual grid spacing.
Set this keyword to a two-element vector that specifies the spacing between grid points in longitude (the first element) and latitude (the second element).
If this keyword is not set, the default value is based on the extents of Lon and Lat . The default longitude spacing is ( Lon max - Lon min )/(NX-1). The default latitude spacing is ( Lat max - Lat min )/(NY-1). If NX and NY are not set, the default grid size of 26 by 26 is used for NX and NY.
lon = RANDOMU(seed, 50) * 360. -180. ; Create some random longitude points.
lat = RANDOMU(seed, 50) * 180. -90. ; Create some random latitude points.
z = SIN(lat*!DTOR) ; Make a function to fit.
f = SIN(x+y) * SIN(x*z) ; The finished dependent variable.
r = SPH_SCAT(lon, lat, f, BOUNDS=[0, -90, 350, 85], GS=[10,5])
;
Interpolate the data and return the result in variable
r;
.