fill_one_file#

mhm_tools.pre.fill_nearest.fill_one_file(input_file, input_dir, fill_value, default_value, mask, output_dir)[source]#

Fill all data variables in one NetCDF file and write the result.

Parameters:
  • input_file (pathlib.Path) – NetCDF file to read.

  • input_dir (pathlib.Path) – Base input directory used for relative log messages.

  • fill_value (float) – Fill value written to output metadata and masked cells.

  • default_value (float) – Value to fill masked area if the whole domain is empty and nearest interpolation not possible.

  • mask (numpy.ndarray or None) – Optional fixed output mask shared by all data variables.

  • output_dir (pathlib.Path) – Directory where the filled file is written.

Returns:

Path to the written output file.

Return type:

pathlib.Path