Skip to content

UDSF: Neighbourhood Functions

Admin edited this page May 13, 2018 · 6 revisions

Neighbourhood Functions are used for supporting spatial neighbourhood analysis. Coupled with Temporal Functions, Neighbourhood Functions provide a powerful method to explore the spatiotemporal dynamics of climate phenomena.

RoveWindow

RoveWindow uses a moving window to define the neighbourhood for each cell in the grid, and all cells contained in the neighbourhood are summarized using the statistical function to obtain a statistic. This statistic is then assigned to the cell. It produces a new grid with each cell summarizing its neighbouring cells.

  • Syntax: RoveWindow(grid,windowSize,statType) returns a new grid. windowSize indicate the number of neighbor cells, .e.g. if windowSize=1, then it will be a 3 * 3 window.

    Currently supported statistic types(statType):

    • avg
    • sum
    • std
    • median
  • Example:

/*Explore the hourly local variability of the July land surface temperature 
by aggregating ten-year MERRA land data from 2001 to 2010*/
SELECT hour,Render(RoveWindow(AVG_T(grid),3,"std"))
FROM MST1NXMLD
WHERE variable = 'TSURF'AND year BETWEEN 2001 and 2010 AND month = 7
GROUP BY hour ORDER BY hour
VISUALIZE AS vis.Animation	

Try it yourself: http://gis.cas.sc.edu/scovas?id=1526171870734

RoveWindowBivariate

RoveWindowBivariate uses a moving window to define the neighbourhood for each cell in the two input grids(often two variables), and all cells contained in the neighbourhood of the two grids are summarized using the statistical function to obtain a statistic. It produces a new grid with each cell summarizing its neighbouring cells of two grids based on a predefined operator, such as correlation. For example, we can use this function to calculate the focal correlation between variables such as precipitation and temperature.

  • Syntax: RoveWindowBivariate(grid1,grid2,windowSize,statType) returns a new grid. windowSize indicate the number of neighbor cells, .e.g. if windowSize=1, then it will be a 3 * 3 window.

    Currently supported statistic type:

    • corr(correlation)
  • Example:

/*Compute the local correlation coefficient (Pearson’ r) between land surface temperature and precipitation for each month in the contiguous U.S. */
SELECT a.month,Avg_S(RoveWindowBivariate(Avg_T(a.grid),Avg_T(b.grid),5,"corr")) as meanR_x,
Render(RoveWindowBivariate(Avg_T(a.grid),Avg_T(b.grid),5,"corr")) as localR
From MST1NXMLD a 
	JOIN MST1NXMLD b ON (a.time = b.time)
WHERE a.variable= "PRECTOT" and b.variable='TSURF' and a.year between 1980 and 2015
and AOI = REGION.BboxOnMap
GROUP BY a.month ORDER BY a.month
VISUALIZE AS vis.TimeSeries,vis.Animation

Try it yourself: http://gis.cas.sc.edu/scovas?id=6024965312714

You can’t perform that action at this time.