epygram.formats.TIFFMF — Interface-Class to the TIFFMF format

Contains the class to handle TIFFMF format.

class epygram.formats.TIFFMF.TIFFMF(*args, **kwargs)[source]

Bases: epygram.resources.FileResource.FileResource

Class implementing all specificities for TIFFMF resource format.


This class is managed by footprint.

  • info: Not documented
  • priority: PriorityLevel::DEFAULT (rank=1)

Automatic parameters from the footprint:

  • filename (str) - rxx - File name (absolute or relative) of the resource.
  • fmtdelayedopen (bool) - rxx - Opening of the resource delayed (not at time of construction).
    • Optional. Default is False.
  • format (str) - rxx - Format of the resource.
    • Optional. Default is ‘TIFFMF’.
    • Values: set([‘TIFFMF’])
  • openmode (str) - rxx - Opening mode.
    • Values: set([‘a’, ‘write’, ‘r’, ‘w’, ‘read’, ‘append’])
    • Remap: dict(append = ‘a’, read = ‘r’, write = ‘w’,)

Closes a TIFFMF file.

find_fields_in_resource(seed=None, fieldtype=[], generic=False)[source]

Returns a list of the fields from resource whose identifier match the given seed.


  • seed: might be a tuple of regular expressions, a list of regular expressions tuples or None.

    If None (default), returns the list of all fields in resource.

  • fieldtype: optional, among (‘H2D’, ‘Misc’) or a list of these strings. If provided, filters out the fields not of the given types.

  • generic: if True, returns a list of tuples (fieldname, generic fid) of the fields.


Returns a list containing the TIFFMF identifiers of all the fields of the resource.


Opens a TIFFMF, and initializes some attributes.

readfield(*args, **kwargs)

Reads one field, given its identifier, and returns a Field instance. Interface to Fortran routines from ‘ifsaux’.


  • fieldidentifier: name.

  • getdata: optional, if False, only metadata are read, the field do not contain data.

    Default is True.

readfields(requestedfields=None, getdata=True)[source]

Returns a epygram.base.FieldSet containing requested fields read in the resource.


  • requestedfields: might be

    • an expressions with regular expressions (e.g. ‘CMS‘)
    • a list of TIFFMF fields identifiers with regular expressions (e.g. [‘TIME‘, ‘CMS‘])
    • if not specified, interpretated as all fields that will be found in resource
  • getdata: optional, if False, only metadata are read, the fields do not contain data.

    Default is True.


Returns a sorted list of fields with regards to their name, as a dict of lists.

what(*args, **kwargs)

Writes in file a summary of the contents of the TIFFMF.


  • out: the output open file-like object (duck-typing: out.write() only is needed).
  • sortfields: True if the fields have to be sorted.

Write a field in the resource.



Write the fields of the fieldset in the resource.