ocmw.design.gradRaster module

Mesh gradation raster generation functions for parameter-based mesh refinement.

writeRasterFile

Write raster to netCDF file.

getRasterCoords

Get raster coordinates from netCDF file and generate gidded coordinates.

normalise

Normalise a variable about its mean value.

gradate

Convert a raster into a gradation between minimum and maximum values.

gradation2meshDensity

Convert a gradation raster into an equivalent mesh density assuming equilateral triangles.

gradation2numElems

Convert a gradation raster into an equivalent number of element assuming equilateral triangles.

distance2coast

Calculate the distance for a set of points (x,y) from features in a coastline shapefile.

rasterise

Convert a variable on an unstructured mesh into a raster.

vargradient

Calculate the spatial gradient of a mesh variable on a regular raster.

plotRaster

Plot as raster as a colourised image.

Mesh refinement functions for QMESH mesh gradation raster generation.

ocmw.design.gradRaster.writeRasterFile(rasterPath, baseRasterFile, rasterFile, raster)[source]

Write raster to netCDF file.

ocmw.design.gradRaster.getRasterCoords(rasterPath, rasterFile)[source]

Get raster coordinates from netCDF file and generate gidded coordinates.

ocmw.design.gradRaster.normalise(v)[source]

Normalise a variable about its mean value.

ocmw.design.gradRaster.gradate(minval, maxval, var)[source]

Convert a raster into a gradation between minimum and maximum values.

ocmw.design.gradRaster.gradation2meshDensity(gradation)[source]

Convert a gradation raster into an equivalent mesh density assuming equilateral triangles.

ocmw.design.gradRaster.gradation2numElems(gradation, dx, dy)[source]

Convert a gradation raster into an equivalent number of element assuming equilateral triangles.

ocmw.design.gradRaster.distance2coast(shpPath, shpFile, BndIDs, x, y)[source]

Calculate the distance for a set of points (x,y) from features in a coastline shapefile.

ocmw.design.gradRaster.rasterise(x, y, v, xq, yq)[source]

Convert a variable on an unstructured mesh into a raster.

ocmw.design.gradRaster.vargradient(x, y, v, xq, yq)[source]

Calculate the spatial gradient of a mesh variable on a regular raster.

ocmw.design.gradRaster.plotRaster(x, y, raster, minval, maxval)[source]

Plot as raster as a colourised image.