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
subdirectory of the IDL distribution.
Result = SPH_SCAT(
Lon, Lat, F
A vector of sample longitudes, in degrees. Note that
must all have the same number of points.
A vector of sample latitudes, in degrees.
A vector of data values which are functions of Lon and Lat.
represents a value at (
Set this keyword to a four-element vector containing the grid limits in longitude and latitude of the output grid. The four elements are: [
]. If this keyword is not set, the grid limits are set to the extent of
. 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
. The default longitude spacing is (
)/(NX-1). The default latitude spacing is (
)/(NY-1). If NX and NY are not set, the default grid size of 26 by 26 is used for NX and NY.
The output grid size in the longitude direction. The default value is 26. Note that NLON need not be specified if the size can be inferred from GS and BOUNDS.
The output grid size in the latitude direction. The default value is 26. Note that NLAT need not be specified if the size can be inferred from GS and BOUNDS.
lon = RANDOMU(seed, 50) * 360. -180.
lat = RANDOMU(seed, 50) * 180. -90.
z = SIN(lat*!DTOR)
c = COS(lat*!DTOR)
x = COS(lon*!DTOR) * c
y = SIN(lon*!DTOR) * c
f = SIN(x+y) * SIN(x*z)
r = SPH_SCAT(lon, lat, f, BOUNDS=[0, -90, 350, 85], GS=[10,5])