pyfvcom2.fvcom_writer module

class pyfvcom2.fvcom_writer.FVCOMWriter(filename, dimensions, global_attributes=None, **kwargs)[source]

Bases: object

Create an FVCOM netCDF input file.

add_variable(name, data, dimensions, attributes=None, format='f4', ncopts={})[source]

Create a `name’ variable with the given `attributes’ and `data’.

Parameters:
  • name (str) – Variable name to add.

  • data (np.ndararay, list, float, str) – Data to add to the netCDF file object.

  • dimensions (list, tuple) – List of dimension names to apply to the new variable.

  • attributes (dict, optional) – Attributes to add to the netCDF variable object.

  • format (str, optional) – Data format for the new variable. Defaults to ‘f4’ (float32).

  • ncopts (dict) – Dictionary of options to use when creating the netCDF variables.

write_fvcom_time(time, **kwargs)[source]

Write the four standard FVCOM time variables (time, Times, Itime, Itime2) for the given time series.

Parameters:

time (np.ndarray, list, tuple) – Times as datetime objects.