API reference

This page provides an auto-generated summary of the MPAS mesh-tools API. For more details and examples, refer to the relevant chapters in the main part of the documentation.

MPAS mesh tools

make_planar_hex_mesh(nx, ny, dc, …[, …])

Builds an MPAS periodic, planar hexagonal mesh with the requested dimensions, optionally saving it to a file, and returs it as an xarray.Dataset.

translate(mesh[, xOffset, yOffset])

Translates the coordinate system of the planar MPAS mesh by an arbirary shift in x and/or y

build_mesh.build_mesh([preserve_floodplain, …])

Build an MPAS mesh using JIGSAW with the given cell sizes as a function of latitude and longitude (on a sphere) or x and y (on a plane).

coastal_tools.coastal_refined_mesh(params[, …])

inject_bathymetry.inject_bathymetry(mesh_file)

inject_meshDensity.inject_meshDensity(…[, …])

inject_preserve_floodplain.inject_preserve_floodplain(…)

jigsaw_driver.jigsaw_driver(cellWidth, x, y)

A function for building a jigsaw mesh

mesh_definition_tools.mergeCellWidthVsLat(…)

mergeCellWidthVsLat: combine two cell width distributions using a tanh function.

mesh_definition_tools.EC_CellWidthVsLat(lat)

Create Eddy Closure spacing as a function of lat.

mesh_definition_tools.RRS_CellWidthVsLat(…)

RRS_CellWidthVsLat - Create Rossby Radius Scaling as a function of lat.

mesh_definition_tools.AtlanticPacificGrid(…)

AtlanticPacificGrid: combine two cell width distributions using a tanh function.

mpas_to_triangle.mpas_to_triangle(mpasfile, …)

open_msh.readmsh(fname)

Reads JIGSAW msh structure and produces a dictionary with values.

triangle_to_netcdf.triangle_to_netcdf(node, …)

Converts mesh data defined in triangle format to NetCDF

jigsaw_to_netcdf.jigsaw_to_netcdf(…)

Converts mesh data defined in triangle format to NetCDF

convert(dsIn[, graphInfoFileName, logger])

Use MpasMeshConverter.x to convert an input mesh to a valid MPAS mesh that is fully compliant with the MPAS mesh specification.

cull(dsIn[, dsMask, dsInverse, dsPreserve, …])

Use MpasCellCuller.x to cull cells from a mesh based on the cullCell field in the input file or DataSet and/or the provided masks.

mask(dsMesh[, fcMask, fcSeed, positiveLon, …])

Use MpasMaskCreator.x to create a set of region masks either from mask feature collecitons or from seed points to be used to flood fill

merge_grids([infile1, infile2, outfile, runner])

Merges two MPAS non-contiguous meshes together into a single file

split_grids([infile, outfile1, outfile2, …])

Split two previously merged MPAS non-contiguous meshes together into separate files.

write_netcdf(ds, fileName[, fillValues, format])

Write an xarray Dataset with NetCDF4 fill values where needed

scrip_from_mpas(mpasFile, scripFile[, …])

Create a SCRIP file from an MPAS mesh

Ocean Tools

add_critical_land_blockages(dsMask, dsBlockages)

param dsMask

The mask to which critical blockages should be added

widen_transect_edge_masks(dsMask, dsMesh[, …])

param dsMask

The mask to which critical blockages should be added

make_moc_basins_and_transects(gf, …[, …])

Builds features defining the ocean basins and southern transects used in computing the meridional overturning circulation (MOC) :param gf: An object that knows how to download and read geometric featuers :type gf: GeometricFeatures :param mesh_filename: A file with MPAS mesh information :type mesh_filename: str :param mask_and_transect_filename: A file to write the MOC region masks and southern-boundary transects to :type mask_and_transect_filename: str :param geojson_filename: A file to write MOC regions to :type geojson_filename: str, optional :param mask_filename: A file to write MOC region masks to :type mask_filename: str, optional :param logger: A logger for the output if not stdout :type logger: logging.Logger, optional

build_moc_basins(gf[, logger])

Builds features defining the ocean basins used in computing the meridional overturning circulation (MOC) :param gf: An object that knows how to download and read geometric featuers :type gf: GeometricFeatures :param logger: A logger for the output if not stdout :type logger: logging.Logger, optional

Visualization

extract_vtk(filename_pattern[, …])

Extract fields from a time series of NetCDF files as VTK files for plotting in paraview.