Encoders

Warning

This guide is currently under construction and may be incomplete or inaccurate.

An encoder is used to generate data in a suitable format that can be written/added to a target. Encoders are typically used implicitly via to_target() but we can also instantiate an Encoder and work with it directly.

create_encoder()

We can create an Encoder via create_encoder().

create_encoder(name, *args, **kwargs)

Create an encoder specified by name .

Parameters:
  • name (str) – the encoder. name can refer for a built-in encoder (see below) or an encoder plugin.

  • *args (tuple) –

    specify encoder parameters

  • **kwargs (dict) –

    specify additional encoder parameters.

Built in encoders

earthkit-data has the following built-in encoders:

Data encoders

Name

Description

Class

grib

encode data as GRIB

GribEncoder

netcdf

encode data as NetCDF

NetCDFEncoder

geotiff

encode data as GeoTIFF

GeoTIFFEncoder

csv

encode data as CSV

CSVEncoder

Examples