romscoords: Extract coordinate arrays from ROMS.

Description Usage Arguments Details Value Examples

View source: R/romscoords.R

Description

Returns a RasterStack of the given variable names.

Usage

1
2
3
4
5
6
7
8
9
romscoords(
  x,
  spatial = c("lon_u", "lat_u"),
  ncdf = TRUE,
  transpose = TRUE,
  ...,
  varname = "",
  flip_y = TRUE
)

Arguments

x

ROMS file name

spatial

names of coordinate variables (e.g. lon_u, lat_u)

ncdf

default to NetCDF no matter what file name

transpose

the extents (ROMS is FALSE, Access is TRUE)

...

unused

varname

in desperate cases, specify the variable that these coordinate variables belong to

flip_y

Y coordinates are assumed to be in top-down order, set to FALSE to assume down-up

Details

The two layers from the model output are used to define the real-world space. This is used to create a boundary romsboundary, to map real-world objects into grid space romscoords and to generate graticules for mapping into the grid space with graphics::contour.

Value

RasterStack with two layers of the 2D-variables

Examples

1
2
3
4
5
6
7
8
## Not run: 
  coord <- romscoord("roms.nc")

## End(Not run)
## with in-built fake data
plot(ice_fake, asp = 0.5)
contour(ice_coords[[1]], add = TRUE, levels = seq(-165, 165, by = 15))
contour(ice_coords[[2]], add = TRUE)

mdsumner/oms documentation built on April 20, 2020, 8:51 p.m.