interpolate_vertical¶
Import path: earth2studio.utils.interp.interpolate_vertical
Documentation¶
Interpolate x linearly along a vertical coordinate onto target levels.
The coordinate can be anything monotonic within a column: pressure (with
log=True, for interpolation linear in log pressure), height or depth.
Parameters:
-
x(Tensor) –Field with a level dimension
dim. -
coordinate(Tensor) –Coordinate of each of
x's levels: either one value per level, shape(level,)in any order without repeats, or one column per point, shaped likex(or broadcastable to it) and monotonic alongdimin the same direction in every column. Columns that are not strictly monotonic, such as hybrid levels under an implausible surface pressure, are filled withfill_value, or NaN without one, rather than interpolated. -
target(Tensor) –Coordinate of each output level, shape
(target,), in the same units. -
dim(int, default:-1) –Level dimension of
xandcoordinate, by default -1 -
log(bool, default:False) –Interpolate linearly in the logarithm of the coordinate, as for pressure, by default False
-
fill_value(float | None, default:None) –Value for targets outside a column's range, by default None, which takes the nearest level's value instead.
Returns:
-
Tensor–xwith dimensiondimreplaced by the target levels, inx's dtype. Coordinates and weights are computed in at least single precision, as pressures in Pa overflow half precision.