importRaster: Import generic raster file

Description Usage Arguments Details Value See Also Examples

View source: R/importRaster.R

Description

The function import the first layer of a generic raster file. Data are imported as an array of x, y, z columns.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
importRaster(
  file = file.choose(),
  k = 1,
  kz = 1,
  dx = 0,
  dy = 0,
  destaggering = FALSE,
  variable = NULL,
  verbose = FALSE
)

Arguments

file

The raster file to be imported.

k

A numerical factor to be applied to x and y coordinates (default = 1).

kz

A numerical factor to be applied to z values (default = 1).

dx

Shifts x coordinates by dx (default = 0).

dy

float. Shift y coordinates by dy (default = 0).

destaggering

Use TRUE to apply destaggering to X and Y coordinates (default = FALSE).

variable

The name of the variable to be imported.

verbose

If TRUE, prints out basic statistics (default = FALSE).

Details

Supported files include those managed by the raster package (as netcdf),

Destaggering is useful for importing data from the SPRAY model and it is not applied by default.

An optional summary output can be printed by setting the verbose parameter.

Value

It returns a dataframe with x, y and z columns.

See Also

importADSOBIN to import ADSO/BIN files. See importADSOBIN().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# Import binary (netcdf) file and convert coordinates from km to m,
# without destaggering:
mydata <- importRaster(file = "/path_to_file/filename.nc",
                       k = 1000,
                       destaggering = FALSE)

# Import binary (netcdf) file and convert coordinates from km to m,
# with shift of 100 m in both directions:
mydata <- importRaster(file = "/path_to_file/filename.nc",
                       k = 1000,
                       dx = 100,
                       dy = 100)

## End(Not run)

simulariatools documentation built on Nov. 30, 2021, 1:08 a.m.