wrf.CoordPair

class wrf.CoordPair(x=None, y=None, lat=None, lon=None)

A class that stores (x, y) and/or (latitude, longitude) coordinate pairs.

Most math operators are supplied. When the other operand is a CoordPair, the operation is performed with the same attribute. When a math operation uses a scalar as the other operand, the operation is applied across all attributes.

x

The x-coordinate.

Type:

float

y

The y-coordinate.

Type:

float

lat

The latitude coordinate.

Type:

float

lon

The longitude coordinate.

Type:

float

__init__(x=None, y=None, lat=None, lon=None)

Initialize a CoordPair object.

Parameters:
  • x (float, optional) – The x-coordinate.

  • y (float, optional) – The y-coordinate.

  • lat (float, optional) – The latitude coordinate.

  • lon (float, optional) – The longitude coordinate.

Methods

__init__([x, y, lat, lon])

Initialize a CoordPair object.

latlon_str([fmt])

Return a str for the (latitude, longitude) coordinate pair.

xy_str([fmt])

Return a str for the (x,y) coordinate pair.