pyfvcom2.fvcom_writer module
- class pyfvcom2.fvcom_writer.FVCOMWriter(filename, dimensions, global_attributes=None, **kwargs)
Bases:
objectCreate an FVCOM netCDF input file.
- add_variable(name, data, dimensions, attributes=None, format='f4', ncopts={})
Create a
namevariable with the givenattributesanddata.- 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)
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.