epygram.myproj — Projection tools

This module has been developped as a temporary alternative to pyproj.

Deprecated since version 1.0.0: Use pyproj instead. Shall be removed from the package in a future version.

class epygram.myproj.Proj(proj, geoidshape=u'sphere', geoidradius=6371229.0, x_0=0.0, y_0=0.0, **proj_params)[source]

Bases: epygram.util.RecursiveObject

A class of homemade projections on the sphere, made to handle cases not handled by pyproj (e.g. sphere geoid for polar stereographic projection...).

Initializes parameters for projection formulas.

Args:

  • proj: name of the projection, among (‘lambert’, ‘mercator’, ‘polar_stereographic’)

  • geoidshape: actually, only ‘sphere’ is implemented.

  • earth_radius: can be specified, to use a specific earth radius, in m.

  • x_0, y_0 : offset of Origin in (x, y) coordinates of projected map.

  • proj_params: a set of arguments that depends on the projection. (all lon/lat are in degrees):

    • lambert: lon_0 = longitude of reference point

      lat_1 = first secant latitude

      lat_2 = second secant latitude

      if tangent, lat_1 = lat_2 = lat_0 = latitude of reference point = tangency latitude

    • mercator: lon_0 = longitude of reference point

      lat_ts = tangency latitude (0°) or secant latitude

    • polar_stereographic: lon_0 = longitude of reference point

      lat_0 = +/- 90° depending on the projection pole lat_ts = secant or tangency latitude

__call__(x, y, inverse=False)[source]

Converts lon/lat coordinates (in °) to x/y coord in the projection.

If inverse is True, makes the inverse conversion, from x/y to lon/lat (in °).

__init__(proj, geoidshape=u'sphere', geoidradius=6371229.0, x_0=0.0, y_0=0.0, **proj_params)[source]

Initializes parameters for projection formulas.

Args:

  • proj: name of the projection, among (‘lambert’, ‘mercator’, ‘polar_stereographic’)

  • geoidshape: actually, only ‘sphere’ is implemented.

  • earth_radius: can be specified, to use a specific earth radius, in m.

  • x_0, y_0 : offset of Origin in (x, y) coordinates of projected map.

  • proj_params: a set of arguments that depends on the projection. (all lon/lat are in degrees):

    • lambert: lon_0 = longitude of reference point

      lat_1 = first secant latitude

      lat_2 = second secant latitude

      if tangent, lat_1 = lat_2 = lat_0 = latitude of reference point = tangency latitude

    • mercator: lon_0 = longitude of reference point

      lat_ts = tangency latitude (0°) or secant latitude

    • polar_stereographic: lon_0 = longitude of reference point

      lat_0 = +/- 90° depending on the projection pole lat_ts = secant or tangency latitude