mpas_tools.mesh.conversion.cull¶
-
mpas_tools.mesh.conversion.
cull
(dsIn, dsMask=None, dsInverse=None, dsPreserve=None, graphInfoFileName=None, logger=None, dir=None)[source]¶ Use
MpasCellCuller.x
to cull cells from a mesh based on thecullCell
field in the input file or DataSet and/or the provided masks.cullCell
, dsMask and dsInverse are merged together so that the final mask is the union of these 3. The preserve mask is then used to determine where cells should not be culled.- Parameters
dsIn (
xarray.Dataset
) – A data set to cull, possibly with acullCell
field set to one where cells should be removeddsMask (
xarray.Dataset
or list, optional) – A data set (or data sets) with region masks that are 1 where cells should be culleddsInverse (
xarray.Dataset
or list, optional) – A data set (or data sets) with region masks that are 0 where cells should be culleddsPreserve (
xarray.Dataset
or list, optional) – A data set (or data sets) with region masks that are 1 where cells should not be culledgraphInfoFileName (str, optional) – A file path (relative or absolute) where the graph file (typically
culled_graph.info
should be written out. By default,culled_graph.info
is not saved.logger (
logging.Logger
, optional) – A logger for the output if not stdoutdir (str, optional) – A directory in which a temporary directory will be added with files produced during cell culling and then deleted upon completion.
- Returns
dsOut (
xarray.Dataset
) – The culled mesh