pywatershed.AdapterNetcdf#

class pywatershed.AdapterNetcdf(fname, variable, 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 – a tuple of dimension sizes

  • type – a variable dtype

  • control (Control) – a Control object

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

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

Methods

__init__(fname, variable, control[, ...])

advance()

Advance the adapter in time

close()

Close the underlying NetCDF file.

Attributes

current

Current time of the Adapter instance.

data

Return the data for the current time.

advance()[source]#

Advance the adapter in time

close()[source]#

Close the underlying NetCDF file.

property current#

Current time of the Adapter instance.

property data: array#

Return the data for the current time.