Skip to content

[discussion] scipy.interpolate.griddata or cdo::remap #31

@chrisdane

Description

@chrisdane

Hi

Not an issue, rather a discussion.

  1. Why is it better to have ~1k lines of code (co2_interpolation.py) to finally call scipy.interpolate.griddata instead of an one(ish)-liner cdo remap* or such?

    If both methods yield (very) similar results - which is what I would expect if griddata's method = 'linear' and cdo's remapbil is used:

    co2_interpolated = griddata(
    co2_points,
    co2_values,
    icmgg_points,
    method='linear'

    - then I would prefer the (much) shorter method?

  2. Does it make a lot of sense that the interpolated field is a combination of two interpolation methods - linear and nearest neighbor, if the linear interpolation result includes NaNs?:

    if np.isnan(co2_interpolated).any():
    nan_mask = np.isnan(co2_interpolated)
    co2_interpolated[nan_mask] = griddata(
    co2_points,
    co2_values,
    icmgg_points[nan_mask],
    method='nearest'

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions