pyremap.remapper.Remapper.ncremap

Remapper.ncremap(in_filename, out_filename, variable_list=None, overwrite=False, renormalize=None, logger=None, replace_mpas_fill=False, parallel_exec=None)[source]

Given a source file defining either an MPAS mesh or a lat-lon grid and a destination file or set of arrays defining a lat-lon grid, constructs a mapping file used for interpolation between the source and destination grids.

Parameters:
  • in_filename (str) – The path to the file containing a data set on the source grid

  • out_filename (str) – The path where the data on the destination grid should be written

  • variable_list (list of str, optional) – A list of variables to be mapped. By default, all variables are mapped

  • overwrite (bool, optional) – Whether the destination file should be overwritten if it already exists. If False, and the destination file is already present, the function does nothing and returns immediately

  • renormalize (float, optional) – A threshold to use to renormalize the data

  • logger (logging.Logger, optional) – A logger to which ncclimo output should be redirected

  • replace_mpas_fill (bool, optional) – For MPAS meshes, whether add a _FillValue attribute (missing from MPAS output). If this has been handled before the call, replacing the fill value again may cause errors.

  • parallel_exec ({'srun'}, optional) – The name of the parallel executable to use to launch ncremap. By default, none is used.

Raises:
  • OSError – If ncremap is not in the system path.

  • ValueError – If mapping_file_name is None (meaning no remapping is needed).