mpas_tools.mesh.conversion.cull

mpas_tools.mesh.conversion.cull(dsIn, dsMask=None, dsInverse=None, dsPreserve=None, graphInfoFileName=None, logger=None, dir=None)[source]

Cull cells from a mesh using MpasCellCuller.x.

The function removes cells based on the cullCell field in the input dataset and/or provided mask datasets. Masks are merged as follows: - cullCell, dsMask, and dsInverse are combined (union). - dsPreserve indicates cells that must not be culled.

Parameters:
  • dsIn (xarray.Dataset) – Input mesh dataset, optionally with a cullCell field.

  • dsMask (xarray.Dataset or list, optional) – Dataset(s) with region masks (1 where cells should be culled).

  • dsInverse (xarray.Dataset or list, optional) – Dataset(s) with region masks (0 where cells should be culled).

  • dsPreserve (xarray.Dataset or list, optional) – Dataset(s) with region masks (1 where cells should NOT be culled).

  • graphInfoFileName (str, optional) – Path to save the generated culled_graph.info file.

  • logger (logging.Logger, optional) – Logger for capturing output from the culler.

  • dir (str, optional) – Directory in which to create a temporary working directory.

Returns:

dsOut (xarray.Dataset) – The culled mesh dataset.

Notes

  • Requires MpasCellCuller.x to be available in the system path.

  • Temporary files are created and deleted automatically.