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 / y are longitudes / latitudes for a lat / lon field. z is required when the field has a vertical dimension (see vertical_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. times is required when the field has a time dimension and is matched the same way. Horizontally, a point outside the field’s cells is NaN: a missing mole fraction is not zero, unlike a missing flux in stilt.flux.sample_flux(). Longitudes are wrapped into the field’s convention (-180..180 or 0..360).

Return type:

ndarray

Parameters: