Skip to content

API: inconsistent projection arguments in img_transform.regrid #2013

@ellequelle

Description

@ellequelle

While helping someone with their code I noticed this inconsistency in the img_transform.regrid API and docstring. The projection parameters are source_cs and target_proj, but in the docstring they're listed as source_cs and target_cs:

regrid excerpt

def regrid(array, source_x_coords, source_y_coords, source_cs, target_proj,
target_x_points, target_y_points, mask_extrapolated=False):
"""
Regrid the data array from the source projection to the target projection.
Parameters
----------
array
The :class:`numpy.ndarray` of data to be regridded to the
target projection.
source_x_coords
A 2-dimensional source projection :class:`numpy.ndarray` of
x-direction sample points.
source_y_coords
A 2-dimensional source projection :class:`numpy.ndarray` of
y-direction sample points.
source_cs
The source :class:`~cartopy.crs.Projection` instance.
target_cs
The target :class:`~cartopy.crs.Projection` instance.

Could this be changed to match img_transform.wrap_array, with source_proj and target_proj?

wrap_array excerpt

def warp_array(array, target_proj, source_proj=None, target_res=(400, 200),
source_extent=None, target_extent=None,
mask_extrapolated=False):
"""
Regrid the data array from the source projection to the target projection.
Also see, :func:`~cartopy.img_transform.regrid`.
Parameters
----------
array
The :class:`numpy.ndarray` of data to be regridded to the target
projection.
target_proj
The target :class:`~cartopy.crs.Projection` instance for the data.
source_proj: optional
The source :class:`~cartopy.crs.Projection' instance of the data.
Defaults to a :class:`~cartopy.crs.PlateCarree` projection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions