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.
Note
This class is managed by footprint.
info: Not documented
priority: PriorityLevel::DEFAULT (rank=1)
Automatic parameters from the footprint:
filename (
builtins.str
) - rxx - File name (absolute or relative) of the resource.fmtdelayedopen (
builtins.bool
) - rxx - Opening of the resource delayed (not at time of construction).Optional. Default is False.
format (
builtins.str
) - rxx - Format of the resource.Optional. Default is ‘TIFFMF’.
Values: set([‘TIFFMF’])
openmode (
builtins.str
) - rxx - Opening mode.Values: set([‘append’, ‘r’, ‘read’, ‘w’, ‘a’, ‘write’])
Remap: dict(append = ‘a’, read = ‘r’, write = ‘w’,)
Constructor. See its footprint for arguments.
- filename¶
File name (absolute or relative) of the resource (see the documentation above for more details).
- find_fields_in_resource(seed=None, fieldtype=[], generic=False)[source]¶
Returns a list of the fields from resource whose identifier match the given seed.
Args:
- 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.
- fmtdelayedopen¶
Opening of the resource delayed (not at time of construction) (see the documentation above for more details).
- format¶
Format of the resource (see the documentation above for more details).
- listfields(**kwargs)[source]¶
Returns a list containing the TIFFMF identifiers of all the fields of the resource.
- openmode¶
Opening mode (see the documentation above for more details).
- readfield(*args, **kwargs)¶
Reads one field, given its identifier, and returns a Field instance. Interface to Fortran routines from ‘ifsaux’.
Args:
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.Args:
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.
- sortfields()[source]¶
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.
Args:
out: the output open file-like object (duck-typing: out.write() only is needed).
sortfields: True if the fields have to be sorted.
- writefield(field)[source]¶
Write a field in the resource.
Args:
field: a
epygram.base.Field
instance orepygram.H2DField
.
- writefields(fieldset)[source]¶
Write the fields of the fieldset in the resource.
Args:
fieldset: must be a
epygram.base.FieldSet
instance.