interpolate_to_geodesic_waypoints#
- rojak.core.geometric.interpolate_to_geodesic_waypoints(start, end, grid_size, target_data, n_points_safety_factor=2, n_points=None, lat_dim_name='latitude', lon_dim_name='longitude', waypoints_dim_name='waypoints', **interpolation_kwargs)[source]#
Interpolate gridded data onto the geodesic waypoints between two coordinates
See
geodesic_waypoints_between()for how the waypoints themselves are computed.- Parameters:
start (Coordinate) – Starting coordinate
end (Coordinate) – Ending coordinate
grid_size (float) – Grid spacing in degrees, used to estimate the number of waypoints if
n_pointsis not giventarget_data (T) – Gridded data to interpolate, with
lat_dim_name/lon_dim_namecoordinatesn_points_safety_factor (float) – Safety factor applied to the estimated number of waypoints. Ignored if
n_pointsis given.n_points (int | None) – Number of waypoints to use. If
None(default), the number is estimated fromgrid_size.lat_dim_name (str) – Name of the latitude coordinate in
target_data. Defaults to"latitude".lon_dim_name (str) – Name of the longitude coordinate in
target_data. Defaults to"longitude".waypoints_dim_name (str) – Name to give the new dimension along the waypoints. Defaults to
"waypoints".**interpolation_kwargs (Any) – Additional keyword arguments passed to
xarray.DataArray.interp()/xarray.Dataset.interp()
- Returns:
target_datainterpolated onto the waypoints betweenstartandend, with a newwaypoints_dim_namedimension- Return type:
T