pywatershed.AdapterNetcdf#

class pywatershed.AdapterNetcdf(fname, variable, dim_sizes, type, control, load_n_time_batches=1)[source]#

Adapter subclass for a NetCDF file

This requires that the NetCDF file have a time dimension named “time” or “doy” (day of year) to be properly handled as a timeseries for input, etc.

Parameters:
  • fname (Union[str, Path]) – filename of netcdf as string or Path

  • variable (str) – variable name string

  • dim_sizes (tuple) – a tuple of dimension sizes

  • type (str) – a variable dtype

  • control (Control) – a Control object

  • load_n_time_batches (int) – number of times to read from file.

__init__(fname, variable, dim_sizes, type, control, load_n_time_batches=1)[source]#

Methods

__init__(fname, variable, dim_sizes, type, ...)

advance()

Advance the adapter in time

Attributes

current

Current time of the Adapter instance.

data

Return the data for the current time.

advance()[source]#

Advance the adapter in time

property current#

Current time of the Adapter instance.

property data: array#

Return the data for the current time.