compass.landice.tests.ismip7_forcing.fracture.remap_utils.extrapolate_source

compass.landice.tests.ismip7_forcing.fracture.remap_utils.extrapolate_source(input_file, output_file, varnames, logger)[source]

Extrapolate fill/missing values on the source polar stereographic grid using nearest-neighbor via distance_transform_edt. This must be done before remapping so that fill values don’t contaminate the interpolation stencil.

Parameters:
  • input_file (str) – Path to the input NetCDF file on the source grid

  • output_file (str) – Path to write the extrapolated file

  • varnames (str or list of str) – Name(s) of the variable(s) to extrapolate

  • logger (logging.Logger) – Logger for status messages