:py:mod:`amescap.Ncdf_wrapper` ============================== .. py:module:: amescap.Ncdf_wrapper .. autoapi-nested-parse:: Ncdf_wrapper archives data into netCDF format. It serves as a wrapper for creating netCDF files. Third-party Requirements: * ``numpy`` * ``amescap.FV3_utils`` * ``scipy.io`` * ``netCDF4`` * ``os`` * ``datetime`` Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: amescap.Ncdf_wrapper.Fort amescap.Ncdf_wrapper.Ncdf .. py:class:: Fort(filename=None, description_txt='') Bases: :py:obj:`object` A class that generates an object from a fort.11 file. The new file will have netCDF file attributes. Alex Kling. EX:: f.variables.keys() f.variables['var'].long_name f.variables['var'].units f.variables['var'].dimensions Create a Fort object using the following:: f=Fort('/Users/akling/test/fort.11/fort.11_0684') Public methods can be used to generate FV3-like netCDF files:: f.write_to_fixed() f.write_to_average() f.write_to_daily() f.write_to_diurn() :param object: _description_ :type object: _type_ :return: _description_ :rtype: _type_ .. py:class:: Fort_var(input_vals, name_txt, long_name_txt, units_txt, dimensions_tuple) Bases: :py:obj:`numpy.ndarray` Sub-class that emulates a netCDF-like variable by adding the ``name``, ``long_name``, ``units``, and ``dimensions`` attributes to a numpy array. Inner class for ``fortran_variables`` (Fort_var) that comprise the Fort file. Alex Kling A useful resource on subclassing is available at: https://numpy.org/devdocs/reference/arrays.classes.html .. note:: Because we use an existing ``numpy.ndarray`` to define the object, we do not call ``__array_finalize__(self, obj)`` :param np.ndarray: _description_ :type np.ndarray: _type_ :return: _description_ :rtype: _type_ .. py:method:: __abs__() .. py:method:: __add__(value) .. py:method:: __and__(value) .. py:method:: __array__(dtype=None) .. py:method:: __array_wrap__(obj) .. py:method:: __class_getitem__(value) :classmethod: .. py:method:: __contains__(key) .. py:method:: __copy__() .. py:method:: __deepcopy__(memo) .. py:method:: __divmod__(value) .. py:method:: __eq__(value) Return self==value. .. py:method:: __float__() .. py:method:: __floordiv__() .. py:method:: __ge__(value) Return self>=value. .. py:method:: __getitem__(key) .. py:method:: __gt__(value) Return self>value. .. py:method:: __iadd__(value) .. py:method:: __iand__(value) .. py:method:: __ifloordiv__(value) .. py:method:: __ilshift__(value) .. py:method:: __imod__(value) .. py:method:: __imul__(value) .. py:method:: __int__() .. py:method:: __invert__() .. py:method:: __ior__(value) .. py:method:: __ipow__(value) .. py:method:: __irshift__(value) .. py:method:: __isub__(value) .. py:method:: __itruediv__(value) .. py:method:: __ixor__(value) .. py:method:: __le__(value) Return self<=value. .. py:method:: __len__() .. py:method:: __lshift__(value) .. py:method:: __lt__(value) Return self