Title: Towards an Algebra of Grid Functions
1Towards an Algebra of Grid Functions
2Claims
- All our data can be modeled using
- grids (discretizations of a domain) and
- functions over the discrete elements
- All our data products can be specified as
manipulations of these grid functions - bind
- subgrid
- regrid
3Vocabulary Grids
- A k-dimensional cell, or k-cell can be thought of
as just a polygon - 0-cell vertex c
- 1-cell edge (c1, c2)
- d-cell element (or just cell) (c1,
c2,...,cm) - A grid G is a sequence of sets of k-cells
C0,C1,... - k-cell(G) denotes the (k1)th set in the
sequence, Ck. - dim(G) is the highest k for which k-cell(G) ? ?.
- G1 ? G2 is the cross product of G1 and G2
2-cell
1-cell
4Vocabulary Grid Functions
- GFk a ( G, f ), where
- G is a grid,
- f k-cell(G) ? a
- where a is some type. (scalar float, vector of
int, etc.) - grid(GFk a) G
- dom(GFk a) kcell(G)
5Examples of f
- geometry 0-cell(G) ? (x,y,z)
- salinity 2-cell(G) ? float
- neighbors(i, j) i-cell(G) ? j-cell(G)
- measure(i) i-cell(GF0 (x,y,z)) ? float
- //length, area, etc.
- column k-cell(G1) ? k-cell(G1 ? G2)
6Bind
b
(b,x)
Bind(f)
a
c
(c,y)
(a,w)
d
(d,z)
gfZ bind(vgrid, depths) gfXY bind(hgrid,
geometry) gfBath bind(gfXY, bath)
- bind( f )GFk a GFk (a,b)
- where f k-cell(G) ? b
7Subgrid
- subgrid(p)GFk a GFk a
- where p a ? Bool
gfXY bind(hgrid, nodes) gfZ bind(vgrid,
depths) gfBath bind(gfXY, bath) crossGrid
gfXYb ? gfZ corieGrid subgrid(d gt b?, crossGrid)
8Regrid
- Three components
- target grid, G
- cell mapping, g
- where g k-cell(G) ? j-cell( grid( GFk b ) )
- aggregate function, f
- where f a ? b
- Regrid( G, g, f )GFj a GFk b
9Example max salinity
- target grid hgrid
- cell mapping g e ? e ? vgrid
- where e ? 2-cell(GF)
- aggregate max
gfSalt bind(salt)hgrid ? vgrid gfMaxSalt
regrid(hgrid, g, max)gfSalt
10Example salinity gradient
salinity
- target grid same
- cell mapping halo
- aggregate function gradient
gfAreas bind(measure(2))hgrid ? vgrid gfGeo
bind(geometry)gfAreas gfSalt
bind(salinity)gfGeo gfSaltGrad regrid(G,
halo, gradient)gfSalt
11Example plume volume
float
- target grid unit_grid
- cell mapping g
- where g e ? 3-cell(G)
- aggregate sum
gfElev bind(elev)corieGrid gfOcean
subgrid(ocean?)gfElev gfPlume
subgrid(saltlt26)gfOcean gfVol
bind(measure(3))gfPlume gfPlumVol
regrid(unit, g, sum)gfVol
12Grid Functions
- Grid functions can model
- Spatial data sets
- Image data
- Plots
- Timeseries
- Independent of representations
- Arrays
- Objects
- Relations
- File Formats (CORIE, NetCDF, etc.)