API reference

This page provides an auto-generated summary of the pyremap API.

Mesh Descriptors

get_corners_1d(ds, var_name)

Get the coordinates of grid-cell corners along a 1D coordinate, using the CF bounds of the coordinate if they are available and usable, and interpolating and extrapolating from cell centers if not.

get_corners_2d(ds, lat_var_name, lon_var_name)

Get the coordinates of grid-cell corners for 2D latitude and longitude coordinates, using the CF bounds of the coordinates if they are available and usable, and interpolating and extrapolating from cell centers if not.

interp_extrap_corner(in_field)

Interpolate/extrapolate a 1D field from grid centers to grid corners

interp_extrap_corners_2d(in_field)

Interpolate/extrapolate a 1D field from grid centers to grid corners

get_lat_lon_descriptor(dlon, dlat[, ...])

Get a descriptor of a lat-lon grid, used for remapping

LatLonGridDescriptor([mesh_name, regional])

A class for describing a lat-lon grid

LatLonGridDescriptor.read([filename, ds, ...])

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

LatLonGridDescriptor.create(lat_corner, ...)

Create the lat-lon grid with the given arrays and units.

LatLonGridDescriptor.to_scrip(scrip_filename)

Given a lat-lon grid file, create a SCRIP file based on the grid.

LatLon2DGridDescriptor([mesh_name, regional])

A class for describing a lat-lon grid that may not be a tensor grid (lat/lon are 2D arrays).

LatLon2DGridDescriptor.read([filename, ds, ...])

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

LatLon2DGridDescriptor.to_scrip(scrip_filename)

Create a SCRIP file based on the grid.

MpasCellMeshDescriptor(filename[, mesh_name])

A class for describing an MPAS cell mesh

MpasCellMeshDescriptor.to_scrip(scrip_filename)

Create a SCRIP file from the MPAS mesh.

MpasEdgeMeshDescriptor(filename[, mesh_name])

A class for describing an MPAS edge mesh

MpasEdgeMeshDescriptor.to_scrip(scrip_filename)

Create a SCRIP file from the MPAS mesh.

MpasVertexMeshDescriptor(filename[, mesh_name])

A class for describing an MPAS vertex mesh

MpasVertexMeshDescriptor.to_scrip(scrip_filename)

Create a SCRIP file from the MPAS mesh.

PointCollectionDescriptor(lats, lons, ...[, ...])

A class for describing a collection of points

PointCollectionDescriptor.to_scrip(...[, ...])

Write a SCRIP file for the point collection

ProjectionGridDescriptor(projection[, mesh_name])

A class for describing a general logically rectangular grid that can be defined by a pyproj projection.

ProjectionGridDescriptor.read(projection, ...)

Given a grid file with x and y coordinates defining the axes of the logically rectangular grid, read in the x and y coordinates and locate the corners.

ProjectionGridDescriptor.create(projection, ...)

Given x and y coordinates defining the axes of the logically rectangular grid, save the coordinates interpolate/extrapolate to locate corners.

ProjectionGridDescriptor.to_scrip(scrip_filename)

Create a SCRIP file based on the grid and projection.

Remapping

Remapper.src_from_lon_lat(filename[, ...])

Set the source grid from a file with a longitude-latitude grid.

Remapper.src_from_mpas(filename, mesh_name)

Set the source grid from an MPAS mesh file

Remapper.src_from_proj(filename, mesh_name)

Set the source grid from a file with a projection grid.

Remapper.dst_from_lon_lat(filename[, ...])

Set the destination grid from a file with a longitude-latitude grid.

Remapper.dst_from_mpas(filename, mesh_name)

Set the destination grid from an MPAS mesh file

Remapper.dst_from_points(filename, mesh_name)

Set the destination grid from a file with a collection of points.

Remapper.dst_from_proj(filename, mesh_name)

Set the destination grid from a file with a projection grid.

Remapper.build_map([logger])

Make the mapping file

Remapper.ncremap(in_filename, out_filename)

Given a source file defining either an MPAS mesh or a lat-lon grid and a destination file or set of arrays defining a lat-lon grid, constructs a mapping file used for interpolation between the source and destination grids.

Remapper.remap_numpy(ds[, ...])

Given a source data set, returns a remapped version of the data set, possibly masked and renormalized.

Polar projections

get_arctic_stereographic_projection()

Get a projection for an Arctic stereographic comparison grid

get_antarctic_stereographic_projection()

Get a projection for an Antarctic steregraphic grid

get_polar_descriptor_from_file(filename[, ...])

Get a descriptor of a polar stereographic grid used for remapping

get_polar_descriptor(lx, ly, dx, dy[, ...])

Get a descriptor of a polar stereographic grid used for remapping

to_polar(points)

from_polar(points)