pyremap.descriptor.LatLon2DGridDescriptor

class pyremap.descriptor.LatLon2DGridDescriptor(meshName=None, regional=True)[source]

A class for describing a lat-lon grid that may not be a tensor grid (lat/lon are 2D arrays). The grid is assumed to be regional, since this is difficult to determine just from the lat/lon values. The calling code should pass regional=False to the constructor or read() method for global grids with 2D lat/lon.

Variables:
  • lat (numpy.ndarray) – The latitude coordinate at grid-cell centers

  • lon (numpy.ndarray) – The longitude coordinate at grid-cell centers

  • latCorner (numpy.ndarray) – The latitude coordinate at grid-cell corners

  • lonCorner (numpy.ndarray) – The longitude coordinate at grid-cell corners

  • history (str) – The history attribute written to SCRIP files

__init__(meshName=None, regional=True)[source]

Construct a mesh descriptor

meshNamestr or None, optional

The name of the mesh or grid, used to give mapping files unique names

regionalbool or None, optional

Whether this is a regional or global grid

Methods

__init__([meshName, regional])

Construct a mesh descriptor

read([fileName, ds, latVarName, lonVarName, ...])

Read the lat-lon grid from a file with the given lat/lon var names.

to_esmf(esmfFileName)

Subclasses should overload this method to write an ESMF mesh file based on the mesh.

to_scrip(scripFileName)

Create a SCRIP file based on the grid.