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

Contains the class for GeoPoints format.

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

Bases: epygram.resources.FileResource.FileResource

Class implementing all specificities for GeoPoints resource format.

Format:

<beginning of file> #GEO #PARAMETER = any name or character string #LAT LON DATE TIME VALUE #DATA 32.2671 -12.5501 20140417 21 2.269112E+02 ... <till end of file> The set of keys describing each point is defined in its ‘columns’ attribute.

Note

This class is managed by footprint.

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

Automatic parameters from the footprint:

  • columns (footprints.stdtypes.FPList) - rxx - The columns of the geopoints, i.e. the set of keys describing each point.
    • Optional. Default is None.
  • 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 ‘GeoPoints’.
    • Values: set([‘GeoPoints’])
  • openmode (str) - rxx - Opening mode.
    • Values: set([‘a’, ‘write’, ‘r’, ‘w’, ‘read’, ‘append’])
    • Remap: dict(append = ‘a’, read = ‘r’, write = ‘w’,)
  • other_attributes (footprints.stdtypes.FPDict) - rxx - other key:value pairs in header.
    • Optional. Default is FPDict::<<as_dict:: dict()>>.
  • parameter (str) - rxx - The name of the parameter whose data is in the value field.
    • Optional. Default is None.
close()[source]

Closes a GeoPoints.

countpoints()[source]

Counts and returns the number of points in the resource.

listfields(**kwargs)[source]

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

open(parameter=None, columns=None, openmode=None, other_attributes=None)[source]

Opens a GeoPoint.

Parameters:
  • parameter – name of the parameter in header (openmode=’w’).
  • columns – list of all the items to be written for each point (openmode=’w’).
  • openmode – optional, to open with a specific openmode, eventually different from the one specified at initialization.
  • other_attributes – other key:value pairs to be written in header (openmode=’w’).
readfield(*args, **kwargs)

Reads the GeoPoints.

Parameters:
  • parameter – is the name of the parameter to read (it exists only for compatibility with other formats)
  • footprints_builder – if True, uses footprints.proxy to build fields. Defaults to False for performance reasons.
  • as_points – if True, returns a collection of points instead of a single field.
what(*args, **kwargs)

Writes in file-like a summary of the contents of the GeoPoints.

Parameters:out – the output open file-like object.
writefield(field, parameter=u'UNKNOWN', fidkey_for_parameter=None, order=u'C', llprecision=4, precision=6, col_width=12, subzone=None)[source]

Write a field in the resource.

Parameters:
  • field – a epygram.fields.D3Field or a epygram.base.FieldSet of epygram.fields.PointField, or a dict {‘lon’:[...], ‘lat’:[...], ‘value’:[...], ...}. The keys of field that are not in the columns are ignored. The keys of the columns that are not in the field are filled by zeros. At least ‘lon’ and ‘lat’ are necessary.
  • parameter – the name of the parameter, to be given if field is a dict and if it has not been given at opening.
  • order – optional, for a rectangular D3Field, whether to flatten 2D arrays in ‘C’ (row-major) or ‘F’ (Fortran, column-major) order.
  • llprecision – precision (number of digits) in write for lon/lat.
  • precision – precision (number of digits) in write for other floats.
  • subzone – optional, among (‘C’, ‘CI’). Only if field is a LAM epygram.fields.H2DField, extracts the points of the resp. C or C+I zone. Default is no subzone, i.e. the whole field.