epygram.geometries.RegLLGeometry — RegLL Geometry class

Contains the classes for 3D geometries of fields.


class epygram.geometries.RegLLGeometry.RegLLGeometry(name, grid, dimensions, vcoordinate, position_on_horizontal_grid='__unknown__', geoid=None)[source]

Bases: epygram.geometries.AbstractGeometry.LLGeometry

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

TODO: Is this class really necessary. Maybe we could make only one class

with LLGeometry, RegLLGeometry and RotLLGEometry? Is a RegLLGeometry equivalent to a RotLLGeometry with a null rotation angle?

Parameters
  • name – Name of geometrical type of representation of points on the Globe. Name must be ‘regular_lonlat’

  • grid – Handles description of the horizontal grid.

  • dimensions – Handles grid dimensions.

  • vcoordinate – Handles vertical geometry parameters.

  • position_on_horizontal_grid

    Position of points w/r to the horizontal. among: [‘upper-right’, ‘upper-left’,

    ’lower-left’, ‘lower-right’, ‘center-left’, ‘center-right’, ‘lower-center’, ‘upper-center’, ‘center’, ‘__unknown__’]

  • geoid – To specify geoid shape.

getcenter()[source]

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

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

Return the (lon, lat) coordinates of point (i,j), in degrees.

Parameters
  • i – X index of point in the 2D matrix of gridpoints

  • j – Y index of point in the 2D matrix of gridpoints

  • position – lat lon position to return with respect to the model cell. Defaults to self.position_on_horizontal_grid.

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

Return the (x, y) coordinates of point (i,j), in the projection.

Parameters
  • i – X index of point in the 2D matrix of gridpoints

  • j – Y index of point in the 2D matrix of gridpoints

  • position – position to return with respect to the model cell. Defaults to self.position_on_horizontal_grid.

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

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

Return the (i, j) indexes of point (lon, lat) in degrees, in the 2D matrix of gridpoints.

Parameters
  • lon – longitude of point in degrees

  • lat – latitude of point in degrees

  • position – lat lon position to return with respect to the model cell. Defaults to self.position_on_horizontal_grid.

Caution: (i,j) are float.

ll2xy(lon, lat)[source]

Return the (x, y) coordinates of point (lon, lat) in degrees.

Parameters
  • lon – longitude of point in degrees

  • lat – latitude of point in degrees

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

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

Return the (i, j) indexes of point (x, y), in the 2D matrix of gridpoints.

Parameters
  • x – X coordinate of point in the projection

  • y – Y coordinate of point in the projection

  • position – position to return with respect to the model cell. Defaults to self.position_on_horizontal_grid.

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]

Return the (lon, lat) coordinates of point (x, y) in the 2D matrix of gridpoints*(i,j)*, in degrees.

Parameters
  • x – X coordinate of point in the projection

  • y – Y coordinate of point in the projection

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