monet.util.interp_util
Interpolation functions
Functions
|
Create a dataset with a constant latitude along a longitude array. |
|
Create a SwathDefinition with constant latitude along a longitude array. |
|
Create a SwathDefinition with constant longitude along a latitude array. |
Create pyresample SwathDefinition from xarray object. |
|
|
Create a pyresample SwathDefinition from longitude and latitude arrays. |
|
Create an empty xarray.Dataset with longitude and latitude coordinates. |
|
Create a SwathDefinition for a single point. |
- monet.util.interp_util.constant_1d_xesmf(longitude=None, latitude=None)
Create a dataset with a constant latitude along a longitude array.
- Parameters:
longitude (array-like) – Array of longitude values.
latitude (float or array-like) – Latitude value(s) to use as a constant.
- Returns:
A dataset with coordinates suitable for xesmf, where longitude varies but latitude is constant.
- Return type:
- monet.util.interp_util.constant_lat_swathdefition(longitude=None, latitude=None)
Create a SwathDefinition with constant latitude along a longitude array.
- Parameters:
longitude (array-like) – Array of longitude values, 1D or 2D.
latitude (float) – Constant latitude value to use for all points.
- Returns:
A SwathDefinition with constant latitude.
- Return type:
pyresample.geometry.SwathDefinition
- monet.util.interp_util.constant_lon_swathdefition(longitude=None, latitude=None)
Create a SwathDefinition with constant longitude along a latitude array.
- Parameters:
longitude (float) – Constant longitude value to use for all points.
latitude (array-like) – Array of latitude values, 1D or 2D.
- Returns:
A SwathDefinition with constant longitude.
- Return type:
pyresample.geometry.SwathDefinition
- monet.util.interp_util.latlon_xarray_to_CoordinateDefinition(longitude=None, latitude=None)
Create pyresample SwathDefinition from xarray object.
Converts xarray latitude and longitude coordinate arrays into a pyresample CoordinateDefinition suitable for spatial interpolation.
- Parameters:
longitude (2D xarray.DataArray) – Longitude array -> must be from -180 -> 180 and monotonically increasing.
latitude (2D xarray.DataArray) – Latitude array -> must be from -90 -> 90 and monotonically increasing.
- Returns:
A coordinate definition object that can be used with pyresample.
- Return type:
pyresample.geometry.CoordinateDefinition
- monet.util.interp_util.lonlat_to_swathdefinition(longitude=None, latitude=None)
Create a pyresample SwathDefinition from longitude and latitude arrays.
- Parameters:
longitude (array-like) – Longitude values, either 1D or 2D.
latitude (array-like) – Latitude values, either 1D or 2D.
- Returns:
A SwathDefinition object for the provided coordinates.
- Return type:
pyresample.geometry.SwathDefinition
- monet.util.interp_util.lonlat_to_xesmf(longitude=None, latitude=None)
Create an empty xarray.Dataset with longitude and latitude coordinates.
Creates a minimal xarray Dataset with the provided coordinates to be used as a target grid for xESMF regridding.
- Parameters:
longitude (array-like) – Longitude value(s).
latitude (array-like) – Latitude value(s).
- Returns:
A dataset with lon/lat coordinates suitable for use with xesmf.
- Return type:
- monet.util.interp_util.nearest_point_swathdefinition(longitude=None, latitude=None)
Create a SwathDefinition for a single point.
Used for nearest neighbor point-to-point interpolation.
- Parameters:
longitude (float) – Longitude of the point.
latitude (float) – Latitude of the point.
- Returns:
A SwathDefinition representing a single point.
- Return type:
pyresample.geometry.SwathDefinition