stilt.flux.sample_flux#

stilt.flux.sample_flux(flux, x, y, times=None)[source]#

Return the flux at each point, or zero outside the field.

sample_field() with missing values, and points outside the field, counted as zero flux.

Parameters:
  • flux (DataArray) – Flux on a lat/lon or y/x grid, with an optional time dimension.

  • x (TypeAliasType) – Point coordinates, longitude and latitude for a lat/lon field.

  • y (TypeAliasType) – Point coordinates, longitude and latitude for a lat/lon field.

  • times (TypeAliasType | None) – Time of each point. Required when flux has a time dimension. Each point takes the nearest time step, so times outside the field’s span take the first or last one.

Returns:

Flux at each point, in the flux’s units.

Return type:

ndarray