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 a
cullCell
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 culled
dsInverse (xarray.Dataset or list, optional) – A data set (or data sets) with region masks that are 0 where cells should be culled
dsPreserve (xarray.Dataset or list, optional) – A data set (or data sets) with region masks that are 1 where cells should not be culled
graphInfoFileName (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 stdout
dir (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