pywgrib2_xr.grid_fromdict

pywgrib2_xr.grid_fromdict(projname, globe=None, **kwargs)[source]

Factory method to create projection from dictionary.

Parameters
  • projname (str) – Projection name, one of {‘latitude_longitude’, ‘rotated_latitude_longitude’, ‘mercator’, ‘polar_stereographic’, ‘lambert_conformal’, ‘gaussian’, ‘space_view’}.

  • globe (dict) – Mapping: code -> int, ‘shape’ -> str, ‘earth_radius’ -> float, ‘semi_major_axis’ -> float, ‘semi_minor_axis’ -> float

  • **kwargs

    Projection-specific parameters.

    • latitude_longitude:

      • La1 : latitude of first grid point

      • Lo1 : longitude of first grid point

      • Ni : number of points along a parallel

      • Nj : number of points along a meridan

      • Di : i direction increment (deg)

      • Dj : j direction increment (deg)

    • rotated latitude_longitude:

      • La1 : latitude of first grid point

      • Lo1 : longitude of first grid point

      • Ni : number of points along a parallel

      • Nj : number of points along a meridan

      • Di : i direction increment (deg)

      • Dj : j direction increment (deg)

      • LaSP : latitude of the southern pole of projection

      • LoSP : longitude of the southern pole of projection

      • Rot : angle of rotation of projection

    • mercator:

      • La1 : latitude of first grid point

      • Lo1 : longitude of first grid point

      • La2 : latitude of last grid point

      • Lo2 : longitude of last grid point

      • LaD : latitude where Di and Dj are specified

      • Ni : number of points along a parallel

      • Nj : number of points along a meridian

      • Di : longitudinal direction grid length

      • Dj : latitudinal direction grid length

    wgrib2/Sec1.c - polar_stereographic:

    • La1 : latitude of first grid point

    • Lo1 : longitude of first grid point

    • LaD : latitude where Dx and Dy are specified [deg]. LaD must be 60 (nps) or -60 (sps) (library limitation).

    • LoV : longitude where y axis is parallel to meridian.

    • LaO : latitude of projection origin, either 90 (nps) or -90 (sps)

    • Nx : number of points along the x-axis

    • Ny : number of points along the y-axis

    • Dx : x-direction grid length [m]

    • Dy : y-direction grid length [m]

    • lambert_conformal_conic:

      • La1 : latitude of first grid point

      • Lo1 : longitude of first grid point

      • LaD : latitude where Dx and Dy are specified [deg]

      • LoV : longitude where y axis is parallel to meridian

      • Latin1 : first latitude from pole which cuts the secant cone

      • Latin2 : second latitude from pole which cuts the secant cone

      • Nx : number of points along the x-axis

      • Ny : number of points along the y-axis

      • Dx : x-direction grid length [m]

      • Dy : y-direction grid length [m]

    • gaussian :
      • lat0, lon0 : degrees of lat/lon for 1st grid point lon1 = -lon0, lat1 = lat0 + (nx-1)*dlon

      • nx : number of grid points in X direction.

      • ny : number of grid points in Y direction. ny must be even.

      • dlon : degrees of longitude between adjacent grid points.

    • space_view :

      • Lap : latitude of sub-satellite point

      • Lop : longitude of sub-satellite point

      • Nx : number of points along the x-axis

      • Ny : number of points along the y-axis

      • Dx : apparent diameter of Earth in grid lengths, in x-direction

      • Dy : apparent diameter of Earth in grid lengths, in y-direction

      • Xp : x-coordinate of sub-satellite point

      • Yp : y-coordinate of sub-satellite point

      • Nr : altitude of the camera from the Earth’s centre, measured in units of the Earth’s (equatorial) radius

      • Xo : x-coordinate of origin of sector image

      • Yo : y-coordinate of origin of sector image

    • unstructured :

      • Npts : number of points.

    The following parameter is common for all projections :

    • winds : {‘grid’, ‘earth’}, optional. Vector orientation. Default is ‘earth’.

Returns

Projection specific class instance.

Return type

Grid