Skip to content

interp over time coordinate #2284

Closed
@ghost

Description

Before I start, I'm very excited about the interp addition in 0.10.7. Great addition and thanks to @fujiisoup and @shoyer.

I see there was a bit of a discussion in the interp pull request, #2104, about interpolating over times and that it was suggested to wait for use cases. I can think of an immediate use case in my line of work.
I frequently use regular gridded geophysical data (time, lat, lon), not unlike the sample tutorial air_temperature data, and the data must be interpolated to line up with corresponding satellite measurements that are irregularly spaced in lat, lon and time.

Being able to interpolate in one quick step would be fantastic. For example:

ds = xr.tutorial.load_dataset('air_temperature')
ds.interp(lat=60.5, lon=211, time='2013-01-01T03:14:37')

Problem description

Currently issues TypeError: cannot perform reduce with flexible type.

Desired Output

<xarray.Dataset>
Dimensions:  ()
Coordinates:
    lat      float64 60.5
    lon      int64 211
    time    datetime64[ns] 2013-01-01T03:14:37
Data variables:
    air      float64 273.5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions