get_projection_correction_factors#
- rojak.core.derivatives.get_projection_correction_factors(latitude, longitude, use_dask, is_radians=False, crs=None)[source]#
Compute the map projection scale factors at each point of a latitude/longitude grid
These factors (see
ProjectionCorrectionFactors) are used to correct derivatives computed on the raw latitude/longitude grid (seeGradientMode.GEOSPATIALinspatial_gradient(), andvector_derivatives()) for the distortion introduced by the map projection.- Parameters:
latitude (DataArray) – 1D array of latitude coordinates
longitude (DataArray) – 1D array of longitude coordinates
use_dask (bool) – If
True, compute the factors lazily with daskis_radians (bool) – Whether
latitude/longitudeare in radians. Defaults toFalse(degrees).crs (CRS | None) – Coordinate reference system to compute the scale factors for. Defaults to plain latitude/longitude (
"+proj=latlon").
- Returns:
Scale factors, with dimensions matching
latitudeandlongitude- Raises:
ValueError – If
latitudeandlongitudedo not both have exactly 1 dimension- Return type: