import_3D#

import_3D(path, var, tstart, tend, ignore_missing='False')[source]#

Import a 3D variable from a sequence of daily NetCDF files.

Parameters:
  • path (str) – Directory containing the NetCDF files.

  • var (str) – Variable name to read from each file (e.g., ‘veloc_u_t’).

  • tstart (datetime) – Start date (inclusive).

  • tend (datetime) – End date (inclusive).

  • ignore_missing (str, optional) – If ‘False’ (default), the function exits when a file is missing. If ‘True’, missing days are allowed and filled with NaN.

Returns:

A 3D surface array with shape (ntime, ny, nx), dtype float64. Missing files are represented with NaN values.

Return type:

numpy.ndarray