SCAT2GRID_NBIN_XY(XPTS,YPTS,VAR,XAXPTS,YAXPTS)
Computes count of scattered data in each bin of a regularly-spaced XY grid.
SCAT2GRID_NBIN_XYT(XPTS,YPTS,TPTS,VAR,XAXPTS,YAXPTS,TAXPTS)
Computes count of scattered data in each bin of a regularly-spaced XYT grid.
These functions return the number of valid scattered data values that lie within each grid cell in XY or in XYT. The result is the count. See the SCAT2GRID_NBIN_XY and SCAT2GRID_NBIN_XYT functions which return the average of data by binning in each grid cell.
NOTE: Unlike SCAT2GRIDGAUSS and SCAT2GRIDLAPLACE Functions, the arguments that represent the scattered X, Y, and/or T locations must be 1-dimensional lists of values.
SCAT2GRID_NBIN_XY(XPTS,YPTS,F,XAXPTS,YAXPTS)
Arguments: |
XPTS |
x-coordinates of scattered input triples, listed along an axis in any direction. |
|
YPTS |
y-coordinates of scattered input triples, listed along an axis in any direction. |
||
VAR |
VAR Function value at scattered locations, listed along an axis in any direction. |
||
XAXPTS |
coordinates of X-axis of output grid. Must be regularly spaced. |
||
YAXPTS |
coordinates of Y-axis of output grid. Must be regularly spaced. |
||
Result Axes: | X | Inherited from XAXPTS | |
Y |
Inherited from YAXPTS |
||
Z |
NORMAL |
||
T |
NORMAL |
Quick example:
yes? DEFINE AXIS/X=180:221:1 xax yes? DEFINE AXIS/Y=-30:10:1 yax yes? ! read some data yes? SET DATA/EZ/VARIABLES="times,lats,lons,var" myfile.dat yes? LET my_out = SCAT2GRID_NBIN_XY(lons, lats, var, x[gx=xax], y[gy=yax])
SCAT2GRID_NBIN_XYT(XPTS,YPTS,TPTS,VAR,XAXPTS,YAXPTS,TAXPTS)
Arguments: |
XPTS |
x-coordinates of scattered input triples, listed along an axis in any direction. |
YPTS |
y-coordinates of scattered input triples, listed along an axis in any direction. |
|
TPTS | y-coordinates of scattered input triples, listed along an axis in any direction. | |
VAR |
VAR Function values at scattered locations, listed along an axis in any direction. |
|
XAXPTS |
coordinates of X-axis of output grid. Must be regularly spaced. |
|
YAXPTS |
coordinates of Y-axis of output grid. Must be regularly spaced. |
|
TAXPTS |
coordinates of T-axis of output grid. Must be regularly spaced. |
|
Result Axes: |
X |
Inherited from XAXPTS |
Y |
Inherited from YAXPTS |
|
Z |
NORMAL |
|
T |
Inherited from TAXPTS |
Notes:
The SCAT2GRID_NBIN_XY and SCAT2GRID_NBIN_XYT functions are "grid-changing"functions; the output grid is different from the input arguments.Therefore it is best to use explicit limits on any of the argumentsrather than a SET REGION command. (See this note on the context of variables passed to functions.)
Discrete Sampling Geometries (DSG) data:
Observational data from DSG datasets contain collections of data which while not truly scattered, has lists of coordinate information that can feed into these functions for gridding into a multi-dimensional grid. However, with the exception of trajectory data the coordinates do not all have the same dimensionality. Timeseries data for instance has a station location for each station, and multiple observations in time. Profile data has station location and time, and multiple heights/depths in each profile. For the SCAT2GRID functions we need all of the first arguments, the "scattered" locations and observation, to be of the same size. We need to expand the station data to repeat the station location for each time in that station's time series.
The FAQ, Calling SCAT2GRID functions for DSG data explains how to work with these datasets.