mpas_tools.mesh.conversion.convert

mpas_tools.mesh.conversion.convert(dsIn, graphInfoFileName=None, logger=None, dir=None)[source]

Convert an input mesh to a valid MPAS mesh using MpasMeshConverter.x.

This function ensures the mesh is fully compliant with the MPAS mesh specification. It writes the input dataset to a temporary file, runs the converter, and loads the output as an xarray.Dataset.

Parameters:
  • dsIn (xarray.Dataset) – Input dataset describing the mesh to convert.

  • graphInfoFileName (str, optional) – Path to save the generated graph.info file. If not provided, the file is not saved.

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

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

Returns:

dsOut (xarray.Dataset) – The converted MPAS mesh dataset.

Notes

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

  • Temporary files are created and deleted automatically.