converts byte data to absolte values or vise versa (param_unconvert)

Share:

Description

converts byte data as stored in '.gz'-files to absolte values (param_convert) or vise versa (param_unconvert) using the parameter_definitions-dataset. param_convert is used by readbin, param_unconvert is used by writebin.

Usage

1
2
3
param_convert(x,param)

param_unconvert(x,param)

Arguments

x

vector, matrix or raster-object holding byte-data that that should be converted to absolute values (param_convert) or vise versa (param_unconvert).

param

Character string indicating parameter of the dataset to be treated. See parameter_definitions for available parameters.

Author(s)

Robert K. Bauer

See Also

param_unconvert, readbin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library('fields')
setwd(system.file("test_files", package="oceanmap"))
gz.file <- Sys.glob('*.gz')[1] # load sample-'.gz'-files
param <- name_split(gz.file)$parameter
print(param)

## converted data, according to param information
m <- readbin(gz.file, Raster=FALSE) 
image.plot(m)

## byte data ("unconverted") according to param information, as stored in ".gz"files
bin <- param_unconvert(m,param) 
image.plot(bin)

## reconverting byte data, according to param information
conv <- param_convert(bin,param) 
image.plot(conv)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.