Processing (proc) component

Every Field may carry a processing component (proc) that describes post-processing operations applied to produce the field. The processing component is accessible via the proc attribute of a field and is represented by a subclass of ProcBase.

Fields that carry no processing information have an EmptyProc component where all keys return None.

Note

The proc component interface is still under active development. Its final form is not yet fully defined, and breaking changes may occur in future releases.

>>> import earthkit.data as ekd
>>> field = ekd.from_source("file", "lsp_step_range.grib2").to_fieldlist()[0]
>>> field.proc.time_method()
accum
>>> field.proc.time_value()
datetime.timedelta(seconds=259200)
>>> field.get("proc.time_method")
accum

Processing items

The processing component stores a list of ProcItem instances. Currently the only supported item type is TimeProcItem, which pairs a time-span value with a processing method.

Time processing methods

Enum member

Name string

Description

TimeMethods.ACCUMULATED

"accum"

Field values represent an accumulation over the time span (e.g. precipitation totals).

TimeMethods.AVERAGE

"avg"

Field values represent a time average over the time span.

TimeMethods.INSTANT

"instant"

Field values are instantaneous (no time averaging or accumulation).

TimeMethods.MAX

"max"

Field values represent the maximum over the time span.

Accessing processing information

All proc keys are accessible through get() with the "proc." prefix, and can therefore be used in sel(), order_by(), and metadata().

Key

Description

proc.time

The first TimeProcItem in the processing list, or None if no time processing is present.

proc.time_value

The time-span value from the first time processing item as a datetime.timedelta, or None.

proc.time_method

The processing method from the first time processing item as a TimeMethod, or None.

How-tos