xscape.utils.get_gridcenter_points
- xscape.utils.get_gridcenter_points(points, var_da)
Gets the corresponding pixel coordinates for a series of points.
Returns a DataFrame with points as rows, which correspond to the coordinates of the pixels of var_da in which each point in points is.
- Parameters:
points (pd.DataFrame) – DataFrame of points as rows with “lat” and “lon” columns.
var_da (xr.DataArray) – Gridded background field on whose grid to project the points.
- Returns:
A DataFrame in the same format as points with the center coordinates of pixels in var_da
- Return type:
pd.DataFrame