Learn R Programming

M3 (version 0.4)

get.grid.info.M3: Get information about the grid used by the air quality model

Description

Pull information about the grid used from the Models3-formatted file. This includes information such as the origin of the grid (lower left corner coordinates in grid units), cell spacing, etc.

Usage

get.grid.info.M3(file)

Value

List with the following components:

x.orig

X-coordinate of the origin point of the grid (lower left corner, coordinates in model projection units)

y.orig

Y-coordinate of the origin point of the grid (lower left corner, coordinates in model projection units)

x.cell.width

Width of grid cells in x-direction (in model projection units)

y.cell.width

Width of grid cells in y-direction (in model projection units)

hz.units

Units of the projection (“m”, “km”, or “deg”)

ncols

Number of columns of grid cells

nrows

Number of rows of grid cells

nlays

Number of vertical layers

Arguments

file

File name of Models3-formatted file which contains information about the projection. Currently, this function can only handle files with Lambert conic conformal, polar stereographic, and longitude/latitude projections.

Author

Jenise Swall

Warning

Currently, this function can only handle files with Lambert conic conformal, polar stereographic, and longitude/latitude projections.

Details

This function assumes that the projection is either Lambert conic conformal or polar stereographic projection. Information about grid cell size, extent of grid, etc. is stored in the global attributes of the Models3-formatted file, which this function reads.

See Also

get.proj.info.M3, get.coord.for.dimension

Examples

Run this code
## As mentioned in notes above, user will not typically call
## this function directly.

## Find the path to a demo file with lambert conic conformal projection.
lcc.file <- system.file("extdata/ozone_lcc.ncf", package="M3")
## Get a list containing information about the grid in this file.
grid.info <- get.grid.info.M3(lcc.file)


## Find the path to a demo file with polar stereographic projection.
polar.file <- system.file("extdata/surfinfo_polar.ncf", package="M3")
## Get a list containing information about the grid in this file.
grid.info <- get.grid.info.M3(polar.file)

Run the code above in your browser using DataLab