pypago.grid¶
Class that handles grid scale factors for a model configuration
Functions
create_grid (coord[, jmin, jmax, imin, imax]) |
Returns a Grid instance associated with the input coord argument. |
Classes
CommonGrid (coord, jmin, jmax, imin, imax) |
Grid class associated with all models but GFDL |
GfdlGrid (coord, jmin, jmax, imin, imax) |
GFDL grid class |
Grid (coord, jmin, jmax, imin, imax) |
Class that handles grid extraction on a specific domain |
-
class
CommonGrid
(coord, jmin, jmax, imin, imax)[source]¶ Grid class associated with all models but GFDL
-
class
Grid
(coord, jmin, jmax, imin, imax)[source]¶ Class that handles grid extraction on a specific domain
Parameters: - :param
pypago.coords.Coords
coord: Coordinate object - associated with the grid file (longitude, latitude, mask of the entire domain, used in the file extraction)
-
compute_areas
()[source]¶ Computes the cell area at the northern and western faces, and the volume and surface of the T grid cells.
-
create_3d_vert_scalefact
()[source]¶ If the vertical scale factor dzt is 1D, it reconstructs a 3D variable by repeating the 1D variable along the lon and lat dimensions
-
extract_2d_var
(varin)[source]¶ Extraction of a 2D variable on the subdomain defined by the four domain limits. It provides the possibility to read a variable “discontinuously” (if imin > imax).
Parameters: varin (numpy.array) – Input 2D variable Returns: The input array extracted on the specified subdomain Return type: numpy.array
-
extract_3d_var
(varin)[source]¶ Extraction of a 2D variable on the subdomain defined by the four domain limits. It provides the possibility to read a variable “discontinuously” (if imin > imax).
Parameters: varin (numpy.array) – Input 3D variable Returns: The input array extracted on the specified subdomain Return type: numpy.array
-
extract_all_var
(coord)[source]¶ Extracts all the variables (coordinates, scale factors, etc) on the sub-domain defined by the jmin, jmax, imin and imax variables.
-
plot_dom
(ax=None)[source]¶ Draws the domain defined by the jmax, jmin, imin, and imax attributes.
Parameters: ax (matplotlib.axes.Axes) – Axis on which to draw the figure. If None, draws on current axis.
- :param
-
create_grid
(coord, jmin=None, jmax=None, imin=None, imax=None)[source]¶ Returns a Grid instance associated with the input coord argument. If it is a pypago.coord.GfdlCoords object, then it returns a
pypago.grid.GfdlGrid
object. Else, it returns apypago.grid.CommonGrid
object.Parameters: - :param
pypago.coords.Coords
coord: Coordinate object - associated with the grid file (longitude, latitude, mask of the entire domain, used in the file extraction)
- :param