epygram.geometries.D3Geometry — 3-D Geometry class

Contains the classes for 3D geometries of fields.

class epygram.geometries.D3Geometry.D3Geometry(*args, **kwargs)[source]

Bases: epygram.util.RecursiveObject, footprints.FootprintBase

Handles the geometry for a 3-Dimensions Field. Abstract mother class.

Footprint:

dict(
    attr = dict(
        dimensions = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles grid dimensions.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        geoid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = footprints.stdtypes.FPDict::<<
                    as_dict:: dict()
                >>, 
            info = 'To specify geoid shape; actually used in projected geometries only.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        grid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles description of the horizontal grid.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        name = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Name of geometrical type of representation of points on                       the Globe.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['unstructured', 'reduced_gauss', 'regular_lonlat', 'mercator', 'lambert', 'rotated_reduced_gauss', 'polar_stereographic']),
        ), 
        position_on_horizontal_grid = dict(
            access = 'rwx', 
            alias = set([]), 
            default = '__unknown__', 
            info = 'Position of points w/r to the horizontal.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = str, 
            values = set(['center-left', 'lower-right', 'upper-right', 'lower-center', 'lower-left', 'center-right', 'upper-left', '__unknown__', 'upper-center', 'center']),
        ), 
        structure = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Type of geometry.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['3D']),
        ), 
        vcoordinate = dict(
            access = 'rwx', 
            alias = set([]), 
            default = None, 
            info = 'Handles vertical geometry parameters.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = epygram.geometries.VGeometry.VGeometry, 
            values = set([]),
        ),
    ), 
    bind = [], 
    info = 'Not documented', 
    only = dict(), 
    priority = dict(
        level = footprints.priorities.PriorityLevel::DEFAULT,
    ),
)
azimuth(end1, end2)[source]

Initial bearing from end1 to end2 points following a Great Circle. end1 must be a tuple (lon, lat). end2 must be a tuple (lon, lat).

Warning: requires the pyproj module.

datashape[source]

Returns the data shape requested by this geometry.

distance(end1, end2)[source]

Computes the distance between two points along a Great Circle. end1 must be a tuple (lon, lat). end2 must be a tuple (lon, lat).

Warning: requires the pyproj module.

get_levels(d4=False, nb_validities=0, subzone=None)

Returns an array containing the level for each data point. - d4: if True, returned values are shaped in a 4 dimensions array

if False, shape of returned values is determined with respect to geometry d4=True requires nb_validities > 0
  • nb_validities is the number of validities represented in data values
  • subzone: optional, among (‘C’, ‘CI’), for LAM grids only, extracts the levels resp. from the C or C+I zone off the C+I(+E) zone.
linspace(end1, end2, num)[source]

Returns evenly spaced points over the specified interval. Points are lined up along a Great Circle. end1 must be a tuple (lon, lat). end2 must be a tuple (lon, lat). num is the number of points, including point1 and point2.

Warning: requires the pyproj module.

make_point_geometry(lon, lat)[source]

Returns a V1DGeometry.

make_section_geometry(end1, end2, points_number=None, resolution=None, position=None)[source]

Returns a V2DGeometry.

Args:

  • end1 must be a tuple (lon, lat).
  • end2 must be a tuple (lon, lat).
  • points_number defines the total number of horizontal points of the section (including ends). If None, defaults to a number computed from the ends and the resolution.
  • resolution defines the horizontal resolution to be given to the field. If None, defaults to the horizontal resolution of the field.
  • position defines the position of data in the grid (for projected grids only)
plotgeometry(subzone=None, title=None, color='blue', gisquality='i', specificproj=None, zoom=None, existingbasemap=None, drawrivers=False, llgridstep=None, colorbar='right', departments=False, existingfigure=None, pointsize=20)[source]

Makes a simple plot of the geometry, with a number of options.

Requires matplotlib

Options:

  • subzone: among (‘C’, ‘CI’), for LAM fields only, plots the data resp. on the C or C+I zone.

    Default is no subzone, i.e. the whole field.

  • gisquality: among (‘c’, ‘l’, ‘i’, ‘h’, ‘f’) – by increasing quality. Defines the quality for GIS elements (coastlines, countries boundaries...). Cf. ‘basemap’ doc for more details.

  • specificproj: enables to make basemap on the specified projection, among: ‘kav7’, ‘cyl’, ‘ortho’, (‘nsper’, {...}) (cf. Basemap doc).

    In ‘nsper’ case, the {} may contain:

    • ‘sat_height’ = satellite height in km;
    • ‘lon’ = longitude of nadir in degrees;
    • ‘lat’ = latitude of nadir in degrees.
  • zoom: specifies the lon/lat borders of the map, implying hereby a ‘cyl’ projection. Must be a dict(lonmin=, lonmax=, latmin=, latmax=).

    Overwrites specificproj.

  • existingbasemap: as making Basemap is the most time-consuming step, it is possible to bring an already existing basemap object. In that case, all the above options are ignored, overwritten by those of the existingbasemap.

  • title: title for the plot. Default is geometry name.

  • color: name of the matplotlib color to use.

  • drawrivers: to add rivers on map.

  • llgridstep: specific step between two lon/lat gridlines, in degrees.

    Default depends on domain size.

  • departments: if True, adds the french departments on map (instead of countries).

  • existingfigure: to plot the field over an existing figure (e.g. contourlines over colorshades). Be aware that no check is done between the existingfigure basemap and either the existingbasemap or the one that is created from the field geometry: there might be inconsistency.

  • pointsize: size of points.

This method uses (hence requires) ‘matplotlib’ and ‘basemap’ libraries.

projected_geometry[source]

Is the geometry a projection ?

rectangular_grid[source]

Is the grid rectangular ?

what(out=<open file '<stdout>', mode 'w' at 0x7f7b0e24c150>, vertical_geometry=True, arpifs_var_names=False, spectral_geometry=None)[source]

Writes in file a summary of the geometry.

Args:

  • out: the output open file-like object (duck-typing: out.write() only is needed).
  • vertical_geometry: if True, writes the vertical geometry of the field.
  • arpifs_var_names: if True, prints the equivalent ‘arpifs’ variable names.
  • spectral_geometry: an optional dict containing the spectral truncatures {‘in_X’:, ‘in_Y’:} (LAM) or {‘max’:} (global).
class epygram.geometries.D3Geometry.D3RectangularGridGeometry(*args, **kwargs)[source]

Bases: epygram.geometries.D3Geometry.D3Geometry

Handles the geometry for a rectangular 3-Dimensions Field. Abstract.

Footprint:

dict(
    attr = dict(
        dimensions = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles grid dimensions.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        geoid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = footprints.stdtypes.FPDict::<<
                    as_dict:: dict()
                >>, 
            info = 'To specify geoid shape; actually used in projected geometries only.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        grid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles description of the horizontal grid.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        name = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Name of geometrical type of representation of points on                       the Globe.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['unstructured', 'academic', 'regular_lonlat', 'mercator', 'lambert', 'polar_stereographic']),
        ), 
        position_on_horizontal_grid = dict(
            access = 'rwx', 
            alias = set([]), 
            default = '__unknown__', 
            info = 'Position of points w/r to the horizontal.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = str, 
            values = set(['center-left', 'lower-right', 'upper-right', 'lower-center', 'lower-left', 'center-right', 'upper-left', '__unknown__', 'upper-center', 'center']),
        ), 
        structure = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Type of geometry.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['3D']),
        ), 
        vcoordinate = dict(
            access = 'rwx', 
            alias = set([]), 
            default = None, 
            info = 'Handles vertical geometry parameters.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = epygram.geometries.VGeometry.VGeometry, 
            values = set([]),
        ),
    ), 
    bind = [], 
    info = 'Not documented', 
    only = dict(), 
    priority = dict(
        level = footprints.priorities.PriorityLevel::DEFAULT,
    ),
)
extract_subzone(data, nb_validities, subzone, horizontal_only=False)[source]

Extracts the subzone C or CI from a LAM field.

Args:

  • data: the data values with shape concording with geometry.
  • nb_validities is the number of validities represented in data values
  • subzone: optional, among (‘C’, ‘CI’), for LAM grids only, extracts the data resp. from the C or C+I zone off the C+I(+E) zone.
  • horizontal_only: the input data doesn’t have vertical coordinate
get_datashape(nb_validities, horizontal_only=False, d4=False, subzone=None)

Returns the data shape according to the geometry. - horizontal_only: the data doesn’t have vertical coordinate - nb_validities is the number of validities represented in data values - d4: if True, returned values are shaped in a 4 dimensions array

if False, shape of returned values is determined with respect to geometry
  • subzone: optional, among (‘C’, ‘CI’), for LAM grids only, informes that data is resp. on the C or C+I zone off the C+I(+E) zone.
get_lonlat_grid(subzone=None, position=None, d4=False, nb_validities=0)[source]

Returns a tuple of two tables containing one the longitude of each point, the other the latitude, with 2D shape.

  • subzone: optional, among (‘C’, ‘CI’), for LAM grids only, returns the grid resp. for the C or C+I zone off the C+I+E zone.

    Default is no subzone, i.e. the whole field.

  • position: position of lonlat grid with respect to the model cell. Defaults to position_on_grid[‘horizontal’].

  • d4: if True, returned values are shaped in a 4 dimensions array

    if False, shape of returned values is determined with respect to geometry d4=True requires nb_validities > 0

  • nb_validities is the number of validities represented in data values

Shape of 2D data on Rectangular grids:

  • grid[0,0] is SW, grid[-1,-1] is NE
  • grid[0,-1] is SE, grid[-1,0] is NW
gimme_corners_ij(subzone=None)[source]

Returns the indices (i, j) of the four corners of a rectangular grid, as a dict(corner=(i, j)) with corner in:

ll = lower-left / lr = lower-right / ur = upper-right / ul = upper-left.

(0, 0) is the lower-left corner of the grid.

  • subzone: for LAM fields, returns the corners of the subzone.
gimme_corners_ll(subzone=None, position=None)[source]

Returns the lon/lat of the four corners of a rectangular grid, as a dict(corner=(lon, lat)) with corner in:

ll = lower-left / lr = lower-right / ur = upper-right / ul = upper-left.

  • subzone: for LAM grids, returns the corners of the subzone.
  • position: position of corners with respect to the model cell. Defaults to position_on_grid[‘horizontal’].
nearest_points(lon, lat, interpolation, position=None, external_distance=None)[source]

Returns the (i, j) position of the points needed to perform an interpolation. This is a list of (lon, lat) tuples.

Args:

  • lon: longitude of point in degrees.
  • lat: latitude of point in degrees.
  • interpolation can be: - ‘nearest’ to get the nearest point only - ‘linear’ to get the 2*2 points bordering the (lon, lat) position - ‘cubic’ to get the 4*4 points bordering the (lon, lat) position
  • position: position in the model cell of the lat lon position. Defaults to position_on_grid[‘horizontal’].
  • external_distance can be a dict containing the target point value and an external field on the same grid as self, to which the distance is computed within the 4 horizontally nearest points; e.g. {‘target_value’:4810, ‘external_field’:a_3DField_with_same_geometry}. If so, the nearest point is selected with distance = |target_value - external_field.data|
point_is_inside_domain_ij(i=None, j=None, margin=-0.1, subzone=None)[source]

Returns True if the point(s) of i/j coordinates is(are) inside the field.

Args:

  • i and j: indexes of point.
  • margin: considers the point inside if at least ‘margin’ points far from the border. The -0.1 default is a safety for precision errors.
  • subzone: considers only a subzone among (‘C’, ‘CI’) of the domain.
point_is_inside_domain_ll(lon, lat, margin=-0.1, subzone=None, position=None)[source]

Returns True if the point(s) of lon/lat coordinates is(are) inside the field.

Args:

  • lon: longitude of point(s) in degrees.
  • lat: latitude of point(s) in degrees.
  • margin: considers the point inside if at least ‘margin’ points far from the border. The -0.1 default is a safety for precision errors.
  • subzone: considers only a subzone among (‘C’, ‘CI’) of the domain.
  • position: position of the grid with respect to the model cell. Defaults to position_on_grid[‘horizontal’].
reshape_data(data, nb_validities, horizontal_only=False, d4=False, subzone=None)[source]

Returns a 3D data reshaped from 1D, according to geometry.

  • data: the 1D data, of dimension concording with geometry.

  • horizontal_only: the input data doesn’t have vertical coordinate

  • nb_validities is the number of validities represented in data values

  • d4: if True, returned values are shaped in a 4 dimensions array

    if False, shape of returned values is determined with respect to geometry

  • subzone: optional, among (‘C’, ‘CI’), for LAM grids only, informes that data is resp. on the C or C+I zone off the C+I(+E) zone.

class epygram.geometries.D3Geometry.D3UnstructuredGeometry(*args, **kwargs)[source]

Bases: epygram.geometries.D3Geometry.D3RectangularGridGeometry

Handles the geometry for an unstructured 3-Dimensions Field.

Footprint:

dict(
    attr = dict(
        dimensions = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles grid dimensions.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        geoid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = footprints.stdtypes.FPDict::<<
                    as_dict:: dict()
                >>, 
            info = 'To specify geoid shape; actually used in projected geometries only.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        grid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles description of the horizontal grid.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        name = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Name of geometrical type of representation of points on                       the Globe.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['unstructured']),
        ), 
        position_on_horizontal_grid = dict(
            access = 'rwx', 
            alias = set([]), 
            default = '__unknown__', 
            info = 'Position of points w/r to the horizontal.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = str, 
            values = set(['center-left', 'lower-right', 'upper-right', 'lower-center', 'lower-left', 'center-right', 'upper-left', '__unknown__', 'upper-center', 'center']),
        ), 
        structure = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Type of geometry.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['3D']),
        ), 
        vcoordinate = dict(
            access = 'rwx', 
            alias = set([]), 
            default = None, 
            info = 'Handles vertical geometry parameters.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = epygram.geometries.VGeometry.VGeometry, 
            values = set([]),
        ),
    ), 
    bind = [], 
    info = 'Not documented', 
    only = dict(), 
    priority = dict(
        level = footprints.priorities.PriorityLevel::DEFAULT,
    ),
)
get_lonlat_grid(subzone=None, position=None, d4=False, nb_validities=0)[source]

Returns a tuple of two tables containing one the longitude of each point, the other the latitude, with 2D shape.

  • subzone: optional, among (‘C’, ‘CI’), for LAM grids only, returns the grid resp. for the C or C+I zone off the C+I+E zone.

    Default is no subzone, i.e. the whole field.

  • position: position of lonlat grid with respect to the model cell. Defaults to position_on_grid[‘horizontal’].

  • d4: if True, returned values are shaped in a 4 dimensions array

    if False, shape of returned values is determined with respect to geometry d4=True requires nb_validities > 0

  • nb_validities is the number of validities represented in data values

Shape of 2D data on Rectangular grids:

  • grid[0,0] is SW, grid[-1,-1] is NE
  • grid[0,-1] is SE, grid[-1,0] is NW
ij2ll(i, j, position=None)[source]

(i, j) being the coordinates in the 2D matrix of CIE gridpoints,

(lon, lat) being the lon/lat coordinates in degrees. - position: lat lon position to return with respect to the model cell.

Defaults to position_on_grid[‘horizontal’].
ll2ij(lon, lat, position=None)[source]

(lon, lat) being the lon/lat coordinates in degrees,

(i, j) being the coordinates in the 2D matrix of CIE gridpoints. - position: lat lon position with respect to the model cell.

Defaults to position_on_grid[‘horizontal’].

Caution: (i,j) are float.

make_basemap(gisquality='i', specificproj=None, zoom=None, **kwargs)[source]

Returns a matplotlib.basemap.Basemap object of the ‘ad hoc’ projection (if available). This is designed to avoid explicit handling of deep horizontal geometry attributes.

Args:

  • gisquality: defines the quality of GIS contours, cf. Basemap doc.

    Possible values (by increasing quality): ‘c’, ‘l’, ‘i’, ‘h’, ‘f’.

  • specificproj: enables to make basemap on the specified projection, among: ‘kav7’, ‘cyl’, ‘ortho’, (‘nsper’, {...}) (cf. Basemap doc).

    In ‘nsper’ case, the {} may contain:

    • ‘sat_height’ = satellite height in km;
    • ‘lon’ = longitude of nadir in degrees;
    • ‘lat’ = latitude of nadir in degrees.

    Overwritten by zoom.

  • zoom: specifies the lon/lat borders of the map, implying hereby a ‘cyl’ projection. Must be a dict(lonmin=, lonmax=, latmin=, latmax=).

    Overwrites specificproj.

nearest_points(lon, lat, interpolation, position=None, external_distance=None)[source]

Returns the (i, j) position of the points needed to perform an interpolation. This is a list of (lon, lat) tuples.

Args:

  • lon: longitude of point in degrees.
  • lat: latitude of point in degrees.
  • interpolation can be: - ‘nearest’ to get the nearest point only - ‘linear’ to get the 2*2 points bordering the (lon, lat) position - ‘cubic’ to get the 4*4 points bordering the (lon, lat) position
  • position: position in the model cell of the lat lon position. Defaults to position_on_grid[‘horizontal’].
  • external_distance can be a dict containing the target point value and an external field on the same grid as self, to which the distance is computed within the 4 horizontally nearest points; e.g. {‘target_value’:4810, ‘external_field’:a_3DField_with_same_geometry}. If so, the nearest point is selected with distance = |target_value - external_field.data|
resolution_ij(i, j)[source]

Returns the distance to the nearest point of (i,j) point. (i, j) being the coordinates in the 2D matrix of gridpoints.

resolution_ll(lon, lat)[source]

Returns the local resolution at the nearest point of lon/lat. It’s the distance between this point and its closest neighbour. point must be a tuple (lon, lat).

class epygram.geometries.D3Geometry.D3AcademicGeometry(*args, **kwargs)[source]

Bases: epygram.geometries.D3Geometry.D3RectangularGridGeometry

Handles the geometry for an academic 3-Dimensions Field.

Footprint:

dict(
    attr = dict(
        dimensions = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles grid dimensions.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        geoid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = footprints.stdtypes.FPDict::<<
                    as_dict:: dict()
                >>, 
            info = 'To specify geoid shape; actually used in projected geometries only.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        grid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles description of the horizontal grid.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        name = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Name of geometrical type of representation of points on                       the Globe.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['academic']),
        ), 
        position_on_horizontal_grid = dict(
            access = 'rwx', 
            alias = set([]), 
            default = '__unknown__', 
            info = 'Position of points w/r to the horizontal.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = str, 
            values = set(['center-left', 'lower-right', 'upper-right', 'lower-center', 'lower-left', 'center-right', 'upper-left', '__unknown__', 'upper-center', 'center']),
        ), 
        structure = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Type of geometry.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['3D']),
        ), 
        vcoordinate = dict(
            access = 'rwx', 
            alias = set([]), 
            default = None, 
            info = 'Handles vertical geometry parameters.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = epygram.geometries.VGeometry.VGeometry, 
            values = set([]),
        ),
    ), 
    bind = [], 
    info = 'Not documented', 
    only = dict(), 
    priority = dict(
        level = footprints.priorities.PriorityLevel::DEFAULT,
    ),
)
azimuth(end1, end2)[source]

Initial bearing from end1 to end2 points in geometry. end1 must be a tuple (lon, lat). end2 must be a tuple (lon, lat).

distance(end1, end2)[source]

Computes the distance between two points along a straight line in the geometry. end1 must be a tuple (lon, lat). end2 must be a tuple (lon, lat).

ij2ll(i, j, position=None)[source]

(i, j) being the coordinates in the 2D matrix of gridpoints,

(lon, lat) being the lon/lat coordinates in degrees. - position: lat lon position to return with respect to the model cell.

Defaults to position_on_grid[‘horizontal’].

!!! This routine has no sense for this geometry, it is identity.

ij2xy(i, j, position=None)[source]

(i, j) being the coordinates in the 2D matrix of gridpoints,

(x, y) being the coordinates in the projection. - position: position to return with respect to model cell. Defaults

to position_on_grid[‘horizontal’].

Note that origin of coordinates in projection is the center of the C+I domain.

linspace(end1, end2, num)[source]

Returns evenly spaced points over the specified interval. Points are lined up in the geometry. end1 must be a tuple (lon, lat). end2 must be a tuple (lon, lat). num is the number of points, including point1 and point2.

ll2ij(lon, lat, position=None)[source]

(lon, lat) being the lon/lat coordinates in degrees,

(i, j) being the coordinates in the 2D matrix of gridpoints. - position: lat lon position with respect to the model cell.

Defaults to position_on_grid[‘horizontal’].

!!! This routine has no sense for this geometry, it is identity.

ll2xy(lon, lat)[source]

(lon, lat) being the lon/lat coordinates in degrees,

(x, y) being the coordinates in the projection.

Note that origin of coordinates in projection is the center of the C+I domain.

resolution_ij(i, j)[source]

Returns the distance to the nearest point of (i,j) point. (i, j) being the coordinates in the 2D matrix of gridpoints.

resolution_ll(lon, lat)[source]

Returns the local resolution at the nearest point of lon/lat. It’s the distance between this point and its closest neighbour. point must be a tuple (lon, lat).

xy2ij(x, y, position=None)[source]

(x, y) being the coordinates in the projection,

(i, j) being the coordinates in the 2D matrix of gridpoints. - position: position represented by (x,y) with respect to model cell.

Defaults to position_on_grid[‘horizontal’].

Caution: (i,j) are float (the nearest grid point is the nearest integer).

Note that origin of coordinates in projection is the center of the C+I domain.

xy2ll(x, y)[source]

(x, y) being the coordinates in the projection,

(lon, lat) being the lon/lat coordinates in degrees.

Note that origin of coordinates in projection is the center of the C+I domain.

class epygram.geometries.D3Geometry.D3RegLLGeometry(*args, **kwargs)[source]

Bases: epygram.geometries.D3Geometry.D3RectangularGridGeometry

Handles the geometry for a Regular Lon/Lat 3-Dimensions Field.

Footprint:

dict(
    attr = dict(
        dimensions = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles grid dimensions.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        geoid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = footprints.stdtypes.FPDict::<<
                    as_dict:: dict()
                >>, 
            info = 'To specify geoid shape; actually used in projected geometries only.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        grid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles description of the horizontal grid.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        name = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Name of geometrical type of representation of points on                       the Globe.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['regular_lonlat']),
        ), 
        position_on_horizontal_grid = dict(
            access = 'rwx', 
            alias = set([]), 
            default = '__unknown__', 
            info = 'Position of points w/r to the horizontal.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = str, 
            values = set(['center-left', 'lower-right', 'upper-right', 'lower-center', 'lower-left', 'center-right', 'upper-left', '__unknown__', 'upper-center', 'center']),
        ), 
        structure = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Type of geometry.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['3D']),
        ), 
        vcoordinate = dict(
            access = 'rwx', 
            alias = set([]), 
            default = None, 
            info = 'Handles vertical geometry parameters.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = epygram.geometries.VGeometry.VGeometry, 
            values = set([]),
        ),
    ), 
    bind = [], 
    info = 'Not documented', 
    only = dict(), 
    priority = dict(
        level = footprints.priorities.PriorityLevel::DEFAULT,
    ),
)
azimuth(end1, end2)[source]

Initial bearing from end1 to end2 points in geometry. end1 must be a tuple (lon, lat). end2 must be a tuple (lon, lat).

distance(end1, end2)[source]

Computes the distance between two points along a straight line in the geometry. end1 must be a tuple (lon, lat). end2 must be a tuple (lon, lat).

Warning: requires the pyproj module.

getcenter()[source]

Returns the coordinate of the grid center as a tuple (center_lon, center_lat).

global_shift_center(longitude_shift)[source]

Shifts the center of the geometry by longitude_shift (in degrees). longitude_shift has to be a multiple of the grid’s resolution in longitude.

ij2ll(i, j, position=None)[source]

(i, j) being the coordinates in the 2D matrix of gridpoints,

(lon, lat) being the lon/lat coordinates in degrees. - position: lat lon position to return with respect to the model cell.

Defaults to position_on_grid[‘horizontal’].
ij2xy(i, j, position=None)[source]

(i, j) being the coordinates in the 2D matrix of gridpoints,

(x, y) being the coordinates in the projection. - position: position to return with respect to model cell.

Defaults to position_on_grid[‘horizontal’].

Note that origin of coordinates in projection is the center of the C+I domain.

linspace(end1, end2, num)[source]

Returns evenly spaced points over the specified interval. Points are lined up in the geometry. end1 must be a tuple (lon, lat). end2 must be a tuple (lon, lat). num is the number of points, including point1 and point2.

ll2ij(lon, lat, position=None)[source]

(lon, lat) being the lon/lat coordinates in degrees,

(i, j) being the coordinates in the 2D matrix of gridpoints. - position: lat lon position with respect to the model cell.

Defaults to position_on_grid[‘horizontal’].

Caution: (i,j) are float.

ll2xy(lon, lat)[source]

(lon, lat) being the lon/lat coordinates in degrees,

(x, y) being the coordinates in the projection.

Note that origin of coordinates in projection is the center of the C+I domain.

make_basemap(gisquality='i', subzone=None, specificproj=None, zoom=None)[source]

Returns a matplotlib.basemap.Basemap object of the ‘ad hoc’ projection (if available). This is designed to avoid explicit handling of deep horizontal geometry attributes.

Args:

  • gisquality: defines the quality of GIS contours, cf. Basemap doc.

    Possible values (by increasing quality): ‘c’, ‘l’, ‘i’, ‘h’, ‘f’.

  • subzone: defines the LAM subzone to be included, in LAM case, among: ‘C’, ‘CI’.

  • specificproj: enables to make basemap on the specified projection, among: ‘kav7’, ‘cyl’, ‘ortho’, (‘nsper’, {...}) (cf. Basemap doc).

    In ‘nsper’ case, the {} may contain:

    • ‘sat_height’ = satellite height in km;
    • ‘lon’ = longitude of nadir in degrees;
    • ‘lat’ = latitude of nadir in degrees.

    Overwritten by zoom.

  • zoom: specifies the lon/lat borders of the map, implying hereby a ‘cyl’ projection. Must be a dict(lonmin=, lonmax=, latmin=, latmax=).

    Overwrites specificproj.

resolution_ij(i, j)[source]

Returns the distance to the nearest point of (i,j) point. (i, j) being the coordinates in the 2D matrix of gridpoints.

resolution_ll(lon, lat)[source]

Returns the local resolution at the nearest point of lon/lat. It’s the distance between this point and its closest neighbour. point must be a tuple (lon, lat).

xy2ij(x, y, position=None)[source]

(x, y) being the coordinates in the projection,

(i, j) being the coordinates in the 2D matrix of gridpoints. - position: position represented by (x,y) with respect to model cell.

Defaults to position_on_grid[‘horizontal’].

Caution: (i,j) are float (the nearest grid point is the nearest integer).

Note that origin of coordinates in projection is the center of the C+I domain.

xy2ll(x, y)[source]

(x, y) being the coordinates in the projection,

(lon, lat) being the lon/lat coordinates in degrees.

Note that origin of coordinates in projection is the center of the C+I domain.

class epygram.geometries.D3Geometry.D3ProjectedGeometry(*args, **kwargs)[source]

Bases: epygram.geometries.D3Geometry.D3RectangularGridGeometry

Handles the geometry for a Projected 3-Dimensions Field.

Footprint:

dict(
    attr = dict(
        dimensions = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles grid dimensions.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        geoid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = footprints.stdtypes.FPDict::<<
                    as_dict:: dict(
                            ellps = 'WGS84',
                        )
                >>, 
            info = 'Geoid definition in projections.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        grid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles description of the horizontal grid.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        name = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Name of geometrical type of representation of points on                       the Globe.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['lambert', 'space_view', 'polar_stereographic', 'mercator']),
        ), 
        position_on_horizontal_grid = dict(
            access = 'rwx', 
            alias = set([]), 
            default = '__unknown__', 
            info = 'Position of points w/r to the horizontal.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = str, 
            values = set(['center-left', 'lower-right', 'upper-right', 'lower-center', 'lower-left', 'center-right', 'upper-left', '__unknown__', 'upper-center', 'center']),
        ), 
        projection = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles projection information.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        projtool = dict(
            access = 'rxx', 
            alias = set([]), 
            default = 'pyproj', 
            info = 'To use pyproj or epygram.myproj.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            values = set([]),
        ), 
        structure = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Type of geometry.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['3D']),
        ), 
        vcoordinate = dict(
            access = 'rwx', 
            alias = set([]), 
            default = None, 
            info = 'Handles vertical geometry parameters.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = epygram.geometries.VGeometry.VGeometry, 
            values = set([]),
        ),
    ), 
    bind = [], 
    info = 'Not documented', 
    only = dict(), 
    priority = dict(
        level = footprints.priorities.PriorityLevel::DEFAULT,
    ),
)
azimuth(end1, end2)[source]

Initial bearing from end1 to end2 points in geometry. end1 must be a tuple (lon, lat). end2 must be a tuple (lon, lat).

compass_grid(subzone=None, position=None)

Get the compass grid, i.e. the angle between Y-axis and North for each gridpoint.

  • subzone: optional, among (‘C’, ‘CI’), for LAM grids only, returns the grid resp. for the C or C+I zone off the C+I+E zone.

    Default is no subzone, i.e. the whole field.

  • position: position of lonlat grid with respect to the model cell. Defaults to position_on_grid[‘horizontal’].

distance(end1, end2)[source]

Computes the distance between two points along a straight line in the geometry. end1 must be a tuple (lon, lat). end2 must be a tuple (lon, lat).

getcenter()[source]

Returns the coordinate of the grid center as a tuple (center_lon, center_lat).

ij2ll(i, j, position=None)[source]

(i, j) being the coordinates in the 2D matrix of CIE gridpoints,

(lon, lat) being the lon/lat coordinates in degrees. - position: lat lon position to return with respect to the model cell.

Defaults to position_on_grid[‘horizontal’].
ij2xy(i, j, position=None)[source]

(i, j) being the coordinates in the 2D matrix of CIE gridpoints,

(x, y) being the coordinates in the projection. - position: position to return with respect to model cell.

Defaults to position_on_grid[‘horizontal’].

Note that origin of coordinates in projection is the center of the C+I domain.

linspace(end1, end2, num)[source]

Returns evenly spaced points over the specified interval. Points are lined up in the geometry. end1 must be a tuple (lon, lat). end2 must be a tuple (lon, lat). num is the number of points, including point1 and point2.

ll2ij(lon, lat, position=None)[source]

(lon, lat) being the lon/lat coordinates in degrees,

(i, j) being the coordinates in the 2D matrix of CIE gridpoints. - position: lat lon position with respect to the model cell.

Defaults to position_on_grid[‘horizontal’].

Caution: (i,j) are float.

ll2xy(lon, lat)[source]

(lon, lat) being the lon/lat coordinates in degrees,

(x, y) being the coordinates in the projection.

Note that origin of coordinates in projection is the center of the C+I domain.

make_basemap(gisquality='i', subzone=None, specificproj=None, zoom=None)[source]

Returns a matplotlib.basemap.Basemap object of the ‘ad hoc’ projection (if available). This is designed to avoid explicit handling of deep horizontal geometry attributes.

Args:

  • gisquality: defines the quality of GIS contours, cf. Basemap doc.

    Possible values (by increasing quality): ‘c’, ‘l’, ‘i’, ‘h’, ‘f’.

  • subzone: defines the LAM subzone to be included, in LAM case, among: ‘C’, ‘CI’.

  • specificproj: enables to make basemap on the specified projection, among: ‘kav7’, ‘cyl’, ‘ortho’, (‘nsper’, {...}) (cf. Basemap doc).

    In ‘nsper’ case, the {} may contain:

    • ‘sat_height’ = satellite height in km;
    • ‘lon’ = longitude of nadir in degrees;
    • ‘lat’ = latitude of nadir in degrees.

    Overwritten by zoom.

  • zoom: specifies the lon/lat borders of the map, implying hereby a ‘cyl’ projection. Must be a dict(lonmin=, lonmax=, latmin=, latmax=).

    Overwrites specificproj.

make_section_geometry(end1, end2, points_number=None, resolution=None, position=None)[source]

Returns a projected V2DGeometry.

Args:

  • end1 must be a tuple (lon, lat).
  • end2 must be a tuple (lon, lat).
  • points_number defines the total number of horizontal points of the section (including ends). If None, defaults to a number computed from the ends and the resolution.
  • resolution defines the horizontal resolution to be given to the field. If None, defaults to the horizontal resolution of the field.
  • position defines the position of data in the grid (defaults to ‘center’)
map_factor(lat)

Returns the map factor at the given latitude(s) lat in degrees.

map_factor_field(position=None)[source]

Returns a new field whose data is the map factor over the field. - position: grid position with respect to the model cell.

Defaults to position_on_grid[‘horizontal’].
reproject_wind_on_lonlat(u, v, lon, lat, map_factor_correction=True, reverse=False)

Reprojects a wind vector (u, v) on the grid onto real axes, i.e. with components on true zonal/meridian axes. lon/lat are the point(s) coordinates.

If map_factor_correction, applies a correction of magnitude due to map factor.

If reverse, apply the reverse reprojection.

resolution_ij(i, j)[source]

Returns the distance to the nearest point of (i,j) point. (i, j) being the coordinates in the 2D matrix of gridpoints.

resolution_ll(lon, lat)[source]

Returns the local resolution at the nearest point of lon/lat. It’s the distance between this point and its closest neighbour. point must be a tuple (lon, lat).

secant_projection[source]

Is the projection secant to the sphere ? (or tangent)

select_subzone(subzone)[source]

If a LAMzone defines the geometry, select only the subzone from it and return a new geometry object. subzone among (‘C’, ‘CI’).

xy2ij(x, y, position=None)[source]

(x, y) being the coordinates in the projection,

(i, j) being the coordinates in the 2D matrix of CIE gridpoints. - position: position represented by (x,y) with respect to model cell.

Defaults to position_on_grid[‘horizontal’].

Caution: (i,j) are float (the nearest grid point is the nearest integer).

Note that origin of coordinates in projection is the center of the C+I domain.

xy2ll(x, y)[source]

(x, y) being the coordinates in the projection,

(lon, lat) being the lon/lat coordinates in degrees.

Note that origin of coordinates in projection is the center of the C+I domain.

class epygram.geometries.D3Geometry.D3GaussGeometry(*args, **kwargs)[source]

Bases: epygram.geometries.D3Geometry.D3Geometry

Handles the geometry for a Global Gauss grid 3-Dimensions Field.

Footprint:

dict(
    attr = dict(
        dimensions = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles grid dimensions.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        geoid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = footprints.stdtypes.FPDict::<<
                    as_dict:: dict()
                >>, 
            info = 'To specify geoid shape; actually used in projected geometries only.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        grid = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Handles description of the horizontal grid.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = footprints.stdtypes.FPDict, 
            values = set([]),
        ), 
        name = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Name of geometrical type of representation of points on                       the Globe.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['reduced_gauss', 'rotated_reduced_gauss']),
        ), 
        position_on_horizontal_grid = dict(
            access = 'rwx', 
            alias = set([]), 
            default = '__unknown__', 
            info = 'Position of points w/r to the horizontal.', 
            optional = True, 
            outcast = set([]), 
            remap = dict(), 
            type = str, 
            values = set(['center-left', 'lower-right', 'upper-right', 'lower-center', 'lower-left', 'center-right', 'upper-left', '__unknown__', 'upper-center', 'center']),
        ), 
        structure = dict(
            access = 'rxx', 
            alias = set([]), 
            default = None, 
            info = 'Type of geometry.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            values = set(['3D']),
        ), 
        vcoordinate = dict(
            access = 'rwx', 
            alias = set([]), 
            default = None, 
            info = 'Handles vertical geometry parameters.', 
            optional = False, 
            outcast = set([]), 
            remap = dict(), 
            type = epygram.geometries.VGeometry.VGeometry, 
            values = set([]),
        ),
    ), 
    bind = [], 
    info = 'Not documented', 
    only = dict(), 
    priority = dict(
        level = footprints.priorities.PriorityLevel::DEFAULT,
    ),
)
get_datashape(nb_validities, horizontal_only=False, d4=False)

Returns the data shape according to the geometry. - horizontal_only: the data doesn’t have vertical coordinate - nb_validities is the number of validities represented in data values - d4: if True, returned values are shaped in a 4 dimensions array

if False, shape of returned values is determined with respect to geometry
get_lonlat_grid(position=None, d4=False, nb_validities=0, **kwargs)[source]

Returns a tuple of two tables containing one the longitude of each point, the other the latitude, with 2D shape.

Shape of 2D data in Gauss grids:

  • grid[0, 0:Nj] is first (Northern) band of latitude, masked after Nj = number of longitudes for latitude j
  • grid[-1, 0:Nj] is last (Southern) band of latitude (idem).

Args:

  • position: position of lonlat grid with respect to the model cell. Defaults to position_on_grid[‘horizontal’].

  • d4: if True, returned values are shaped in a 4 dimensions array

    if False, shape of returned values is determined with respect to geometry d4=True requires nb_validities > 0

  • nb_validities is the number of validities represented in data values

ij2ll(i, j, position=None)[source]

(i, j) being the coordinates in the 2D matrix of gridpoints,

(lon, lat) being the lon/lat coordinates in degrees. - position: lat lon position to return with respect to the model cell.

Defaults to position_on_grid[‘horizontal’].
ll2ij(lon, lat, position=None)[source]

(lon, lat) being the lon/lat coordinates in degrees,

(i, j) being the coordinates in the 2D matrix of gridpoints. - position: lat lon position with respect to the model cell.

Defaults to position_on_grid[‘horizontal’].
make_basemap(gisquality='i', specificproj=None, zoom=None, **kwargs)[source]

Returns a matplotlib.basemap.Basemap object of the ‘ad hoc’ projection (if available). This is designed to avoid explicit handling of deep horizontal geometry attributes.

Args:

  • gisquality: defines the quality of GIS contours, cf. Basemap doc.

    Possible values (by increasing quality): ‘c’, ‘l’, ‘i’, ‘h’, ‘f’.

  • specificproj: enables to make basemap on the specified projection, among: ‘kav7’, ‘cyl’, ‘ortho’, (‘nsper’, {...}) (cf. Basemap doc).

    In ‘nsper’ case, the {} may contain:

    • ‘sat_height’ = satellite height in km;
    • ‘lon’ = longitude of nadir in degrees;
    • ‘lat’ = latitude of nadir in degrees.

    Overwritten by zoom.

  • zoom: specifies the lon/lat borders of the map, implying hereby a ‘cyl’ projection. Must be a dict(lonmin=, lonmax=, latmin=, latmax=).

    Overwrites specificproj.

map_factor(lon, lat)

Returns the map factor at the given longitude/latitude(s) (lon, lat) point in degrees.

map_factor_field(position=None)

Returns a new field whose data is the map factor over the field. - position: grid position with respect to the model cell.

Defaults to position_on_grid[‘horizontal’].
nearest_points(lon, lat, interpolation, position=None, external_distance=None)[source]

Returns a list of the (i, j) position of the points needed to perform an interpolation.

Args:

  • lon: longitude of point in degrees.

  • lat: latitude of point in degrees.

  • interpolation can be: - nearest to get the nearest point only - linear to get the 2*2 points bordering the (lon, lat) position - cubic to get the 4*4 points bordering the (lon, lat) position - (‘custom:radius’, radius_length) to get the surrounding points in a

    given (square) radius in metres.

  • position: position in the model cell of the lat lon position. Defaults to position_on_grid[‘horizontal’].

  • external_distance can be a dict containing the target point value and an external field on the same grid as self, to which the distance is computed within the 4 horizontally nearest points; e.g. {‘target_value’:4810, ‘external_field’:a_3DField_with_same_geometry}. If so, the nearest point is selected with distance = |target_value - external_field.data|

point_is_inside_domain_ij(i, j, margin=-0.1)[source]

Returns True if the point(s) of lon/lat coordinates is(are) inside the field.

Args:

  • lon: longitude of point(s) in degrees.
  • lat: latitude of point(s) in degrees.
  • margin: considers the point inside if at least ‘margin’ points far from the border. The -0.1 default is a safety for precision errors.
point_is_inside_domain_ll(lon, lat, margin=-0.1, position=None)[source]

Returns True if the point(s) of lon/lat coordinates is(are) inside the field.

Args:

  • lon: longitude of point(s) in degrees.
  • lat: latitude of point(s) in degrees.
  • margin: considers the point inside if at least ‘margin’ points far from the border. The -0.1 default is a safety for precision errors.
  • position: position of the grid with respect to the model cell. Defaults to position_on_grid[‘horizontal’].
reproject_wind_on_lonlat(u, v, lon, lat, map_factor_correction=True, reverse=False)[source]

Reprojects a wind vector (u, v) on rotated/stretched sphere onto real sphere, i.e. with components on true zonal/meridian axes. lon/lat are the point(s) coordinates on real sphere.

If map_factor_correction, applies a correction of magnitude due to map factor.

If reverse, apply the reverse reprojection.

reshape_data(data, nb_validities, horizontal_only=False, d4=False)[source]

Returns a 2D data reshaped from 1D, according to geometry.

  • data: the 1D data, of dimension concording with geometry.

  • horizontal_only: the input data doesn’t have vertical coordinate

  • nb_validities is the number of validities represented in data values

  • d4: if True, returned values are shaped in a 4 dimensions array

    if False, shape of returned values is determined with respect to geometry

resolution_ij(i, j)[source]

Returns the distance to the nearest point of (i,j) point. (i, j) being the coordinates in the 2D matrix of gridpoints.

resolution_ll(lon, lat)[source]

Returns the local resolution at the nearest point of lon/lat. It’s the distance between this point and its closest neighbour. point must be a tuple (lon, lat).

Previous topic

Geometries

Next topic

epygram.geometries.H2DGeometry — Horizontal 2-D Geometry class

This Page