stilt.observations.backgrounds.sample_field#
- stilt.observations.backgrounds.sample_field(field, x, y, z=None, times=None)[source]#
Field value at the cell nearest each
(x, y[, z][, time])point.x/yare longitudes / latitudes for alat/lonfield.zis required when the field has a vertical dimension (seevertical_dim()) and is in that coordinate’s units; it is matched to the nearest level and held at the ends, so a point above the top level takes the top level.timesis required when the field has atimedimension and is matched the same way. Horizontally, a point outside the field’s cells isNaN: a missing mole fraction is not zero, unlike a missing flux instilt.flux.sample_flux(). Longitudes are wrapped into the field’s convention (-180..180or0..360).- Return type:
- Parameters:
field (DataArray)
x (_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
y (_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
z (_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None)
times (_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None)