SPH_SCAT

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.

Calling Sequence

Result = SPH_SCAT( Lon, Lat, F )

Arguments

Lon

A vector of sample longitudes, in degrees. Note that Lon, Lat, and F must all have the same number of points.

Lat

A vector of sample latitudes, in degrees.

F

A vector of data values which are functions of Lon and Lat. F i represents a value at ( Lon i , Lat i ).

Keywords

BOUNDS

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.

BOUT

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.

GOUT

Set this keyword to a named variable that, on return, contains a two-element vector (similar to GS) that describes the actual grid spacing.

GS

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.

NLON

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.

NLAT

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.

Example

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.

c = COS(lat*!DTOR)

x = COS(lon*!DTOR) * c

y = SIN(lon*!DTOR) * c

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; .

See Also

TRIANGULATE , TRIGRID