:py:mod:`opendrift.readers.reader_netCDF_CF_unstructured` ========================================================= .. py:module:: opendrift.readers.reader_netCDF_CF_unstructured Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: opendrift.readers.reader_netCDF_CF_unstructured.Reader Attributes ~~~~~~~~~~ .. autoapisummary:: opendrift.readers.reader_netCDF_CF_unstructured.logger .. py:data:: logger .. py:class:: Reader(filename=None, name=None, proj4=None) Bases: :py:obj:`opendrift.readers.basereader.BaseReader`, :py:obj:`opendrift.readers.basereader.UnstructuredReader` A reader for unstructured (irregularily gridded) `CF compliant `_ netCDF files. Args: :param filename: A single netCDF file, or a pattern of files. The netCDF file can also be an URL to an OPeNDAP server. :type filename: string, requiered. :param name: Name of reader :type name: string, optional :param proj4: PROJ.4 string describing projection of data. :type proj4: string, optional .. seealso:: py:mod:`opendrift.readers.basereader.unstructured`. Common constructor for all readers .. py:attribute:: variable_aliases .. py:attribute:: node_variables :value: ['salinity', 'temperature', 'sea_floor_depth_below_sea_level', 'sea_floor_depth_below_geoid',... .. py:attribute:: face_variables :value: ['x_sea_water_velocity', 'y_sea_water_velocity', 'upward_sea_water_velocity'] .. py:attribute:: dataset .. py:attribute:: siglay .. py:attribute:: siglev .. py:attribute:: siglay_center .. py:attribute:: siglev_center .. py:attribute:: ocean_depth_nele .. py:attribute:: ocean_depth_node .. py:method:: plot_mesh() Plot the grid mesh. Does not automatically show the figure. .. py:method:: get_variables(requested_variables, time=None, x=None, y=None, z=None) FVCOM Grid: FVCOM uses 'triangular prisms' for gridding. Some variables are defined on the faces of the triangles, while others at the node. `x` and `y` holds the positions of the node, while `xc` and `yc` holds the positions on the centroids/faces. The centroids/faces are also known as 'zonal', or elements (presumably as in finite element). .. note:: Currently this reader does not really interpolate. It looks up the closest point in time and space. Each element has a lookup-table of its surrounding elements, this list can be used when looking up elements for the interpolator of an arbitrary point on the grid. The same goes for the nodes. Let E be number of elements and N be number of nodes. Relevant lookup-tables: nbe: [3 x E] elements surround each element nbve: [9 x N] elements surrounding each node, minimum 3 nbsn: [11 x N] nodes surrounding each node Variables: Face: * u * v Node: * temperature * salinity .. py:method:: _vector_nearest_(X, xp) :staticmethod: Find nearest element in vector of vectors `X` for each `xp`. Args: X NxM matrix of levels xp M vector of positions Returns: i M vector of indices [0..N] of closest element in X[0..N, i] to xp[i] .. py:method:: __nearest_node_sigma__(var, nodes, z) Find nearest depth at node (sigma layer or sigma level depending on where the variable is defined). .. py:method:: __nearest_face_sigma__(var, el, z) Find nearest depth at element (sigma layer or sigma level depending on where the variable is defined). .. py:method:: z_from_sigma(sigma, depth, elevation=0) :staticmethod: Calculate z-depth from sigma constant. https://rdrr.io/github/edwardlavender/fvcom.tbx/src/R/depth_from_known.R Args: sigma Sigma coefficient(s) depth Depth below mean sea-surface elevation Elevation of sea-surface (e.g. tidal) Returns: z, depth below sea-surface in meters.