stilt.flux.sample_field#
- stilt.flux.sample_field(field, x, y, z=None, times=None)[source]#
Return the field’s value in the cell nearest each point.
A point outside the field horizontally gives
NaN, since a missing mole fraction is unknown rather than zero (sample_flux()fills with zero instead). Longitudes are wrapped to the field’s convention (-180 to 180 or 0 to 360).- Parameters:
field (
DataArray) – Field with horizontal dimensions (latandlon, oryandx), and optionally a vertical dimension andtime.x (
TypeAliasType) – Point coordinates: longitude and latitude for alat/lonfield.y (
TypeAliasType) – Point coordinates: longitude and latitude for alat/lonfield.z (
TypeAliasType|None) – Vertical coordinate of each point, in the units of the field’s vertical dimension. Required when the field has one. Matched to the nearest level, so a point above the top level takes the top level.times (
TypeAliasType|None) – Time of each point. Required when the field has atimedimension. Matched to the nearest time.
- Returns:
One value per point.
- Return type: