mpas_tools.mesh.conversion.cull¶
-
mpas_tools.mesh.conversion.cull(dsIn, dsMask=None, dsInverse=None, dsPreserve=None, graphInfoFileName=None, logger=None)[source]¶ Use
MpasCellCuller.xto cull cells from a mesh based on thecullCellfield 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 acullCellfield set to one where cells should be removeddsMask (
xarray.Datasetor list, optional) – A data set (or data sets) with region masks that are 1 where cells should be culleddsInverse (
xarray.Datasetor list, optional) – A data set (or data sets) with region masks that are 0 where cells should be culleddsPreserve (
xarray.Datasetor 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.infoshould be written out. By default,culled_graph.infois not saved.logger (
logging.Logger, optional) – A logger for the output if not stdout
- Returns
dsOut (
xarray.Dataset) – The culled mesh