Derivatives (rojak.core.derivatives)#
Coordinate-aware spatial derivatives on a latitude/longitude grid
This module computes gradients, divergence, and the Laplacian of fields defined on a geographic (latitude/
longitude) grid, accounting for the physical (geodesic) distance between grid points and, where relevant, the
distortion introduced by a map projection. It underlies the derivative-based turbulence diagnostics in
rojak.turbulence.calculations and rojak.turbulence.diagnostic.
Grid spacing between adjacent points can be computed either from the true geodesic distance at every grid point
(grid_spacing()) or, more cheaply, from a nominal spacing measured along the equator and prime meridian
(nominal_grid_spacing()). get_projection_correction_factors() computes the map projection scale factors
used to correct raw Cartesian derivatives (spatial_gradient(), in GradientMode.GEOSPATIAL mode) for
projection distortion, and vector_derivatives() computes the full set of horizontal velocity derivatives
(du/dx, du/dy, dv/dx, dv/dy) with this correction applied. divergence() and spatial_laplacian() build on
spatial_gradient().
Functions
|
Horizontal divergence of a 2D vector field |
|
First derivative of |
|
Get the axis position of a named dimension in a DataArray |
|
Compute the map projection scale factors at each point of a latitude/longitude grid |
|
Compute the geodesic distance between adjacent points of a 2D latitude/longitude grid |
|
Estimate the grid spacing of a regular latitude/longitude grid from a single row and column |
|
Spatial gradient of a scalar field on a latitude/longitude grid |
|
Laplacian of a scalar field on a latitude/longitude grid |
|
Horizontal derivatives of a 2D velocity field, corrected for map projection distortion |
Classes
|
Cartesian x/y direction, and the corresponding geographic coordinate/grid spacing/scale factor |
|
How |
|
Grid spacing (in meters) along the x and y Cartesian directions, e.g. as computed by |
|
Units latitude/longitude coordinates are expressed in |
|
Map projection scale factors, as computed by |
|
x and y components of a spatial gradient, as computed by |
|
The four horizontal derivatives of a 2D velocity field, as computed by |