epygram.resources — Real and virtual resources handling

Module contains:

  • resource for data contained in file (FileResource).
  • other resources built on top of FileResource:
    • MultiValiditiesResource: join several resources to furnish fields with temporal evolution;
class epygram.resources.FileResource(*args, **kwargs)

Bases: epygram.base.Resource

Generic abstract class implementing a Resource.

Footprint:

dict(
    attr = dict(
        filename = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'File name (absolute or relative) of the resource.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set([]),
        ), 
        fmtdelayedopen = dict(
            access = 'rxx', 
            alias = set([]), 
            default = False, 
            info = 'Opening of the resource delayed (not at time of construction).', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = bool, 
            values = set([]),
        ), 
        format = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Format of the resource.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            values = set([]),
        ), 
        openmode = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Opening mode.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(
                append = 'a', 
                read = 'r', 
                write = 'w',
            ), 
            values = set(['a', 'write', 'r', 'w', 'read', 'append']),
        ),
    ), 
    bind = [], 
    info = 'Not documented', 
    only = dict(), 
    priority = dict(
        level = footprints.priorities.PriorityLevel::DEFAULT,
    ),
)
open(openmode=None)

Opens the resource properly. openmode: to open with a specific openmode, eventually different from the one specified at initialization.

class epygram.resources.MultiValiditiesResource(*args, **kwargs)

Bases: epygram.base.Resource

Class implementing a MultiValiditiesResource.

Footprint:

dict(
    attr = dict(
        name = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['MultiValidities']),
        ), 
        openmode = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Opening mode.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(
                append = 'a', 
                read = 'r', 
                write = 'w',
            ), 
            values = set(['a', 'write', 'r', 'w', 'read', 'append']),
        ), 
        resources = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'List of resources to join.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPList, 
            values = set([]),
        ),
    ), 
    bind = [], 
    info = 'Not documented', 
    only = dict(), 
    priority = dict(
        level = footprints.priorities.PriorityLevel::DEFAULT,
    ),
)
close()

Closes all resources.

extractprofile(*args, **kwargs)

Extracts the profiles in the different resources and join the validities.

extractsection(*args, **kwargs)

Extracts the sections in the different resources and join the validities.

find_fields_in_resource(*args, **kwargs)

Call to find_fields_in_resource

listfields(*args, **kwargs)

Call to listfields.

open()

Opens all resources

readfield(*args, **kwargs)

Reads the field in the different resources and join the validities.

sortfields(*args, **kwargs)

Call to sortfields

spectral_geometry

Returns the spectral_geometry

writefield(*args, **kwargs)

Write fields.

Previous topic

epygram.formats.grib_utilities — GRIB tables and co.

Next topic

epygram.myproj — Projection tools

This Page