epygram.geometries.RotLLGeometry — RotLL Geometry class

Contains the classes for 3D geometries of fields.


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

Bases: epygram.geometries.AbstractGeometry.LLGeometry

Handles the geometry for a Rotated 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 ‘rotated_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) in true lon/lat coordinates.

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

Return the (lon, lat) true 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) == (rot’lon, rot’lat) coordinates of point (i,j), in the rotated coordinates system.

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.

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 – true longitude of point in degrees

  • lat – true 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) == (rot’lon, rot’lat) coordinates of point (lon, lat) in degrees, in the rotated system.

Parameters
  • lon – true longitude of point in degrees

  • lat – true latitude of point in degrees

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

Return the (i, j) indexes of point (x, y) == (rot’lon, rot’lat), in the 2D matrix of gridpoints.

Parameters
  • x – rotated lon coordinate of point

  • y – rotated lat coordinate of point

  • 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).

xy2ll(x, y)[source]

Return the (lon, lat) coordinates of point (x, y) == (rot’lon, rot’lat) in the rotated system, in degrees.

Parameters
  • x – rotated lon coordinate of point in the projection

  • y – rotated lat coordinate of point in the projection