gcpy.file_regrid

gcpy.file_regrid(filein, fileout, dim_format_in, dim_format_out, cs_res_out=0, ll_res_out='0x0', sg_params_in=None, sg_params_out=None, verbose=False, weightsdir='.')[source]

Regrids an input file to a new horizontal grid specification and saves it as a new file.

Parameters:
  • filein (str) – The input filename.

  • fileout (str) – The output filename (file will be overwritten if it already exists).

  • dim_format_in (str) – Format of the input file’s dimensions (choose from: classic, checkpoint, diagnostic), where classic denotes lat/lon and checkpoint / diagnostic are cubed-sphere formats.

  • dim_format_out (str) – Format of the output file’s dimensions (choose from: classic, checkpoint, diagnostic), where classic denotes lat/lon and checkpoint / diagnostic are cubed-sphere formats.

  • cs_res_out (int, optional) – The cubed-sphere resolution of the output dataset. Not used if dim_format_out is classic. Default value: 0

  • ll_res_out (str, optional) – The lat/lon resolution of the output dataset. Not used if dim_format_out is not classic. Default value: “0x0”

  • sg_params_in (list of float, optional) – Input grid stretching parameters [stretch-factor, target longitude, target latitude]. Not used if dim_format_in is classic. Default value: [1.0, 170.0, -90.0] (No stretching)

  • sg_params_out (list of float, optional) – Output grid stretching parameters [stretch-factor, target longitude, target latitude]. Not used if dim_format_out is classic. Default value: [1.0, 170.0, -90.0] (No stretching)

  • verbose (bool, optional) – Toggles verbose output on (True) or off (False). Default value: False

  • weightsdir (str, optional) – Path to the directory containing regridding weights (or where weights will be created). Default value: “.”