epygram.formats — Formats

Module contains:

  • all formats classes.

  • utilities to play with resource formats:

    • guess the format of an existing resource in a given container;

    • open a Resource instance with a generic function (potentially guessing its format if in read mode);

    • FA fields utilities

    • conversion utilities




epygram.formats.runtime_available_formats = ['netCDFMNH', 'netCDF', 'GRIB', 'GeoPoints', 'TIFFMF', 'FA', 'LFI', 'DDHLFA', 'LFA']

list of formats actually available at runtime


Functions:

epygram.formats.guess(filename)[source]

Returns the name of the format of the resource located at a given filename, if succeeded.

epygram.formats.resource(filename, openmode, fmt=None, **kwargs)[source]

Returns an instance of Resource of the requested fmt format, located at the given filename, open with the given openmode.

Parameters:
  • filename – name (path) of the file to open

  • openmode – opening mode (‘r’, ‘a’, ‘w’)

  • fmt – format of the resource; with openmode ‘r’ or ‘a’, fmt is optional and can be guessed from the existing resource

Other kwargs are passed to the resource constructor.

epygram.formats.available_format(fmt)[source]

Check availability of low-level libraries for activating format.