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
cullCellfield in the input dataset and/or provided mask datasets. Masks are merged as follows: -cullCell,dsMask, anddsInverseare combined (union). -dsPreserveindicates cells that must not be culled.- Parameters:
dsIn (xarray.Dataset) – Input mesh dataset, optionally with a
cullCellfield.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.infofile.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.xto be available in the system path.Temporary files are created and deleted automatically.