Skip to contents

This function is used to define a new domain with a regular grid. At a minimum, the projection, geographic location of the centre of the domain and number and horizontal resolution of the grid points must be provided.

Usage

define_domain(
  centre_lon,
  centre_lat,
  nxny,
  dxdy,
  proj = c("lambert", "lcc", "merc", "mercator", "omerc", "tmerc", "somerc", "lalo",
    "longlat", "latlong", "ob_tran", "rot_longlat", "rot_latlong", "RotLatLon", "stere",
    "stereo", "stereographic"),
  ref_lon,
  ref_lat,
  exey = NULL,
  tilt = 0,
  R = 6371229,
  ...
)

Arguments

centre_lon, centre_lat

The longitude and latitude of the centre of the domain in decimal degrees.

nxny

The number of grid points in the x and y directions. Should be a vector of length 2 with the number of grid points in the x direction first. If only 1 value is given it is assumed to be the same in both directions.

dxdy

The horizontal resolution of the grid in the x and y directions. For lat-lon projections this should be in decimal degrees, otherwise should be in metres. Should be a vector of length 2 with the resolution in the x direction first.

proj

The projection of the domain. This can be the name of the projection or a projection string.

ref_lon, ref_lat

The reference longitude and latitude of the projection if relevant to the projection. Ignored if proj is a projection string.

exey

If defining a grid with an extension zone, a vector length 2 with the number of grid points in the x and y directions of the extension zone. If only 1 value is given it is assumed to be the same in both directions.

tilt

The tilt used in a rotated Mercator projection.

R

The radius of the earth in metres. The default is 6371229m.

...

Other arguments describing the shape of the earth in proj format.

Value

A geodomain

Examples

dd <- define_domain(10, 60, 1000, 2500) # Default lambert projection
plot(dd)


dd <- define_domain(0, 0, c(360, 180), 1, "latlong") # Whole earth
plot(dd)


# Pass the projection as a proj string
dd <- define_domain(
  10, 60, 1000, 2500,
  proj = "+proj=lcc +lon_0=15 +lat_0=63.3 +lat_1=63.3 +lat_2=63.3 +R=6371000"
)
plot(dd)