cem_gridtools API¶
CGrid¶
General Curvlinear C-grid
-
class
cem_gridtools.cem_gridtools.
CGrid
(x, y, beta)[source]¶ Bases:
object
CGrid constructor
- Parameters
x (array) – x boundary values
y (array) – y boundary values
beta (array) – beta values (corner status)
- beta points
+1 for external corner or 90 degree clockwise turns
-1 for internal corner or 90 degree anti-clockwise turns
0 all other boundary points
-
gen_grid
(ni, nj, ulidx=0)[source]¶ Generates the (ni+1) x (nj+1) grid and calculates the full double-density points
- Parameters
ni (int) – Number of required grid cells in the i-direction
nj (int) – Number of required grid cells in the j-direction
ulidx (int, optional) – The index of the upper left corner of the grid
-
plot
(legend=False, dd=False, map=False)[source]¶ Simple plotting routine for gridlines using Matplotlib
-
export_shoc_grid
(name)[source]¶ Write SHOC grid to given file
- Parameters
name (str) – output filename, overwrites file
CGridRect¶
Rectangular Curvilinear Grid
-
class
cem_gridtools.cem_gridtools.
CGridRect
(x, y, geo=False)[source]¶ Bases:
cem_gridtools.cem_gridtools.CGrid
CGRidRect constructor
If geo=True then the resolution will be interpreted in “metres” from which the grid dimensions are calcuated based on the geographic centroid of the grid. Otherwise, units are assummed to be the same as the supplied input boundary
- Parameters
x (array) – 1-d array of length 4
y (array) – 1-d array of length 4
geo (bool, optional) – whether this is geographic
NN¶
Natural Neighbours (scattered) interpolation interface
-
class
cem_gridtools.cem_gridtools.
NN
(x, y, z, irule='nn_sibson')[source]¶ NN constructor
- Parameters
x (array) – X points (1-d)
y (array) – Y points (1-d)
z (array) – Z (depth) points (1-d)
irule (string) –
interpolation method to use
Choices are nn_sibson (default), nn_non_sibson and linear
Coast¶
Interface to coast line files
-
class
cem_gridtools.cem_gridtools.
Coast
(fname)[source]¶ Coast constructor
The type of data is inferred from the extension:
.cst : ASCII X,Y columns with NaN breaks
.shp : Shape file (not implemented yet)
- Parameters
fname (str) – coast file name