get.grid.info.M3 {M3}R Documentation

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)

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.

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.

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

Warning

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

Note

This function relies on the R package ncdf4 to read information from Models3-formatted files, since the Models3 format is built on netCDF
(https://www.unidata.ucar.edu/software/netcdf/).
Usually, the user will not call this function directly; instead, it will be called by the function get.coord.for.dimension.

Author(s)

Jenise Swall

See Also

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

Examples

## 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)

[Package M3 version 0.4 Index]